systemd.scm 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. ;;; This file is part of guix-bavier.git
  2. ;;; Copyright © 2020 Eric Bavier <bavier@posteo.net>
  3. ;;; License: GPLv3+
  4. (define-module (bavier packages systemd)
  5. #:use-module (guix packages)
  6. #:use-module (guix git-download)
  7. #:use-module (guix build-system meson)
  8. #:use-module (gnu packages)
  9. #:use-module (gnu packages gettext)
  10. #:use-module (gnu packages gperf)
  11. #:use-module (gnu packages linux)
  12. #:use-module (gnu packages m4)
  13. #:use-module (gnu packages pkg-config)
  14. #:use-module ((guix licenses) #:prefix license:))
  15. (define-public systemd
  16. (package
  17. (name "systemd")
  18. (version "246")
  19. (source (origin
  20. (method git-fetch)
  21. (uri (git-reference
  22. (url "https://github.com/systemd/systemd.git")
  23. (commit (string-append "v" version))))
  24. (file-name (git-file-name name version))
  25. (sha256
  26. (base32
  27. "0zrkyxrh5rm45f2l1rnjyv229bcyzawfw7c63jqxwix75px60dyw"))
  28. (patches (search-patches "bavier/patches/systemd-elide-mkdir.patch"))))
  29. (build-system meson-build-system)
  30. (native-inputs
  31. `(("gettext" ,gnu-gettext)
  32. ("gperf" ,gperf)
  33. ("m4" ,m4)
  34. ("pkg-config" ,pkg-config)))
  35. (inputs
  36. `(("libcap" ,libcap)
  37. ("util-linux" ,util-linux) ; for `mount`
  38. ("util-linux:lib" ,util-linux "lib"))) ; for libmount.so
  39. (arguments
  40. `(#:tests? #f ;Some tests require network, other
  41. ;require starting containers, which
  42. ;fails in our build container.
  43. #:configure-flags
  44. (list "-Dcreate-log-dirs=false"
  45. (string-append "-Drootprefix=" %output)
  46. (string-append "-Dsysconfdir=" %output "/etc")
  47. (string-append "-Dsysvinit-path=" %output "/etc/init.d")
  48. (string-append "-Dsysvrcnd-path=" %output "/etc/rc.d")
  49. (string-append "-Dtelinit-path=" %output "/lib/sysvinit/telinit")
  50. (string-append "-Drc-local=" %output "/etc/rc.local")
  51. ;; Many executables end up depending on libsystemd-shared-*.so,
  52. ;; which cannot be found with the standard rpath. This causes
  53. ;; Guix's validate-runpath phase to fail, so include that
  54. ;; library's directory in RUNPATH.
  55. (string-append "-Dc_link_args=-Wl,-rpath=" %output "/lib/systemd"))
  56. #:phases (modify-phases %standard-phases
  57. (add-before 'configure 'patch-hwdb-update
  58. (lambda* (#:key outputs #:allow-other-keys)
  59. (let ((out (assoc-ref outputs "out")))
  60. (substitute* "hwdb.d/meson.build"
  61. ;; Do not generate hwdb.bin in /etc/udev, but instead
  62. ;; in the output directory.
  63. (("systemd-hwdb update" &)
  64. (string-append & " --root " out)))
  65. #t))))))
  66. (home-page "https://systemd.io")
  67. (synopsis "System and Service Manager")
  68. (description "systemd is a suite of basic building blocks for a Linux
  69. system. It provides a system and service manager that runs as PID 1 and starts
  70. the rest of the system.")
  71. (license license:lgpl2.1+)))