networkmanager-openconnect: clean up

This commit is contained in:
Jan Tojnar 2018-08-09 17:09:11 +02:00
parent 93d728b2ed
commit 87cf73bd1a
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4
2 changed files with 34 additions and 15 deletions

View file

@ -1,5 +1,5 @@
{ stdenv, fetchurl, openconnect, intltool, pkgconfig, networkmanager, libsecret
, withGnome ? true, gnome3, sysctl, kmod }:
{ stdenv, fetchurl, substituteAll, openconnect, intltool, pkgconfig, networkmanager, libsecret
, withGnome ? true, gnome3, kmod }:
let
pname = "NetworkManager-openconnect";
@ -12,24 +12,22 @@ in stdenv.mkDerivation rec {
sha256 = "15j98wwspv6mcmy91w30as5qc1bzsnhlk060xhjy4qrvd37y0xx1";
};
buildInputs = [ openconnect networkmanager libsecret ]
++ stdenv.lib.optionals withGnome [ gnome3.gtk gnome3.libgnome-keyring ];
patches = [
(substituteAll {
src = ./fix-paths.patch;
inherit kmod openconnect;
})
];
buildInputs = [ openconnect networkmanager ]
++ stdenv.lib.optionals withGnome [ gnome3.gtk libsecret ];
nativeBuildInputs = [ intltool pkgconfig ];
configureFlags = [
"${if withGnome then "--with-gnome --with-gtkver=3" else "--without-gnome"}"
"--disable-static"
"--with-gnome=${if withGnome then "yes" else "no"}"
];
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 = {
updateScript = gnome3.updateScript {
packageName = pname;
@ -37,8 +35,9 @@ in stdenv.mkDerivation rec {
};
};
meta = {
meta = with stdenv.lib; {
description = "NetworkManager's OpenConnect plugin";
inherit (networkmanager.meta) maintainers platforms;
license = licenses.gpl2Plus;
};
}

View file

@ -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)