3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/networking/network-manager/openconnect.nix
2018-07-10 12:14:40 +02:00

45 lines
1.4 KiB
Nix

{ stdenv, fetchurl, openconnect, intltool, pkgconfig, networkmanager, libsecret
, withGnome ? true, gnome3, sysctl, kmod }:
let
pname = "NetworkManager-openconnect";
version = "1.2.4";
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 = "15j98wwspv6mcmy91w30as5qc1bzsnhlk060xhjy4qrvd37y0xx1";
};
buildInputs = [ openconnect networkmanager libsecret ]
++ stdenv.lib.optionals withGnome [ gnome3.gtk gnome3.libgnome-keyring ];
nativeBuildInputs = [ intltool pkgconfig ];
configureFlags = [
"${if withGnome then "--with-gnome --with-gtkver=3" else "--without-gnome"}"
"--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 = {
updateScript = gnome3.updateScript {
packageName = pname;
attrPath = "networkmanager-openconnect";
};
};
meta = {
description = "NetworkManager's OpenConnect plugin";
inherit (networkmanager.meta) maintainers platforms;
};
}