Merge pull request #16412 from obadz/networkmanager-1.2

NetworkManager & plugins: upgrade to 1.2
This commit is contained in:
obadz 2016-06-22 15:12:23 +01:00 committed by GitHub
commit f540e09a8b
14 changed files with 82 additions and 196 deletions

View file

@ -3,20 +3,14 @@
, mobile_broadband_provider_info, glib_networking, gsettings_desktop_schemas
, makeWrapper, udev, libgudev, hicolor_icon_theme }:
let
pn = "network-manager-applet";
major = "1.0";
# With version 1.0.12 of NM, we are no longer in sync
# version = "${networkmanager.version}.10";
version = "${major}.10";
in
stdenv.mkDerivation rec {
name = "network-manager-applet-${version}";
name = "${pname}-${version}";
pname = "network-manager-applet";
version = networkmanager.version;
src = fetchurl {
url = "mirror://gnome/sources/${pn}/${major}/${name}.tar.xz";
sha256 = "1szh5jyijxm6z55irkp5s44pwah0nikss40mx7pvpk38m8zaqidh";
url = "mirror://gnome/sources/${pname}/${networkmanager.major}/${name}.tar.xz";
sha256 = "02b42e7c17c9cd6c840563750da92ce58da1ec621df7f0c2402016026e727756";
};
configureFlags = [ "--sysconfdir=/etc" ];
@ -34,10 +28,9 @@ stdenv.mkDerivation rec {
''CFLAGS=-DMOBILE_BROADBAND_PROVIDER_INFO=\"${mobile_broadband_provider_info}/share/mobile-broadband-provider-info/serviceproviders.xml\"''
];
preInstall =
''
installFlagsArray=( "sysconfdir=$out/etc" )
'';
preInstall = ''
installFlagsArray=( "sysconfdir=$out/etc" )
'';
preFixup = ''
wrapProgram "$out/bin/nm-applet" \
@ -50,10 +43,10 @@ stdenv.mkDerivation rec {
'';
meta = with stdenv.lib; {
homepage = http://projects.gnome.org/NetworkManager/;
homepage = http://projects.gnome.org/NetworkManager/;
description = "NetworkManager control applet for GNOME";
license = licenses.gpl2;
license = licenses.gpl2;
maintainers = with maintainers; [ phreedom urkud rickynils ];
platforms = platforms.linux;
platforms = platforms.linux;
};
}

View file

@ -5,12 +5,14 @@
, ethtool, gnused, coreutils, file, inetutils }:
stdenv.mkDerivation rec {
name = "network-manager-${version}";
version = "1.0.12";
name = "network-manager-${version}";
pname = "NetworkManager";
major = "1.2";
version = "${major}.2";
src = fetchurl {
url = "mirror://gnome/sources/NetworkManager/1.0/NetworkManager-${version}.tar.xz";
sha256 = "17jan0g5jzp8mrpklyacwdgnnw016m1c5pc4az5im6qhc260yirs";
url = "mirror://gnome/sources/${pname}/${major}/${pname}-${version}.tar.xz";
sha256 = "41d8082e027f58bb5fa4181f93742606ab99c659794a18e2823eff22df0eecd9";
};
preConfigure = ''
@ -61,34 +63,30 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ intltool pkgconfig ];
patches = [ ./nm-platform.patch ];
preInstall = ''
installFlagsArray=( "sysconfdir=$out/etc" "localstatedir=$out/var" "runstatedir=$out/var/run" )
'';
preInstall =
''
installFlagsArray=( "sysconfdir=$out/etc" "localstatedir=$out/var" )
'';
postInstall = ''
mkdir -p $out/lib/NetworkManager
postInstall =
''
mkdir -p $out/lib/NetworkManager
# FIXME: Workaround until NixOS' dbus+systemd supports at_console policy
substituteInPlace $out/etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf --replace 'at_console="true"' 'group="networkmanager"'
# FIXME: Workaround until NixOS' dbus+systemd supports at_console policy
substituteInPlace $out/etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf --replace 'at_console="true"' 'group="networkmanager"'
# rename to network-manager to be in style
mv $out/etc/systemd/system/NetworkManager.service $out/etc/systemd/system/network-manager.service
# rename to network-manager to be in style
mv $out/etc/systemd/system/NetworkManager.service $out/etc/systemd/system/network-manager.service
# systemd in NixOS doesn't use `systemctl enable`, so we need to establish
# aliases ourselves.
ln -s $out/etc/systemd/system/NetworkManager-dispatcher.service $out/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
ln -s $out/etc/systemd/system/network-manager.service $out/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service
'';
# systemd in NixOS doesn't use `systemctl enable`, so we need to establish
# aliases ourselves.
ln -s $out/etc/systemd/system/NetworkManager-dispatcher.service $out/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
ln -s $out/etc/systemd/system/network-manager.service $out/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service
'';
meta = with stdenv.lib; {
homepage = http://projects.gnome.org/NetworkManager/;
homepage = http://projects.gnome.org/NetworkManager/;
description = "Network configuration and management tool";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ phreedom urkud rickynils domenkozar ];
platforms = platforms.linux;
license = licenses.gpl2Plus;
maintainers = with maintainers; [ phreedom urkud rickynils domenkozar obadz ];
platforms = platforms.linux;
};
}

