nixpkgs/pkgs/tools/networking/openconnect.nix

34 lines
844 B
Nix
Raw Normal View History

{ stdenv, fetchurl, pkgconfig, vpnc, openssl ? null, gnutls ? null, libxml2, zlib } :
let
xor = a: b: (a || b) && (!(a && b));
in
assert xor (openssl != null) (gnutls != null);
2013-05-31 19:19:56 +01:00
stdenv.mkDerivation rec {
name = "openconnect-7.06";
2013-05-31 19:19:56 +01:00
src = fetchurl {
urls = [
"ftp://ftp.infradead.org/pub/openconnect/${name}.tar.gz"
];
sha256 = "1wkhmgfxkdkhy2p9w9idrgipxmxij2z4f88flfk3fifwd19nkkzs";
2013-05-31 19:19:56 +01:00
};
preConfigure = ''
export PKG_CONFIG=${pkgconfig}/bin/pkg-config
export LIBXML2_CFLAGS="-I ${libxml2}/include/libxml2"
export LIBXML2_LIBS="-L${libxml2}/lib -lxml2"
'';
configureFlags = [
"--with-vpnc-script=${vpnc}/etc/vpnc/vpnc-script"
"--disable-nls"
"--without-openssl-version-check"
2013-05-31 19:19:56 +01:00
];
buildInputs = [ pkgconfig ];
propagatedBuildInputs = [ vpnc openssl gnutls libxml2 zlib ];
2013-05-31 19:19:56 +01:00
}