@@ -1,5 +1,5 @@
1−{ stdenv, fetchurl, openconnect, intltool, pkgconfig, networkmanager, libsecret
2−, withGnome ? true, gnome3, sysctl, kmod }:
1+{ stdenv, fetchurl, substituteAll, openconnect, intltool, pkgconfig, networkmanager, libsecret
2+, withGnome ? true, gnome3, kmod }:
33
44let
55 pname = "NetworkManager-openconnect";
@@ -12,24 +12,22 @@ in stdenv.mkDerivation rec {
1212 sha256 = "15j98wwspv6mcmy91w30as5qc1bzsnhlk060xhjy4qrvd37y0xx1";
1313 };
1414
15− buildInputs = [ openconnect networkmanager libsecret ]
16− ++ stdenv.lib.optionals withGnome [ gnome3.gtk gnome3.libgnome-keyring ];
15+ patches = [
16+ (substituteAll {
17+ src = ./fix-paths.patch;
18+ inherit kmod openconnect;
19+ })
20+ ];
21+
22+ buildInputs = [ openconnect networkmanager ]
23+ ++ stdenv.lib.optionals withGnome [ gnome3.gtk libsecret ];
1724
1825 nativeBuildInputs = [ intltool pkgconfig ];
1926
2027 configureFlags = [
21− "${if withGnome then "--with-gnome --with-gtkver=3" else "--without-gnome"}"
22− "--disable-static"
28+ "--with-gnome=${if withGnome then "yes" else "no"}"
2329 ];
2430
25− preConfigure = ''
26− substituteInPlace "configure" \
27− --replace "/sbin/sysctl" "${sysctl}/bin/sysctl"
28− substituteInPlace "src/nm-openconnect-service.c" \
29− --replace "/usr/sbin/openconnect" "${openconnect}/bin/openconnect" \
30− --replace "/sbin/modprobe" "${kmod}/bin/modprobe"
31− '';
32−
3331 passthru = {
3432 updateScript = gnome3.updateScript {
3533 packageName = pname;
@@ -37,8 +35,9 @@ in stdenv.mkDerivation rec {
3735 };
3836 };
3937
40− meta = {
38+ meta = with stdenv.lib; {
4139 description = "NetworkManager's OpenConnect plugin";
4240 inherit (networkmanager.meta) maintainers platforms;
41+ license = licenses.gpl2Plus;
4342 };
4443}