1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 autoreconfHook,
6 pkg-config,
7 python3Packages, # for tests
8 openssl, # for tests
9 enableManpages ? true,
10 docutils, # for manpages
11}:
12
13stdenv.mkDerivation (finalAttrs: {
14 pname = "eiwd";
15 version = "2.22-1";
16
17 src = fetchFromGitHub {
18 owner = "illiliti";
19 repo = "eiwd";
20 rev = finalAttrs.version;
21 hash = "sha256-rmkXR4RZbtD6lh8cGrHLWVGTw4fQqP9+Z9qaftG1ld0=";
22 fetchSubmodules = true;
23 };
24
25 outputs = [
26 "out"
27 "doc"
28 ]
29 ++ lib.optionals enableManpages [
30 "man"
31 ]
32 ++ lib.optionals finalAttrs.doCheck [
33 "test"
34 ];
35
36 postUnpack = ''
37 patchShebangs .
38 '';
39
40 nativeBuildInputs = [
41 autoreconfHook
42 pkg-config
43 ]
44 ++ lib.optionals enableManpages [
45 docutils # only for the man pages
46 ];
47
48 checkInputs = [
49 python3Packages.python
50 (lib.getBin openssl)
51 ];
52
53 configureFlags = [
54 "--disable-dbus"
55 ]
56 ++ lib.optionals (!enableManpages) [
57 "--disable-manual-pages"
58 ];
59
60 enableParallelBuilding = true;
61
62 # override this to false if you don't want to build python3
63 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
64
65 # prevent the `install-data-local` Makefile rule from running;
66 # all it does is attempt to `mkdir` the `localstatedir`.
67 preInstall = ''
68 mkdir install-data-local
69 substituteInPlace Makefile --replace \
70 '$(MKDIR_P) -m 700 $(DESTDIR)$(daemon_storagedir)' \
71 'true'
72 '';
73
74 postInstall = ''
75 mkdir -p $doc/share/doc
76 cp -a doc $doc/share/doc/iwd
77 cp -a README AUTHORS TODO $doc/share/doc/iwd
78 ''
79 + lib.optionalString finalAttrs.finalPackage.doCheck ''
80 mkdir -p $test/bin
81 cp -a test/* $test/bin/
82 '';
83
84 meta = with lib; {
85 homepage = "https://github.com/illiliti/eiwd/";
86 description = "Fork of iwd (wifi daemon) which does not require dbus";
87 license = licenses.lgpl21Plus;
88 platforms = platforms.linux;
89 };
90})