View file

@ -1,26 +0,0 @@
diff --git a/src/nm-l2tp-service.c b/src/nm-l2tp-service.c
index d2c9dc4..e61d3d2 100644
--- a/src/nm-l2tp-service.c
+++ b/src/nm-l2tp-service.c
@@ -655,9 +655,7 @@ nm_find_ipsec (void)
{
static const char *ipsec_binary_paths[] =
{
- "/sbin/ipsec",
- "/usr/sbin/ipsec",
- "/usr/local/sbin/ipsec",
+ "@strongswan@/bin/ipsec",
NULL
};
@@ -677,9 +675,7 @@ nm_find_l2tpd (void)
{
static const char *l2tp_binary_paths[] =
{
- "/sbin/xl2tpd",
- "/usr/sbin/xl2tpd",
- "/usr/local/sbin/xl2tpd",
+ "@xl2tpd@/bin/xl2tpd",
NULL
};

View file

@ -1,48 +1,42 @@
{ stdenv, fetchFromGitHub, substituteAll, automake, autoconf, libtool, intltool, pkgconfig
, networkmanager, ppp, xl2tpd, strongswan
{ stdenv, fetchFromGitHub, automake, autoconf, libtool, intltool, pkgconfig
, networkmanager, networkmanagerapplet, ppp, xl2tpd, strongswan, libsecret
, withGnome ? true, gnome3 }:
stdenv.mkDerivation rec {
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
pname = "NetworkManager-l2tp";
version = "0.9.8.7";
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
pname = "NetworkManager-l2tp";
version = networkmanager.version;
src = fetchFromGitHub {
owner = "seriyps";
repo = "NetworkManager-l2tp";
rev = version;
sha256 = "07gl562p3f6l2wn64f3vvz1ygp3hsfhiwh4sn04c3fahfdys69zx";
owner = "nm-l2tp";
repo = "network-manager-l2tp";
rev = version;
sha256 = "1zqdhm7pzhaq6q8pddj9ki25qs9m6qwqgzc5x07a0qffla2rq5j1";
};
buildInputs = [ networkmanager ppp ]
buildInputs = [ networkmanager ppp networkmanagerapplet libsecret ]
++ stdenv.lib.optionals withGnome [ gnome3.gtk gnome3.libgnome_keyring ];
nativeBuildInputs = [ automake autoconf libtool intltool pkgconfig ];
configureScript = "./autogen.sh";
postPatch = ''
sed -i -e 's%"\(/usr/sbin\|/usr/pkg/sbin\|/usr/local/sbin\)/[^"]*",%%g' ./src/nm-l2tp-service.c
substituteInPlace ./src/nm-l2tp-service.c \
--replace /sbin/ipsec ${strongswan}/bin/ipsec \
--replace /sbin/xl2tpd ${xl2tpd}/bin/xl2tpd
'';
preConfigure = "./autogen.sh";
configureFlags =
if withGnome then "--with-gnome" else "--without-gnome";
postConfigure = "sed 's/-Werror//g' -i Makefile */Makefile";
patches =
[ ( substituteAll {
src = ./l2tp-purity.patch;
inherit xl2tpd strongswan;
})
];
# Workaround https://github.com/xelerance/xl2tpd/issues/108
postPatch = ''
substituteInPlace ./src/nm-l2tp-service.c --replace 'write_config_option (pppopt_fd, "lock\n");' ""
'';
meta = with stdenv.lib; {
description = "L2TP plugin for NetworkManager";
inherit (networkmanager.meta) platforms;
homepage = https://github.com/seriyps/NetworkManager-l2tp;
license = licenses.gpl2;
maintainers = with maintainers; [ abbradar ];
maintainers = with maintainers; [ abbradar obadz ];
};
}

View file

@ -1,17 +0,0 @@
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index 8803377..14e5726 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -39,6 +39,12 @@
#include "nm-enum-types.h"
#include "nm-core-internal.h"
+#if HAVE_LIBNL_INET6_ADDR_GEN_MODE && HAVE_KERNEL_INET6_ADDR_GEN_MODE
+#include <linux/if_link.h>
+#else
+#define IN6_ADDR_GEN_MODE_NONE 1
+#endif
+
#define ADDRESS_LIFETIME_PADDING 5
G_STATIC_ASSERT (sizeof ( ((NMPlatformLink *) NULL)->addr.data ) == NM_UTILS_HWADDR_LEN_MAX);

View file

@ -2,15 +2,13 @@
, withGnome ? true, gnome3, procps, kmod }:
stdenv.mkDerivation rec {
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
pname = "NetworkManager-openconnect";
version = "1.0.2";
# FixMe: Change version back to "networkmanager.version"
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
pname = "NetworkManager-openconnect";
version = networkmanager.version;
src = fetchurl {
url = "mirror://gnome/sources/${pname}/1.0/${pname}-${version}.tar.xz";
sha256 = "03k05s3aaxcwrip3g3r13bx80wbg7vh5sssc7mvg27c4cdc0a2hj";
url = "mirror://gnome/sources/${pname}/${networkmanager.major}/${pname}-${version}.tar.xz";
sha256 = "522979593e21b4e884112816708db9eb66148b3491580dacfad53472b94aafec";
};
buildInputs = [ openconnect networkmanager libsecret ]
@ -31,15 +29,6 @@ stdenv.mkDerivation rec {
--replace "/sbin/modprobe" "${kmod}/sbin/modprobe"
'';
postConfigure = ''
substituteInPlace "./auth-dialog/Makefile" \
--replace "-Wstrict-prototypes" "" \
--replace "-Werror" ""
substituteInPlace "properties/Makefile" \
--replace "-Wstrict-prototypes" "" \
--replace "-Werror" ""
'';
meta = {
description = "NetworkManager's OpenConnect plugin";
inherit (networkmanager.meta) maintainers platforms;

View file

@ -2,13 +2,13 @@
, withGnome ? true, gnome3, procps, kmod }:
stdenv.mkDerivation rec {
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
pname = "NetworkManager-openvpn";
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
pname = "NetworkManager-openvpn";
version = networkmanager.version;
src = fetchurl {
url = "mirror://gnome/sources/${pname}/1.0/${pname}-${version}.tar.xz";
sha256 = "132xwkgyfnpma7m6b06jhrd1g9xk5dlpx8alnsf03ls3z92bd0n9";
url = "mirror://gnome/sources/${pname}/${networkmanager.major}/${pname}-${version}.tar.xz";
sha256 = "47a6d219a781eff8491c7876b7fb95b12dcfb8f8a05f916f95afc65c7babddef";
};
buildInputs = [ openvpn networkmanager libsecret ]
@ -33,15 +33,6 @@ stdenv.mkDerivation rec {
--replace "/sbin/openvpn" "${openvpn}/sbin/openvpn"
'';
postConfigure = ''
substituteInPlace "./auth-dialog/Makefile" \
--replace "-Wstrict-prototypes" "" \
--replace "-Werror" ""
substituteInPlace "properties/Makefile" \
--replace "-Wstrict-prototypes" "" \
--replace "-Werror" ""
'';
meta = {
description = "NetworkManager's OpenVPN plugin";
inherit (networkmanager.meta) maintainers platforms;

View file

@ -1,26 +0,0 @@
diff --git a/src/nm-pptp-service.c b/src/nm-pptp-service.c
index 68a5759..568bbfe 100644
--- a/src/nm-pptp-service.c
+++ b/src/nm-pptp-service.c
@@ -730,9 +730,7 @@ nm_find_pppd (void)
{
static const char *pppd_binary_paths[] =
{
- "/sbin/pppd",
- "/usr/sbin/pppd",
- "/usr/local/sbin/pppd",
+ "@ppp@/sbin/pppd",
NULL
};
@@ -752,9 +750,7 @@ nm_find_pptp (void)
{
static const char *pptp_binary_paths[] =
{
- "/sbin/pptp",
- "/usr/sbin/pptp",
- "/usr/local/sbin/pptp",
+ "@pptp@/sbin/pptp",
NULL
};

View file

@ -1,14 +1,14 @@
{ stdenv, fetchurl, networkmanager, pptp, ppp, intltool, pkgconfig, substituteAll
{ stdenv, fetchurl, networkmanager, pptp, ppp, intltool, pkgconfig
, libsecret, withGnome ? true, gnome3 }:
stdenv.mkDerivation rec {
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
pname = "NetworkManager-pptp";
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
pname = "NetworkManager-pptp";
version = networkmanager.version;
src = fetchurl {
url = "mirror://gnome/sources/${pname}/1.0/${pname}-${version}.tar.xz";
sha256 = "1gn1f8r32wznk4rsn2lg2slw1ccli00svz0fi4bx0qiylimlbyln";
url = "mirror://gnome/sources/${pname}/${networkmanager.major}/${pname}-${version}.tar.xz";
sha256 = "a72cb88ecc0a9edec836e8042c592d68b8b290c0d78082e6b25cf08b46c6be5d";
};
buildInputs = [ networkmanager pptp ppp libsecret ]
@ -17,18 +17,17 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ intltool pkgconfig ];
postPatch = ''
sed -i -e 's%"\(/usr/sbin\|/usr/pkg/sbin\|/usr/local/sbin\)/[^"]*",%%g' ./src/nm-pptp-service.c
substituteInPlace ./src/nm-pptp-service.c \
--replace /sbin/pptp ${pptp}/bin/pptp \
--replace /sbin/pppd ${ppp}/bin/pppd
'';
configureFlags =
if withGnome then "--with-gnome --with-gtkver=3" else "--without-gnome";
postConfigure = "sed 's/-Werror//g' -i Makefile */Makefile";
patches =
[ ( substituteAll {
src = ./pptp-purity.patch;
inherit ppp pptp;
})
];
meta = {
description = "PPtP plugin for NetworkManager";
inherit (networkmanager.meta) maintainers platforms;

View file

@ -2,13 +2,13 @@
, withGnome ? true, gnome3, procps, kmod }:
stdenv.mkDerivation rec {
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
pname = "NetworkManager-vpnc";
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
pname = "NetworkManager-vpnc";
version = networkmanager.version;
src = fetchurl {
url = "mirror://gnome/sources/${pname}/1.0/${pname}-${version}.tar.xz";
sha256 = "0hycplnc78688sgpzdh3ifra6chascrh751mckqkp1j553bri0jk";
url = "mirror://gnome/sources/${pname}/${networkmanager.major}/${pname}-${version}.tar.xz";
sha256 = "e900f6500026f8c3ee4feb92e1d0a0c0abbee9ba507dad915b47a8ab7df9e1f3";
};
buildInputs = [ vpnc networkmanager libsecret ]
@ -30,15 +30,6 @@ stdenv.mkDerivation rec {
--replace "/sbin/modprobe" "${kmod}/sbin/modprobe"
'';
postConfigure = ''
substituteInPlace "./auth-dialog/Makefile" \
--replace "-Wstrict-prototypes" "" \
--replace "-Werror" ""
substituteInPlace "properties/Makefile" \
--replace "-Wstrict-prototypes" "" \
--replace "-Werror" ""
'';
meta = {
description = "NetworkManager's VPNC plugin";
inherit (networkmanager.meta) maintainers platforms;

View file

@ -2594,7 +2594,7 @@ in
netselect = callPackage ../tools/networking/netselect { };
# stripped down, needed by steam
networkmanager098 = callPackage ../tools/networking/network-manager/0.9.8.nix { };
networkmanager098 = callPackage ../tools/networking/network-manager/0.9.8 { };
networkmanager = callPackage ../tools/networking/network-manager { };