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