2019-10-27 00:27:41 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, m4
|
|
|
|
, gperf
|
|
|
|
, getent
|
|
|
|
, libcap
|
|
|
|
, gettext
|
2021-01-17 02:09:27 +00:00
|
|
|
, pkg-config
|
2019-10-27 00:27:41 +01:00
|
|
|
, udev
|
|
|
|
, eudev
|
|
|
|
, libxslt
|
2019-10-26 16:53:52 +01:00
|
|
|
, python3
|
2019-10-27 00:27:41 +01:00
|
|
|
, docbook5
|
|
|
|
, docbook_xsl
|
|
|
|
, docbook_xsl_ns
|
|
|
|
, docbook_xml_dtd_42
|
|
|
|
, docbook_xml_dtd_45
|
|
|
|
|
|
|
|
# Defaulting to false because usually the rationale for using elogind is to
|
|
|
|
# use it in situation where a systemd dependency does not work (especially
|
|
|
|
# when building with musl, which elogind explicitly supports).
|
|
|
|
, enableSystemd ? false
|
|
|
|
}:
|
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
with lib;
|
2019-10-27 00:27:41 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "elogind";
|
2021-08-08 11:38:28 +01:00
|
|
|
version = "246.10";
|
2019-10-27 00:27:41 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "elogind";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-08-08 11:38:28 +01:00
|
|
|
sha256 = "sha256-+Nv6FL9Yjmfxs24+2mUTP//wbjzGUq4ftgJLfuEqBJg=";
|
2019-10-27 00:27:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
m4
|
2021-01-17 02:09:27 +00:00
|
|
|
pkg-config
|
2019-10-27 00:27:41 +01:00
|
|
|
gperf
|
|
|
|
getent
|
|
|
|
libcap
|
|
|
|
gettext
|
|
|
|
libxslt.bin # xsltproc
|
|
|
|
docbook5 docbook_xsl docbook_xsl_ns docbook_xml_dtd_42 docbook_xml_dtd_45 # needed for docbook without Internet
|
2019-10-26 16:53:52 +01:00
|
|
|
(python3.withPackages (p: with p; [ lxml ])) # fixes: man/meson.build:111:0: ERROR: Could not execute command "/build/source/tools/xml_helper.py".
|
2019-10-27 00:27:41 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs =
|
2019-10-26 16:53:52 +01:00
|
|
|
if enableSystemd then [ udev ] else [ eudev ];
|
2019-10-27 00:27:41 +01:00
|
|
|
|
2019-10-26 16:53:52 +01:00
|
|
|
# Inspired by the systemd `preConfigure`.
|
|
|
|
# Conceptually we should patch all files required during the build, but not scripts
|
|
|
|
# supposed to run at run-time of the software (important for cross-compilation).
|
|
|
|
# This package seems to have mostly scripts that run at build time.
|
2019-10-27 00:27:41 +01:00
|
|
|
preConfigure = ''
|
2019-10-26 16:53:52 +01:00
|
|
|
for dir in tools src/test; do
|
|
|
|
patchShebangs $dir
|
|
|
|
done
|
|
|
|
|
|
|
|
patchShebangs src/basic/generate-*.{sh,py}
|
2019-10-27 00:27:41 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Drootprefix=${placeholder "out"}"
|
|
|
|
"-Dsysconfdir=${placeholder "out"}/etc"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/elogind/elogind";
|
2019-10-27 00:27:41 +01:00
|
|
|
description = ''The systemd project's "logind", extracted to a standalone package'';
|
|
|
|
platforms = platforms.linux; # probably more
|
2019-10-26 16:53:52 +01:00
|
|
|
license = licenses.lgpl21Plus;
|
2019-10-27 00:27:41 +01:00
|
|
|
maintainers = with maintainers; [ nh2 ];
|
|
|
|
};
|
|
|
|
}
|