networkmanager-openconnect: clean up
This commit is contained in:
parent
93d728b2ed
commit
87cf73bd1a
|
@ -1,5 +1,5 @@
|
||||||
{ stdenv, fetchurl, openconnect, intltool, pkgconfig, networkmanager, libsecret
|
{ stdenv, fetchurl, substituteAll, openconnect, intltool, pkgconfig, networkmanager, libsecret
|
||||||
, withGnome ? true, gnome3, sysctl, kmod }:
|
, withGnome ? true, gnome3, kmod }:
|
||||||
|
|
||||||
let
|
let
|
||||||
pname = "NetworkManager-openconnect";
|
pname = "NetworkManager-openconnect";
|
||||||
|
@ -12,24 +12,22 @@ in stdenv.mkDerivation rec {
|
||||||
sha256 = "15j98wwspv6mcmy91w30as5qc1bzsnhlk060xhjy4qrvd37y0xx1";
|
sha256 = "15j98wwspv6mcmy91w30as5qc1bzsnhlk060xhjy4qrvd37y0xx1";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ openconnect networkmanager libsecret ]
|
patches = [
|
||||||
++ stdenv.lib.optionals withGnome [ gnome3.gtk gnome3.libgnome-keyring ];
|
(substituteAll {
|
||||||
|
src = ./fix-paths.patch;
|
||||||
|
inherit kmod openconnect;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [ openconnect networkmanager ]
|
||||||
|
++ stdenv.lib.optionals withGnome [ gnome3.gtk libsecret ];
|
||||||
|
|
||||||
nativeBuildInputs = [ intltool pkgconfig ];
|
nativeBuildInputs = [ intltool pkgconfig ];
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"${if withGnome then "--with-gnome --with-gtkver=3" else "--without-gnome"}"
|
"--with-gnome=${if withGnome then "yes" else "no"}"
|
||||||
"--disable-static"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure = ''
|
|
||||||
substituteInPlace "configure" \
|
|
||||||
--replace "/sbin/sysctl" "${sysctl}/bin/sysctl"
|
|
||||||
substituteInPlace "src/nm-openconnect-service.c" \
|
|
||||||
--replace "/usr/sbin/openconnect" "${openconnect}/bin/openconnect" \
|
|
||||||
--replace "/sbin/modprobe" "${kmod}/bin/modprobe"
|
|
||||||
'';
|
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
updateScript = gnome3.updateScript {
|
updateScript = gnome3.updateScript {
|
||||||
packageName = pname;
|
packageName = pname;
|
||||||
|
@ -37,8 +35,9 @@ in stdenv.mkDerivation rec {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = with stdenv.lib; {
|
||||||
description = "NetworkManager's OpenConnect plugin";
|
description = "NetworkManager's OpenConnect plugin";
|
||||||
inherit (networkmanager.meta) maintainers platforms;
|
inherit (networkmanager.meta) maintainers platforms;
|
||||||
|
license = licenses.gpl2Plus;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
--- a/src/nm-openconnect-service.c
|
||||||
|
+++ b/src/nm-openconnect-service.c
|
||||||
|
@@ -60,7 +60,7 @@
|
||||||
|
|
||||||
|
static const char *openconnect_binary_paths[] =
|
||||||
|
{
|
||||||
|
- "/usr/bin/openconnect",
|
||||||
|
+ "@openconnect@/bin/openconnect",
|
||||||
|
"/usr/sbin/openconnect",
|
||||||
|
"/usr/local/bin/openconnect",
|
||||||
|
"/usr/local/sbin/openconnect",
|
||||||
|
@@ -734,7 +734,7 @@
|
||||||
|
|
||||||
|
_LOGD ("nm-openconnect-service (version " DIST_VERSION ") starting...");
|
||||||
|
|
||||||
|
- if (system ("/sbin/modprobe tun") == -1)
|
||||||
|
+ if (system ("@kmod@/bin/modprobe tun") == -1)
|
||||||
|
exit (EXIT_FAILURE);
|
||||||
|
|
||||||
|
if (bus_name)
|
Loading…
Reference in a new issue