2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
2024-06-05 15:53:02 +00:00
|
|
|
, fetchpatch
|
2023-03-04 12:14:45 +00:00
|
|
|
, glib
|
|
|
|
, libgudev
|
|
|
|
, polkit
|
|
|
|
, ppp
|
|
|
|
, gettext
|
|
|
|
, pkg-config
|
|
|
|
, libxslt
|
|
|
|
, python3
|
|
|
|
, libmbim
|
|
|
|
, libqmi
|
|
|
|
, systemd
|
|
|
|
, bash-completion
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, vala
|
|
|
|
, gobject-introspection
|
|
|
|
, dbus
|
2024-04-21 15:54:59 +00:00
|
|
|
, bash
|
2021-07-14 22:03:04 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-09-18 10:52:07 +00:00
|
|
|
pname = "modemmanager";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "1.22.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
owner = "mobile-broadband";
|
|
|
|
repo = "ModemManager";
|
|
|
|
rev = version;
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-/D9b2rCCUhpDCUfSNAWR65+3EyUywzFdH1R17eSKRDo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
patches = [
|
|
|
|
# Since /etc is the domain of NixOS, not Nix, we cannot install files there.
|
|
|
|
# But these are just placeholders so we do not need to install them at all.
|
|
|
|
./no-dummy-dirs-in-sysconfdir.patch
|
2024-06-05 15:53:02 +00:00
|
|
|
|
|
|
|
(fetchpatch {
|
|
|
|
name = "GI_TYPELIB_PATH.patch";
|
|
|
|
url = "https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/commit/daa829287894273879799a383ed4dc373c6111b0.patch";
|
|
|
|
hash = "sha256-tPQokiZO2SpTlX8xMlkWjP1AIXgoLHW3rJwnmG33z/k=";
|
|
|
|
})
|
2023-03-04 12:14:45 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
vala
|
|
|
|
gobject-introspection
|
|
|
|
gettext
|
|
|
|
pkg-config
|
|
|
|
libxslt
|
2024-02-29 20:09:43 +00:00
|
|
|
python3
|
2023-03-04 12:14:45 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
libgudev
|
|
|
|
polkit
|
|
|
|
ppp
|
|
|
|
libmbim
|
|
|
|
libqmi
|
|
|
|
systemd
|
|
|
|
bash-completion
|
|
|
|
dbus
|
2024-04-21 15:54:59 +00:00
|
|
|
bash # shebangs in share/ModemManager/fcc-unlock.available.d/
|
2023-03-04 12:14:45 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeInstallCheckInputs = [
|
2023-03-04 12:14:45 +00:00
|
|
|
python3
|
|
|
|
python3.pkgs.dbus-python
|
|
|
|
python3.pkgs.pygobject3
|
2021-07-14 22:03:04 +00:00
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
mesonFlags = [
|
|
|
|
"-Dudevdir=${placeholder "out"}/lib/udev"
|
|
|
|
"-Ddbus_policy_dir=${placeholder "out"}/share/dbus-1/system.d"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2023-03-04 12:14:45 +00:00
|
|
|
"-Dvapi=true"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
postPatch = ''
|
2023-03-04 12:14:45 +00:00
|
|
|
patchShebangs \
|
|
|
|
tools/test-modemmanager-service.py
|
2021-07-14 22:03:04 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# In Nixpkgs g-ir-scanner is patched to produce absolute paths, and
|
|
|
|
# that interferes with ModemManager's tests, causing them to try to
|
|
|
|
# load libraries from the install path, which doesn't usually exist
|
2024-06-05 15:53:02 +00:00
|
|
|
# when `meson test' is run. So to work around that, we run it as an
|
2021-07-14 22:03:04 +00:00
|
|
|
# install check instead, when those paths will have been created.
|
|
|
|
doInstallCheck = true;
|
2024-06-05 15:53:02 +00:00
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
2022-12-02 08:20:57 +00:00
|
|
|
export G_TEST_DBUS_DAEMON="${dbus}/bin/dbus-daemon"
|
2021-07-14 22:03:04 +00:00
|
|
|
patchShebangs tools/tests/test-wrapper.sh
|
2024-06-05 15:53:02 +00:00
|
|
|
mesonCheckPhase
|
|
|
|
runHook postInstallCheck
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "WWAN modem manager, part of NetworkManager";
|
|
|
|
homepage = "https://www.freedesktop.org/wiki/Software/ModemManager/";
|
|
|
|
license = licenses.gpl2Plus;
|
2021-07-14 22:03:04 +00:00
|
|
|
maintainers = teams.freedesktop.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|