2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
, glib
|
|
|
|
, udev
|
|
|
|
, libgudev
|
|
|
|
, polkit
|
|
|
|
, ppp
|
|
|
|
, gettext
|
|
|
|
, pkg-config
|
|
|
|
, libxslt
|
|
|
|
, python3
|
|
|
|
, libmbim
|
|
|
|
, libqmi
|
|
|
|
, systemd
|
|
|
|
, bash-completion
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, vala
|
|
|
|
, gobject-introspection
|
|
|
|
, dbus
|
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";
|
2023-03-27 19:17:25 +00:00
|
|
|
version = "1.20.6";
|
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;
|
2023-03-27 19:17:25 +00:00
|
|
|
hash = "sha256-/A4WTsUQVeZDi5ei6qBvqoWYLKdRcZaYZU8/qWOPrvM=";
|
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
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
vala
|
|
|
|
gobject-introspection
|
|
|
|
gettext
|
|
|
|
pkg-config
|
|
|
|
libxslt
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
udev
|
|
|
|
libgudev
|
|
|
|
polkit
|
|
|
|
ppp
|
|
|
|
libmbim
|
|
|
|
libqmi
|
|
|
|
systemd
|
|
|
|
bash-completion
|
|
|
|
dbus
|
|
|
|
];
|
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
|
|
|
|
# when `make check' is run. So to work around that, we run it as an
|
|
|
|
# install check instead, when those paths will have been created.
|
|
|
|
doInstallCheck = true;
|
|
|
|
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
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2021-07-14 22:03:04 +00:00
|
|
|
installCheckTarget = "check";
|
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;
|
|
|
|
};
|
|
|
|
}
|