rio: 0.0.36 -> 0.0.37
[NixPkgs.git] / pkgs / tools / networking / modemmanager / default.nix
blob64d61f0e323ca1ab51d827ec0fd020785dc648df
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 , bash
25 stdenv.mkDerivation rec {
26   pname = "modemmanager";
27   version = "1.22.0";
29   src = fetchFromGitLab {
30     domain = "gitlab.freedesktop.org";
31     owner = "mobile-broadband";
32     repo = "ModemManager";
33     rev = version;
34     hash = "sha256-/D9b2rCCUhpDCUfSNAWR65+3EyUywzFdH1R17eSKRDo=";
35   };
37   patches = [
38     # Since /etc is the domain of NixOS, not Nix, we cannot install files there.
39     # But these are just placeholders so we do not need to install them at all.
40     ./no-dummy-dirs-in-sysconfdir.patch
41   ];
43   strictDeps = true;
45   nativeBuildInputs = [
46     meson
47     ninja
48     vala
49     gobject-introspection
50     gettext
51     pkg-config
52     libxslt
53     python3
54   ];
56   buildInputs = [
57     glib
58     udev
59     libgudev
60     polkit
61     ppp
62     libmbim
63     libqmi
64     systemd
65     bash-completion
66     dbus
67     bash # shebangs in share/ModemManager/fcc-unlock.available.d/
68   ];
70   nativeInstallCheckInputs = [
71     python3
72     python3.pkgs.dbus-python
73     python3.pkgs.pygobject3
74   ];
76   mesonFlags = [
77     "-Dudevdir=${placeholder "out"}/lib/udev"
78     "-Ddbus_policy_dir=${placeholder "out"}/share/dbus-1/system.d"
79     "--sysconfdir=/etc"
80     "--localstatedir=/var"
81     "-Dvapi=true"
82   ];
84   postPatch = ''
85     patchShebangs \
86       tools/test-modemmanager-service.py
87   '';
89   # In Nixpkgs g-ir-scanner is patched to produce absolute paths, and
90   # that interferes with ModemManager's tests, causing them to try to
91   # load libraries from the install path, which doesn't usually exist
92   # when `make check' is run.  So to work around that, we run it as an
93   # install check instead, when those paths will have been created.
94   doInstallCheck = true;
95   preInstallCheck = ''
96     export G_TEST_DBUS_DAEMON="${dbus}/bin/dbus-daemon"
97     patchShebangs tools/tests/test-wrapper.sh
98   '';
99   installCheckTarget = "check";
101   meta = with lib; {
102     description = "WWAN modem manager, part of NetworkManager";
103     homepage = "https://www.freedesktop.org/wiki/Software/ModemManager/";
104     license = licenses.gpl2Plus;
105     maintainers = teams.freedesktop.members;
106     platforms = platforms.linux;
107   };