networkmanager: fix path and pname
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
{ lib, stdenv
|
||||
, fetchurl
|
||||
, substituteAll
|
||||
, glib
|
||||
, libxml2
|
||||
, openconnect
|
||||
, intltool
|
||||
, pkg-config
|
||||
, autoreconfHook
|
||||
, networkmanager
|
||||
, gcr
|
||||
, libsecret
|
||||
, file
|
||||
, gtk3
|
||||
, withGnome ? true
|
||||
, gnome3
|
||||
, kmod
|
||||
, fetchpatch
|
||||
}:
|
||||
|
||||
let
|
||||
pname = "NetworkManager-openconnect";
|
||||
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 = "0nlp290nkawc4wqm978n4vhzg3xdqi8kpjjx19l855vab41rh44m";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./fix-paths.patch;
|
||||
inherit kmod openconnect;
|
||||
})
|
||||
|
||||
# Don't use etc/dbus-1/system.d
|
||||
(fetchpatch {
|
||||
url = "https://gitlab.gnome.org/GNOME/NetworkManager-openconnect/merge_requests/9.patch";
|
||||
sha256 = "0yd2dmq6gq6y4czr7dqdgaiqvw2vyv2gikznpfdxyfn2v1pcrk9m";
|
||||
})
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
glib
|
||||
libxml2
|
||||
openconnect
|
||||
networkmanager
|
||||
] ++ lib.optionals withGnome [
|
||||
gtk3
|
||||
gcr
|
||||
libsecret
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
intltool
|
||||
pkg-config
|
||||
file
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
"--with-gnome=${if withGnome then "yes" else "no"}"
|
||||
"--enable-absolute-paths"
|
||||
"--without-libnm-glib"
|
||||
];
|
||||
|
||||
passthru = {
|
||||
updateScript = gnome3.updateScript {
|
||||
packageName = pname;
|
||||
attrPath = "networkmanager-openconnect";
|
||||
};
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "NetworkManager’s OpenConnect plugin";
|
||||
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)
|
||||
Reference in New Issue
Block a user