networkmanager: fix path and pname

This commit is contained in:
Maxine Aubrey
2021-03-15 20:20:41 +01:00
parent b8a4051536
commit 17177b551f
26 changed files with 16 additions and 16 deletions
@@ -0,0 +1,49 @@
{ lib, stdenv, fetchurl, substituteAll, vpnc, intltool, pkg-config, networkmanager, libsecret
, gtk3, withGnome ? true, gnome3, glib, kmod, file, fetchpatch, libnma }:
let
pname = "NetworkManager-vpnc";
version = "1.2.6";
in stdenv.mkDerivation {
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "1js5lwcsqws4klgypfxl4ikmakv7v7xgddij1fj6b0y0qicx0kyy";
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
inherit vpnc kmod;
})
# Don't use etc/dbus-1/system.d
(fetchpatch {
url = "https://gitlab.gnome.org/GNOME/NetworkManager-vpnc/merge_requests/5.patch";
sha256 = "0z0x5vqmrsap3ynamhya7gh6c6k5grhj2vqpy76alnv9xns8dzi6";
})
];
buildInputs = [ vpnc networkmanager glib ]
++ lib.optionals withGnome [ gtk3 libsecret libnma ];
nativeBuildInputs = [ intltool pkg-config file ];
configureFlags = [
"--without-libnm-glib"
"--with-gnome=${if withGnome then "yes" else "no"}"
"--enable-absolute-paths"
];
passthru = {
updateScript = gnome3.updateScript {
packageName = pname;
attrPath = "networkmanager-vpnc";
};
};
meta = with lib; {
description = "NetworkManager's VPNC plugin";
inherit (networkmanager.meta) maintainers platforms;
license = licenses.gpl2Plus;
};
}
@@ -0,0 +1,31 @@
--- a/properties/nm-vpnc-editor-plugin.c
+++ b/properties/nm-vpnc-editor-plugin.c
@@ -161,7 +161,7 @@
GError *error = NULL;
const char *decrypt_possible_paths[] = {
- "/usr/lib/vpnc/cisco-decrypt",
+ "@vpnc@/bin/cisco-decrypt",
"/usr/bin/cisco-decrypt",
NULL
};
--- a/src/nm-vpnc-service.c
+++ b/src/nm-vpnc-service.c
@@ -610,7 +610,7 @@
find_vpnc (void)
{
static const char *vpnc_paths[] = {
- "/usr/sbin/vpnc",
+ "@vpnc@/bin/vpnc",
"/sbin/vpnc",
"/usr/local/sbin/vpnc",
NULL
@@ -1308,7 +1308,7 @@
_LOGD (" vpnc interactive mode is %s", interactive_available ? "enabled" : "disabled");
_LOGD (" uses%s --bus-name \"%s\"", bus_name_free ? "" : " default", bus_name);
- if (system ("/sbin/modprobe tun") == -1)
+ if (system ("@kmod@/bin/modprobe tun") == -1)
exit (EXIT_FAILURE);
plugin = nm_vpnc_plugin_new (bus_name);