From b38ae22a2d5f06f041b0618027625af839cd53cf Mon Sep 17 00:00:00 2001 From: Domen Kozar Date: Fri, 10 May 2013 22:28:31 +0200 Subject: [PATCH] make openvpn work with networkmanagerapplet --- .../network-manager-applet/default.nix | 4 ++- .../networking/network-manager/openvpn.nix | 29 ++++++++++++------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/pkgs/tools/networking/network-manager-applet/default.nix b/pkgs/tools/networking/network-manager-applet/default.nix index 8f6058d20783..1f874c70ddc8 100644 --- a/pkgs/tools/networking/network-manager-applet/default.nix +++ b/pkgs/tools/networking/network-manager-applet/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, intltool, pkgconfig, gtk, libglade, networkmanager, GConf , libnotify, libgnome_keyring, dbus_glib, polkit, isocodes , mobile_broadband_provider_info, glib_networking, gsettings_desktop_schemas -, makeWrapper }: +, makeWrapper, networkmanager_openvpn }: let pn = "network-manager-applet"; @@ -29,6 +29,8 @@ stdenv.mkDerivation rec { ]; postInstall = '' + ln -s ${networkmanager_openvpn}/etc/NetworkManager $out/etc/NetworkManager + ln -s ${networkmanager_openvpn}/lib/* $out/lib wrapProgram "$out/bin/nm-applet" \ --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules" \ --prefix XDG_DATA_DIRS : "${gsettings_desktop_schemas}/share:$out/share" \ diff --git a/pkgs/tools/networking/network-manager/openvpn.nix b/pkgs/tools/networking/network-manager/openvpn.nix index c0c2a603ff48..15da0236172b 100644 --- a/pkgs/tools/networking/network-manager/openvpn.nix +++ b/pkgs/tools/networking/network-manager/openvpn.nix @@ -1,14 +1,14 @@ { stdenv, fetchurl, openvpn, intltool, pkgconfig, networkmanager -, withGnome ? true, gtk2, libgnome_keyring }: +, withGnome ? true, gtk2, libgnome_keyring, procps, module_init_tools }: stdenv.mkDerivation rec { name = "${pname}${if withGnome then "-gnome" else ""}-${version}"; pname = "NetworkManager-openvpn"; - version = "0.9.4.0"; + version = "0.9.6.0"; src = fetchurl { url = "mirror://gnome/sources/${pname}/0.9/${pname}-${version}.tar.xz"; - sha256 = "1q436v2vlyxjj2b89jr3zny640xdjpslbrjb39ks1lrc1jqp0j6h"; + sha256 = "18w7mlgnm7y5kg3s2jfm8biymh33ggw97bz27m5mg69kg42qgf4g"; }; buildInputs = [ openvpn networkmanager ] @@ -18,17 +18,26 @@ stdenv.mkDerivation rec { configureFlags = [ "${if withGnome then "--with-gnome --with-gtkver=2" else "--without-gnome"}" + "--disable-static" ]; - preBuild = '' - sed -i 's/-Wstrict-prototypes//' auth-dialog/Makefile - sed -i 's/-Werror//' auth-dialog/Makefile - sed -i 's/-Wstrict-prototypes//' properties/Makefile - sed -i 's/-Werror//' properties/Makefile + preConfigure = '' + substituteInPlace "configure" \ + --replace "/sbin/sysctl" "${procps}/sbin/sysctl" + substituteInPlace "src/nm-openvpn-service.c" \ + --replace "/sbin/openvpn" "${openvpn}/sbin/openvpn" \ + --replace "/sbin/modprobe" "${module_init_tools}/sbin/modprobe" + substituteInPlace "properties/auth-helpers.c" \ + --replace "/sbin/openvpn" "${openvpn}/sbin/openvpn" ''; - postInstall = '' - # ln -s $out/NetworkManager/VPN /etc/NetworkManager/VPN + postConfigure = '' + substituteInPlace "./auth-dialog/Makefile" \ + --replace "-Wstrict-prototypes" "" \ + --replace "-Werror" "" + substituteInPlace "properties/Makefile" \ + --replace "-Wstrict-prototypes" "" \ + --replace "-Werror" "" ''; meta = {