2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchgit
|
|
|
|
, autoreconfHook
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, ell
|
|
|
|
, coreutils
|
|
|
|
, docutils
|
|
|
|
, readline
|
|
|
|
, openssl
|
|
|
|
, python3Packages
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "iwd";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "1.16";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://git.kernel.org/pub/scm/network/wireless/iwd.git";
|
|
|
|
rev = version;
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "sha256-Nu6vb5UOJ/KgmJZM4bMKwLpOoKMLcnZPYCqFBQjuCYY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-12-27 14:24:52 +00:00
|
|
|
outputs = [ "out" "man" ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "test";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
docutils
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
python3Packages.wrapPython
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
ell
|
|
|
|
python3Packages.python
|
|
|
|
readline
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [ openssl ];
|
|
|
|
|
2020-12-27 14:24:52 +00:00
|
|
|
# wrapPython wraps the scripts in $test. They pull in gobject-introspection,
|
|
|
|
# which doesn't cross-compile.
|
2021-02-05 17:12:51 +00:00
|
|
|
pythonPath = lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [
|
2020-04-24 23:36:52 +00:00
|
|
|
python3Packages.dbus-python
|
|
|
|
python3Packages.pygobject3
|
|
|
|
];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-external-ell"
|
|
|
|
"--enable-wired"
|
|
|
|
"--localstatedir=/var/"
|
|
|
|
"--with-dbus-busdir=${placeholder "out"}/share/dbus-1/system-services/"
|
|
|
|
"--with-dbus-datadir=${placeholder "out"}/share/"
|
|
|
|
"--with-systemd-modloaddir=${placeholder "out"}/etc/modules-load.d/" # maybe
|
|
|
|
"--with-systemd-unitdir=${placeholder "out"}/lib/systemd/system/"
|
|
|
|
"--with-systemd-networkdir=${placeholder "out"}/lib/systemd/network/"
|
|
|
|
];
|
|
|
|
|
|
|
|
postUnpack = ''
|
2021-05-20 23:08:51 +00:00
|
|
|
mkdir -p iwd/ell
|
|
|
|
ln -s ${ell.src}/ell/useful.h iwd/ell/useful.h
|
2020-04-24 23:36:52 +00:00
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share
|
|
|
|
cp -a doc $out/share/
|
|
|
|
cp -a README AUTHORS TODO $out/share/doc/
|
2021-02-05 17:12:51 +00:00
|
|
|
'' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
2020-12-27 14:24:52 +00:00
|
|
|
mkdir -p $test/bin
|
|
|
|
cp -a test/* $test/bin/
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
wrapPythonPrograms
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
substituteInPlace $out/share/dbus-1/system-services/net.connman.ead.service \
|
|
|
|
--replace /bin/false ${coreutils}/bin/false
|
|
|
|
substituteInPlace $out/share/dbus-1/system-services/net.connman.iwd.service \
|
|
|
|
--replace /bin/false ${coreutils}/bin/false
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://git.kernel.org/pub/scm/network/wireless/iwd.git";
|
|
|
|
description = "Wireless daemon for Linux";
|
2021-03-23 19:22:30 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
2021-07-18 21:22:44 +00:00
|
|
|
maintainers = with maintainers; [ dtzWill fpletz maxeaubrey ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|