@@ -2,25 +2,34 @@
22, systemd, libgudev, libnl, libuuid, polkit, gnutls, ppp, dhcp, iptables
33, libgcrypt, dnsmasq, bluez5, readline
44, gobjectIntrospection, modemmanager, openresolv, libndp, newt, libsoup
5−, ethtool, gnused, coreutils, file, inetutils, kmod }:
5+, ethtool, iputils, gnused, coreutils, file, inetutils, kmod, jansson, libxslt
6+, python3Packages, docbook_xsl, fetchpatch }:
67
78stdenv.mkDerivation rec {
89 name = "network-manager-${version}";
910 pname = "NetworkManager";
10− major = "1.4";
11− version = "${major}.4";
11+ major = "1.6";
12+ version = "${major}.2";
1213
1314 src = fetchurl {
1415 url = "mirror://gnome/sources/${pname}/${major}/${pname}-${version}.tar.xz";
15− sha256 = "029k2f1arx1m5hppmr778i9yg34jj68nmji3i89qs06c33rpi4w2";
16+ sha256 = "1y96k82rav8if334jl500zc024d210c4pgprh94yqyz3rmanyaxj";
1617 };
1718
1819 outputs = [ "out" "dev" ];
1920
21+ postPatch = ''
22+ patchShebangs ./tools
23+ '';
24+
2025 preConfigure = ''
2126 substituteInPlace configure --replace /usr/bin/uname ${coreutils}/bin/uname
2227 substituteInPlace configure --replace /usr/bin/file ${file}/bin/file
23− substituteInPlace src/devices/nm-device.c --replace /usr/bin/ping ${inetutils}/bin/ping
28+ substituteInPlace src/devices/nm-device.c \
29+ --replace /usr/bin/ping ${inetutils}/bin/ping \
30+ --replace /usr/bin/ping6 ${inetutils}/bin/ping
31+ substituteInPlace src/devices/nm-arping-manager.c \
32+ --replace '("arping", NULL, NULL);' '("arping", "${inetutils}/bin/arping", NULL);'
2433 substituteInPlace src/NetworkManagerUtils.c --replace /sbin/modprobe ${kmod}/bin/modprobe
2534 substituteInPlace data/84-nm-drivers.rules \
2635 --replace /bin/sh ${stdenv.shell}
@@ -58,14 +67,21 @@ stdenv.mkDerivation rec {
5867 "--with-libsoup=yes"
5968 ];
6069
61− patches = [ ./PppdPath.patch ];
70+ patches = [
71+ ./PppdPath.patch
72+ (fetchpatch {
73+ sha256 = "1n90j5rwg97xkrhlldyr92filc2dmycl9pr0svky9hlcn9csk2z6";
74+ name = "null-dereference.patch";
75+ url = "https://github.com/NetworkManager/NetworkManager/commit/4e8eddd100bbc8429806a70620c90b72cfd29cb1.patch";
76+ })
77+ ];
6278
6379 buildInputs = [ systemd libgudev libnl libuuid polkit ppp libndp
64− bluez5 dnsmasq gobjectIntrospection modemmanager readline newt libsoup ];
80+ bluez5 dnsmasq gobjectIntrospection modemmanager readline newt libsoup jansson ];
6581
66− propagatedBuildInputs = [ dbus_glib gnutls libgcrypt ];
82+ propagatedBuildInputs = [ dbus_glib gnutls libgcrypt python3Packages.pygobject3 ];
6783
68− nativeBuildInputs = [ intltool pkgconfig ];
84+ nativeBuildInputs = [ intltool pkgconfig libxslt docbook_xsl ];
6985
7086 preInstall = ''
7187 installFlagsArray=( "sysconfdir=$out/etc" "localstatedir=$out/var" "runstatedir=$out/var/run" )
@@ -78,7 +94,7 @@ stdenv.mkDerivation rec {
7894 substituteInPlace $out/etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf --replace 'at_console="true"' 'group="networkmanager"'
7995
8096 # rename to network-manager to be in style
81− mv $out/etc/systemd/system/NetworkManager.service $out/etc/systemd/system/network-manager.service
97+ mv $out/etc/systemd/system/NetworkManager.service $out/etc/systemd/system/network-manager.service
8298
8399 # systemd in NixOS doesn't use `systemctl enable`, so we need to establish
84100 # aliases ourselves.