networkmanager-vpnc: clean up

+48 -20
+17 -20
pkgs/tools/networking/network-manager/vpnc/default.nix
··· 1 - { stdenv, fetchurl, vpnc, intltool, pkgconfig, networkmanager, libsecret 2 - , withGnome ? true, gnome3, procps, kmod, file }: 3 let 4 - pname = "NetworkManager-vpnc"; 5 version = "1.2.6"; 6 in stdenv.mkDerivation rec { 7 - name = "${pname}${if withGnome then "-gnome" else ""}-${version}"; 8 9 src = fetchurl { 10 - url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 11 sha256 = "1js5lwcsqws4klgypfxl4ikmakv7v7xgddij1fj6b0y0qicx0kyy"; 12 }; 13 14 - buildInputs = [ vpnc networkmanager libsecret ] 15 - ++ stdenv.lib.optionals withGnome [ gnome3.gtk gnome3.libgnome-keyring 16 - gnome3.networkmanagerapplet ]; 17 18 nativeBuildInputs = [ intltool pkgconfig file ]; 19 20 configureFlags = [ 21 - "${if withGnome then "--with-gnome --with-gtkver=3" else "--without-gnome"}" 22 - "--disable-static" 23 ]; 24 25 - preConfigure = '' 26 - substituteInPlace "configure" \ 27 - --replace "/sbin/sysctl" "${procps}/bin/sysctl" 28 - substituteInPlace "src/nm-vpnc-service.c" \ 29 - --replace "/sbin/vpnc" "${vpnc}/bin/vpnc" \ 30 - --replace "/sbin/modprobe" "${kmod}/bin/modprobe" 31 - ''; 32 - 33 passthru = { 34 updateScript = gnome3.updateScript { 35 packageName = pname; ··· 37 }; 38 }; 39 40 - meta = { 41 description = "NetworkManager's VPNC plugin"; 42 inherit (networkmanager.meta) maintainers platforms; 43 }; 44 } 45 -
··· 1 + { stdenv, fetchurl, substituteAll, vpnc, intltool, pkgconfig, networkmanager, libsecret 2 + , withGnome ? true, gnome3, kmod, file }: 3 let 4 + pname = "NetworkManager-vpnc"; 5 version = "1.2.6"; 6 in stdenv.mkDerivation rec { 7 + name = "${pname}${if withGnome then "-gnome" else ""}-${version}"; 8 9 src = fetchurl { 10 + url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 11 sha256 = "1js5lwcsqws4klgypfxl4ikmakv7v7xgddij1fj6b0y0qicx0kyy"; 12 }; 13 14 + patches = [ 15 + (substituteAll { 16 + src = ./fix-paths.patch; 17 + inherit vpnc kmod; 18 + }) 19 + ]; 20 + 21 + buildInputs = [ vpnc networkmanager ] 22 + ++ stdenv.lib.optionals withGnome [ gnome3.gtk libsecret gnome3.networkmanagerapplet ]; 23 24 nativeBuildInputs = [ intltool pkgconfig file ]; 25 26 configureFlags = [ 27 + "--with-gnome=${if withGnome then "yes" else "no"}" 28 ]; 29 30 passthru = { 31 updateScript = gnome3.updateScript { 32 packageName = pname; ··· 34 }; 35 }; 36 37 + meta = with stdenv.lib; { 38 description = "NetworkManager's VPNC plugin"; 39 inherit (networkmanager.meta) maintainers platforms; 40 + license = licenses.gpl2Plus; 41 }; 42 }
+31
pkgs/tools/networking/network-manager/vpnc/fix-paths.patch
···
··· 1 + --- a/properties/nm-vpnc-editor-plugin.c 2 + +++ b/properties/nm-vpnc-editor-plugin.c 3 + @@ -161,7 +161,7 @@ 4 + GError *error = NULL; 5 + 6 + const char *decrypt_possible_paths[] = { 7 + - "/usr/lib/vpnc/cisco-decrypt", 8 + + "@vpnc@/bin/cisco-decrypt", 9 + "/usr/bin/cisco-decrypt", 10 + NULL 11 + }; 12 + --- a/src/nm-vpnc-service.c 13 + +++ b/src/nm-vpnc-service.c 14 + @@ -610,7 +610,7 @@ 15 + find_vpnc (void) 16 + { 17 + static const char *vpnc_paths[] = { 18 + - "/usr/sbin/vpnc", 19 + + "@vpnc@/bin/vpnc", 20 + "/sbin/vpnc", 21 + "/usr/local/sbin/vpnc", 22 + NULL 23 + @@ -1308,7 +1308,7 @@ 24 + _LOGD (" vpnc interactive mode is %s", interactive_available ? "enabled" : "disabled"); 25 + _LOGD (" uses%s --bus-name \"%s\"", bus_name_free ? "" : " default", bus_name); 26 + 27 + - if (system ("/sbin/modprobe tun") == -1) 28 + + if (system ("@kmod@/bin/modprobe tun") == -1) 29 + exit (EXIT_FAILURE); 30 + 31 + plugin = nm_vpnc_plugin_new (bus_name);