2018-02-25 03:23:58 +01:00
|
|
|
{ stdenv, fetchurl, udev, libgudev, polkit, dbus-glib, ppp, intltool, pkgconfig
|
2016-08-26 00:06:52 +02:00
|
|
|
, libmbim, libqmi, systemd }:
|
2012-01-04 10:05:22 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2014-02-13 18:02:15 +01:00
|
|
|
name = "ModemManager-${version}";
|
2017-09-29 08:29:15 +02:00
|
|
|
version = "1.6.8";
|
2012-01-04 10:05:22 +01:00
|
|
|
|
2014-02-08 20:16:34 +01:00
|
|
|
src = fetchurl {
|
2014-02-13 18:02:15 +01:00
|
|
|
url = "http://www.freedesktop.org/software/ModemManager/${name}.tar.xz";
|
2017-09-29 08:29:15 +02:00
|
|
|
sha256 = "0xj3ng7qcqxkib5qkprwghcivaz0mn449fw08l67h1zbpz23bh7z";
|
2012-01-04 10:05:22 +01:00
|
|
|
};
|
|
|
|
|
2012-12-28 19:20:09 +01:00
|
|
|
nativeBuildInputs = [ intltool pkgconfig ];
|
2012-01-04 10:05:22 +01:00
|
|
|
|
2018-02-25 03:23:58 +01:00
|
|
|
buildInputs = [ udev libgudev polkit dbus-glib ppp libmbim libqmi systemd ];
|
2012-01-04 10:05:22 +01:00
|
|
|
|
2014-02-08 20:16:34 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-polkit"
|
|
|
|
"--with-udev-base-dir=$(out)/lib/udev"
|
|
|
|
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
|
2015-03-26 21:12:50 +01:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2016-08-26 00:06:52 +02:00
|
|
|
"--with-suspend-resume=systemd"
|
2014-02-08 20:16:34 +01:00
|
|
|
];
|
2012-01-04 10:05:22 +01:00
|
|
|
|
2015-03-26 21:12:50 +01:00
|
|
|
installFlags = [ "DESTDIR=\${out}" ];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/etc/systemd/system
|
|
|
|
'';
|
|
|
|
|
2014-02-13 18:02:15 +01:00
|
|
|
postInstall = ''
|
2015-03-26 21:12:50 +01:00
|
|
|
mv $out/$out/etc/systemd/system/ModemManager.service $out/etc/systemd/system
|
|
|
|
rm -rf $out/$out/etc
|
|
|
|
mv $out/$out/* $out
|
|
|
|
DIR=$out/$out
|
|
|
|
while rmdir $DIR 2>/dev/null; do
|
|
|
|
DIR="$(dirname "$DIR")"
|
|
|
|
done
|
|
|
|
|
2014-02-13 18:02:15 +01:00
|
|
|
# systemd in NixOS doesn't use `systemctl enable`, so we need to establish
|
|
|
|
# aliases ourselves.
|
|
|
|
ln -s $out/etc/systemd/system/ModemManager.service \
|
|
|
|
$out/etc/systemd/system/dbus-org.freedesktop.ModemManager1.service
|
|
|
|
'';
|
|
|
|
|
2012-01-04 10:05:22 +01:00
|
|
|
meta = {
|
|
|
|
description = "WWAN modem manager, part of NetworkManager";
|
2017-03-27 19:11:17 +02:00
|
|
|
maintainers = [ ];
|
2012-01-06 17:14:02 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2012-01-04 10:05:22 +01:00
|
|
|
};
|
|
|
|
}
|