networkmanager-openvpn: 1.8.0 → 1.8.2

This commit is contained in:
Jan Tojnar 2018-03-15 04:05:11 +01:00
parent 73244d10bb
commit e34d2ac4c7
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4
2 changed files with 45 additions and 14 deletions

View file

@ -0,0 +1,34 @@
--- a/properties/nm-openvpn-editor.c
+++ b/properties/nm-openvpn-editor.c
@@ -775,8 +775,7 @@
nm_find_openvpn (void)
{
static const char *openvpn_binary_paths[] = {
- "/usr/sbin/openvpn",
- "/sbin/openvpn",
+ "@openvpn@/bin/openvpn",
NULL
};
const char **openvpn_binary = openvpn_binary_paths;
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -522,9 +522,7 @@
openvpn_binary_find_exepath (void)
{
static const char *paths[] = {
- "/usr/sbin/openvpn",
- "/sbin/openvpn",
- "/usr/local/sbin/openvpn",
+ "@openvpn@/bin/openvpn",
};
int i;
@@ -2326,7 +2324,7 @@
_LOGD ("nm-openvpn-service (version " DIST_VERSION ") starting...");
if ( !g_file_test ("/sys/class/misc/tun", G_FILE_TEST_EXISTS)
- && (system ("/sbin/modprobe tun") == -1))
+ && (system ("@kmod@/bin/modprobe tun") == -1))
return EXIT_FAILURE;
plugin = nm_openvpn_plugin_new (bus_name);

View file

@ -1,22 +1,29 @@
{ stdenv, fetchurl, openvpn, intltool, pkgconfig, networkmanager, libsecret
{ stdenv, fetchurl, substituteAll, openvpn, intltool, libxml2, pkgconfig, networkmanager, libsecret
, withGnome ? true, gnome3, procps, kmod }:
let
pname = "NetworkManager-openvpn";
version = "1.8.0";
version = "1.8.2";
in stdenv.mkDerivation rec {
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "1973n89g66a3jfx8r45a811fga4kadh6r1w35cb25cz1mlii2vhn";
sha256 = "0p9pjk81h1j1dk9jkkvvk17cq21wyq5kfa4j49fmx9b9yg8syqc8";
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
inherit kmod openvpn;
})
];
buildInputs = [ openvpn networkmanager libsecret ]
++ stdenv.lib.optionals withGnome [ gnome3.gtk gnome3.libgnome-keyring
gnome3.networkmanagerapplet ];
nativeBuildInputs = [ intltool pkgconfig ];
nativeBuildInputs = [ intltool pkgconfig libxml2 ];
configureFlags = [
"${if withGnome then "--with-gnome --with-gtkver=3" else "--without-gnome"}"
@ -24,16 +31,6 @@ in stdenv.mkDerivation rec {
"--localstatedir=/" # needed for the management socket under /run/NetworkManager
];
preConfigure = ''
substituteInPlace "configure" \
--replace "/sbin/sysctl" "${procps}/sbin/sysctl"
substituteInPlace "src/nm-openvpn-service.c" \
--replace "/sbin/openvpn" "${openvpn}/bin/openvpn" \
--replace "/sbin/modprobe" "${kmod}/bin/modprobe"
substituteInPlace "properties/auth-helpers.c" \
--replace "/sbin/openvpn" "${openvpn}/bin/openvpn"
'';
passthru = {
updateScript = gnome3.updateScript {
packageName = pname;