From 85da7792b8bfa6be2f8d72d2cd51d1429b1f6ba8 Mon Sep 17 00:00:00 2001 From: John Chee Date: Thu, 11 Jun 2015 10:52:00 -0700 Subject: [PATCH] openconnect: update to version 7.06 and support openssl or gnutls --- pkgs/tools/networking/openconnect.nix | 15 +++++++++++---- pkgs/top-level/all-packages.nix | 11 ++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/networking/openconnect.nix b/pkgs/tools/networking/openconnect.nix index d53af5c9e40d..54239b766174 100644 --- a/pkgs/tools/networking/openconnect.nix +++ b/pkgs/tools/networking/openconnect.nix @@ -1,13 +1,19 @@ -{ stdenv, fetchurl, pkgconfig, vpnc, openssl, libxml2, zlib } : +{ 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); stdenv.mkDerivation rec { - name = "openconnect-5.02"; + name = "openconnect-7.06"; src = fetchurl { urls = [ "ftp://ftp.infradead.org/pub/openconnect/${name}.tar.gz" ]; - sha256 = "1y7dn42gd3763sgwv2j72xy9hsikd6y9x142g84kwdbn0y0psgi4"; + sha256 = "1wkhmgfxkdkhy2p9w9idrgipxmxij2z4f88flfk3fifwd19nkkzs"; }; preConfigure = '' @@ -22,5 +28,6 @@ stdenv.mkDerivation rec { "--without-openssl-version-check" ]; - propagatedBuildInputs = [ vpnc openssl libxml2 zlib ]; + buildInputs = [ pkgconfig ]; + propagatedBuildInputs = [ vpnc openssl gnutls libxml2 zlib ]; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 991928ae5db2..a9d9848904d6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3144,7 +3144,16 @@ let vpnc = callPackage ../tools/networking/vpnc { }; - openconnect = callPackage ../tools/networking/openconnect.nix { }; + openconnect = openconnect_openssl; + + openconnect_openssl = callPackage ../tools/networking/openconnect.nix { + gnutls = null; + }; + + openconnect_gnutls = lowPrio (openconnect.override { + openssl = null; + gnutls = gnutls; + }); vtun = callPackage ../tools/networking/vtun { };