2018-08-12 00:42:24 +01:00
|
|
|
{ stdenv, fetchurl, glib, udev, libgudev, polkit, ppp, gettext, pkgconfig
|
2018-03-23 09:04:24 +00:00
|
|
|
, libmbim, libqmi, systemd, fetchpatch }:
|
2012-01-04 09:05:22 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-10-15 22:08:03 +01:00
|
|
|
name = "modem-manager-${version}";
|
2018-03-13 21:37:13 +00:00
|
|
|
version = "1.7.990";
|
2012-01-04 09:05:22 +00:00
|
|
|
|
2018-11-04 23:43:47 +00:00
|
|
|
package = "ModemManager";
|
2014-02-08 19:16:34 +00:00
|
|
|
src = fetchurl {
|
2018-11-04 23:43:47 +00:00
|
|
|
url = "https://www.freedesktop.org/software/${package}/${package}-${version}.tar.xz";
|
2018-03-13 21:37:13 +00:00
|
|
|
sha256 = "1v4hixmghlrw7w4ajq2x4k62js0594h223d0yma365zwqr7hjrfl";
|
2012-01-04 09:05:22 +00:00
|
|
|
};
|
|
|
|
|
2018-03-13 21:37:13 +00:00
|
|
|
nativeBuildInputs = [ gettext pkgconfig ];
|
2012-01-04 09:05:22 +00:00
|
|
|
|
2018-08-12 00:42:24 +01:00
|
|
|
buildInputs = [ glib udev libgudev polkit ppp libmbim libqmi systemd ];
|
2018-03-23 09:04:24 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Patch dependency on glib headers, this breaks packages using core headers (networkmanager-qt)
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://cgit.freedesktop.org/ModemManager/ModemManager/patch/?id=0f377f943eeb81472fd73189f2c3d8fc65b8c609";
|
2018-03-23 11:22:49 +00:00
|
|
|
sha256 = "0av0sqdvbhwjnhqqylkc7rmqcj6awqmz5693l9x93nlwp7zya95j";
|
2018-03-23 09:04:24 +00:00
|
|
|
})
|
|
|
|
];
|
2012-01-04 09:05:22 +00:00
|
|
|
|
2014-02-08 19:16:34 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-polkit"
|
|
|
|
"--with-udev-base-dir=$(out)/lib/udev"
|
|
|
|
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
|
2015-03-26 20:12:50 +00:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2016-08-25 23:06:52 +01:00
|
|
|
"--with-suspend-resume=systemd"
|
2014-02-08 19:16:34 +00:00
|
|
|
];
|
2012-01-04 09:05:22 +00:00
|
|
|
|
2015-03-26 20:12:50 +00:00
|
|
|
installFlags = [ "DESTDIR=\${out}" ];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/etc/systemd/system
|
|
|
|
'';
|
|
|
|
|
2014-02-13 17:02:15 +00:00
|
|
|
postInstall = ''
|
2017-10-15 22:08:03 +01:00
|
|
|
# rename to modem-manager to be in style
|
|
|
|
mv $out/$out/etc/systemd/system/ModemManager.service $out/etc/systemd/system/modem-manager.service
|
2015-03-26 20:12:50 +00:00
|
|
|
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 17:02:15 +00:00
|
|
|
# systemd in NixOS doesn't use `systemctl enable`, so we need to establish
|
|
|
|
# aliases ourselves.
|
2017-10-15 22:08:03 +01:00
|
|
|
ln -s $out/etc/systemd/system/modem-manager.service \
|
2014-02-13 17:02:15 +00:00
|
|
|
$out/etc/systemd/system/dbus-org.freedesktop.ModemManager1.service
|
|
|
|
'';
|
|
|
|
|
2018-03-13 21:37:13 +00:00
|
|
|
meta = with stdenv.lib; {
|
2012-01-04 09:05:22 +00:00
|
|
|
description = "WWAN modem manager, part of NetworkManager";
|
2018-03-13 21:37:13 +00:00
|
|
|
homepage = https://www.freedesktop.org/wiki/Software/ModemManager/;
|
|
|
|
license = licenses.gpl2Plus;
|
2017-03-27 18:11:17 +01:00
|
|
|
maintainers = [ ];
|
2018-03-13 21:37:13 +00:00
|
|
|
platforms = platforms.linux;
|
2012-01-04 09:05:22 +00:00
|
|
|
};
|
|
|
|
}
|