]> Git — Sourcephile - julm/julm-nix.git/blob - nixpkgs/pkgs/modemmanager-1-20-4.nix
oignon: openvpn: disable calyx
[julm/julm-nix.git] / nixpkgs / pkgs / modemmanager-1-20-4.nix
1 { lib
2 , stdenv
3 , fetchFromGitLab
4 , glib
5 , udev
6 , libgudev
7 , polkit
8 , ppp
9 , gettext
10 , pkg-config
11 , libxslt
12 , python3
13 , libmbim
14 , libqmi
15 , systemd
16 , bash-completion
17 , meson
18 , ninja
19 , vala
20 , gobject-introspection
21 , dbus
22 }:
23
24 stdenv.mkDerivation rec {
25 pname = "modemmanager";
26 version = "1.20.4";
27
28 src = fetchFromGitLab {
29 domain = "gitlab.freedesktop.org";
30 owner = "mobile-broadband";
31 repo = "ModemManager";
32 rev = version;
33 hash = "sha256-OWP23EQ7a8rghhV7AC9yinCxRI0xwcntB5dl9XtgK6M=";
34 };
35
36 patches = [
37 # Since /etc is the domain of NixOS, not Nix, we cannot install files there.
38 # But these are just placeholders so we do not need to install them at all.
39 ./no-dummy-dirs-in-sysconfdir.patch
40 ];
41
42 nativeBuildInputs = [
43 meson
44 ninja
45 vala
46 gobject-introspection
47 gettext
48 pkg-config
49 libxslt
50 ];
51
52 buildInputs = [
53 glib
54 udev
55 libgudev
56 polkit
57 ppp
58 libmbim
59 libqmi
60 systemd
61 bash-completion
62 dbus
63 ];
64
65 nativeInstallCheckInputs = [
66 python3
67 python3.pkgs.dbus-python
68 python3.pkgs.pygobject3
69 ];
70
71 mesonFlags = [
72 "-Dudevdir=${placeholder "out"}/lib/udev"
73 "-Ddbus_policy_dir=${placeholder "out"}/share/dbus-1/system.d"
74 "--sysconfdir=/etc"
75 "--localstatedir=/var"
76 "-Dvapi=true"
77 ];
78
79 postPatch = ''
80 patchShebangs \
81 tools/test-modemmanager-service.py
82 '';
83
84 # In Nixpkgs g-ir-scanner is patched to produce absolute paths, and
85 # that interferes with ModemManager's tests, causing them to try to
86 # load libraries from the install path, which doesn't usually exist
87 # when `make check' is run. So to work around that, we run it as an
88 # install check instead, when those paths will have been created.
89 doInstallCheck = true;
90 preInstallCheck = ''
91 export G_TEST_DBUS_DAEMON="${dbus}/bin/dbus-daemon"
92 patchShebangs tools/tests/test-wrapper.sh
93 '';
94 installCheckTarget = "check";
95
96 meta = with lib; {
97 description = "WWAN modem manager, part of NetworkManager";
98 homepage = "https://www.freedesktop.org/wiki/Software/ModemManager/";
99 license = licenses.gpl2Plus;
100 maintainers = teams.freedesktop.members;
101 platforms = platforms.linux;
102 };
103 }