31 # Defaulting to false because usually the rationale for using elogind is to
32 # use it in situation where a systemd dependency does not work (especially
33 # when building with musl, which elogind explicitly supports).
34 enableSystemd ? false,
37 stdenv.mkDerivation rec {
41 src = fetchFromGitHub {
45 hash = "sha256-4KZr/NiiGVwzdDROhiX3GEQTUyIGva6ezb+xC2U3bkg=";
57 libxslt.bin # xsltproc
62 docbook_xml_dtd_45 # needed for docbook without Internet
64 python3Packages.python
65 python3Packages.jinja2
76 ] ++ (if enableSystemd then [ udev ] else [ eudev ]);
79 substituteInPlace meson.build --replace-fail "install_emptydir(elogindstatedir)" ""
84 url = "https://github.com/chimera-linux/cports/raw/49d65fe38be815b9918a15ac2d2ff2b123fc559a/main/elogind/patches/strerror_r.patch";
85 hash = "sha256-amqXP12mLtrkWuAURb3/aoQeeTSRYlYqL2q2zrKbhxk=";
88 url = "https://github.com/chimera-linux/cports/raw/49d65fe38be815b9918a15ac2d2ff2b123fc559a/main/elogind/patches/strerror_r_1.patch";
89 hash = "sha256-tVUlmPValUPApqRX+Cqkzn7bkIILYSuCouvgRsdl9XE=";
92 url = "https://github.com/chimera-linux/cports/raw/49d65fe38be815b9918a15ac2d2ff2b123fc559a/main/elogind/patches/xxx-musl-fixes.patch";
94 "src/basic/missing_prctl.h"
95 "src/libelogind/sd-journal/journal-file.h"
97 hash = "sha256-JYPB9AKbQpVgid5BhwBTvcebE5rxDFRMYhKRNS8KPTc=";
100 url = "https://github.com/chimera-linux/cports/raw/49d65fe38be815b9918a15ac2d2ff2b123fc559a/main/elogind/patches/gshadow.patch";
101 hash = "sha256-YBy1OeWD1EluLTeUvqUvZKyrZyoUbGg1mxwqG5+VNO0=";
105 url = "https://git.openembedded.org/openembedded-core/plain/meta/recipes-core/systemd/systemd/0005-add-missing-FTW_-macros-for-musl.patch?id=6bc5e3f3cd882c81c972dbd27aacc1ce00e5e59a";
106 hash = "sha256-SGvP0GT43vfyHxrmvl4AbsWQz8CPmNGyH001s3lTxng=";
109 name = "malloc_info.patch";
110 url = "https://git.openembedded.org/openembedded-core/plain/meta/recipes-core/systemd/systemd/0016-pass-correct-parameters-to-getdents64.patch?id=6bc5e3f3cd882c81c972dbd27aacc1ce00e5e59a";
111 hash = "sha256-8aOw+BTtl5Qta8aqLmliKSHEirTjp1xLM195EmBdEDI=";
114 name = "malloc_trim.patch";
115 url = "https://git.openembedded.org/openembedded-core/plain/meta/recipes-core/systemd/systemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch?id=6bc5e3f3cd882c81c972dbd27aacc1ce00e5e59a";
117 extraPrefix = [ "src/libelogind/" ];
118 hash = "sha256-rtSnCEK+frhnlwl/UW3YHxB8MUCAq48jEzQRURpxdXk=";
121 name = "malloc_info.patch";
122 url = "https://git.openembedded.org/openembedded-core/plain/meta/recipes-core/systemd/systemd/0021-shared-Do-not-use-malloc_info-on-musl.patch?id=6bc5e3f3cd882c81c972dbd27aacc1ce00e5e59a";
123 hash = "sha256-ZyOCmM5LcwJ7mHiZr0lQjV4G+XMxjhsUm7g7L3OzDDM=";
125 ./Add-missing-musl_missing.h-includes-for-basename.patch
126 ./Remove-outdated-musl-hack-in-rlimit_nofile_safe.patch
129 # Inspired by the systemd `preConfigure`.
130 # Conceptually we should patch all files required during the build, but not scripts
131 # supposed to run at run-time of the software (important for cross-compilation).
132 # This package seems to have mostly scripts that run at build time.
134 for dir in tools src/test; do
138 patchShebangs src/basic/generate-*.{sh,py}
142 (lib.mesonOption "dbuspolicydir" "${placeholder "out"}/share/dbus-1/system.d")
143 (lib.mesonOption "dbussystemservicedir" "${placeholder "out"}/share/dbus-1/system-services")
144 (lib.mesonOption "sysconfdir" "${placeholder "out"}/etc")
145 (lib.mesonBool "utmp" (!stdenv.hostPlatform.isMusl))
146 (lib.mesonEnable "xenctrl" false)
150 homepage = "https://github.com/elogind/elogind";
151 description = ''The systemd project's "logind", extracted to a standalone package'';
152 platforms = platforms.linux; # probably more
153 license = licenses.lgpl21Plus;
154 maintainers = with maintainers; [ nh2 ];