diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-11-03 20:56:15 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2022-02-19 22:32:51 +0000 |
commit | 8388c525c3c09715e09357b5547c128f931a7cf3 (patch) | |
tree | 53e07eb302e26891ef3cac213134333184801ce2 /pkgs/tools | |
parent | 451c27fb70610188d44e9f24b2fd89b390eb4e96 (diff) |
vpnc: don't produce non-free binaries by default
As explained in vpnc's Makefile, a vpnc with OpenSSL support is non-redistributable. The option to enable OpenSSL support, which is disabled by default, is even called OPENSSL_GPL_VIOLATION — something that was conveniently hidden by the strange way the option was set in the previous version of this package.
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/networking/vpnc/default.nix | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/pkgs/tools/networking/vpnc/default.nix b/pkgs/tools/networking/vpnc/default.nix index f67d29f09d490..31a4262d8a645 100644 --- a/pkgs/tools/networking/vpnc/default.nix +++ b/pkgs/tools/networking/vpnc/default.nix @@ -1,4 +1,8 @@ -{ lib, stdenv, fetchsvn, nettools, libgcrypt, openssl, openresolv, perl, gawk, makeWrapper }: +{ lib, stdenv, fetchsvn +, makeWrapper, pkg-config +, gawk, gnutls, libgcrypt, nettools, openresolv, perl +, opensslSupport ? false, openssl # Distributing this is a GPL violation. +}: stdenv.mkDerivation { pname = "vpnc"; @@ -20,22 +24,22 @@ stdenv.mkDerivation { # `ifconfig' as found in net-tools (not GNU Inetutils). propagatedBuildInputs = [ nettools ]; - nativeBuildInputs = [ makeWrapper ]; - buildInputs = [libgcrypt perl openssl ]; + nativeBuildInputs = [ makeWrapper ] + ++ lib.optional (!opensslSupport) pkg-config; + buildInputs = [ libgcrypt perl ] + ++ (if opensslSupport then [ openssl ] else [ gnutls ]); makeFlags = [ "PREFIX=$(out)" "ETCDIR=$(out)/etc/vpnc" "SCRIPT_PATH=$(out)/etc/vpnc/vpnc-script" - ]; + ] ++ lib.optional opensslSupport "OPENSSL_GPL_VIOLATION=yes"; postPatch = '' patchShebangs makeman.pl ''; preConfigure = '' - sed -i 's|^#OPENSSL|OPENSSL|g' Makefile - substituteInPlace "vpnc-script" \ --replace "which" "type -P" \ --replace "awk" "${gawk}/bin/awk" \ @@ -56,11 +60,10 @@ stdenv.mkDerivation { cp README nortel.txt ChangeLog $out/share/doc/vpnc/ ''; - meta = { + meta = with lib; { homepage = "https://www.unix-ag.uni-kl.de/~massar/vpnc/"; description = "Virtual private network (VPN) client for Cisco's VPN concentrators"; - license = lib.licenses.gpl2Plus; - - platforms = lib.platforms.linux; + license = if opensslSupport then licenses.unfree else licenses.gpl2Plus; + platforms = platforms.linux; }; } |