nixpkgs/pkgs/tools/networking/strongswan/default.nix

74 lines
2.9 KiB
Nix
Raw Normal View History

2015-08-03 15:59:33 +01:00
{ stdenv, fetchurl, gmp, pkgconfig, python, autoreconfHook
2015-08-05 11:12:09 +01:00
, curl, trousers, sqlite, iptables, libxml2, openresolv
, ldns, unbound, pcsclite, openssl, systemd
2015-08-03 15:59:33 +01:00
, enableTNC ? false }:
2014-09-16 19:10:37 +01:00
stdenv.mkDerivation rec {
2016-05-23 13:55:05 +01:00
name = "strongswan-${version}";
2016-12-24 15:49:51 +00:00
version = "5.5.1";
2014-09-16 19:10:37 +01:00
src = fetchurl {
url = "http://download.strongswan.org/${name}.tar.bz2";
2016-12-24 15:49:51 +00:00
sha256 = "1drahhmwz1jg14rfh67cl231dlg2a9pra6jmipfxwyzpj4ck02vj";
2014-09-16 19:10:37 +01:00
};
dontPatchELF = true;
2015-08-03 15:59:33 +01:00
buildInputs =
[ gmp pkgconfig python autoreconfHook iptables ldns unbound openssl pcsclite systemd.dev ]
2015-08-04 18:16:27 +01:00
++ stdenv.lib.optionals enableTNC [ curl trousers sqlite libxml2 ];
patches = [
2014-12-22 19:55:01 +00:00
./ext_auth-path.patch
./firewall_defaults.patch
2014-12-22 19:55:01 +00:00
./updown-path.patch
];
2014-09-19 06:09:00 +01:00
2015-08-05 11:12:09 +01:00
postPatch = ''
substituteInPlace src/libcharon/plugins/resolve/resolve_handler.c --replace "/sbin/resolvconf" "${openresolv}/sbin/resolvconf"
# swanctl can be configured by files in SWANCTLDIR which defaults to
# $out/etc/swanctl. Since that directory is in the nix store users can't
# modify it. Ideally swanctl accepts a command line option for specifying
# the configuration files. In the absence of that we patch swanctl to look
# for configuration files in /etc/swanctl.
substituteInPlace src/swanctl/swanctl.h --replace "SWANCTLDIR" "\"/etc/swanctl\""
2015-08-05 11:12:09 +01:00
'';
preConfigure = ''
configureFlagsArray+=("--with-systemdsystemunitdir=$out/etc/systemd/system")
'';
2015-08-03 15:59:33 +01:00
configureFlags =
[ "--enable-swanctl" "--enable-cmd" "--enable-systemd"
2015-08-04 18:16:27 +01:00
"--enable-farp" "--enable-dhcp"
"--enable-eap-sim" "--enable-eap-sim-file" "--enable-eap-simaka-pseudonym"
"--enable-eap-simaka-reauth" "--enable-eap-identity" "--enable-eap-md5"
"--enable-eap-gtc" "--enable-eap-aka" "--enable-eap-aka-3gpp2"
"--enable-eap-mschapv2" "--enable-xauth-eap" "--enable-ext-auth"
"--enable-forecast" "--enable-connmark" "--enable-acert"
2015-09-06 20:05:11 +01:00
"--enable-pkcs11" "--enable-eap-sim-pcsc" "--enable-dnscert" "--enable-unbound"
"--enable-af-alg" ]
++ stdenv.lib.optional stdenv.isx86_64 [ "--enable-aesni" "--enable-rdrand" ]
++ stdenv.lib.optional (stdenv.system == "i686-linux") "--enable-padlock"
2015-08-03 15:59:33 +01:00
++ stdenv.lib.optionals enableTNC [
"--disable-gmp" "--disable-aes" "--disable-md5" "--disable-sha1" "--disable-sha2" "--disable-fips-prf"
2015-08-04 18:16:27 +01:00
"--enable-curl" "--enable-openssl"
2015-08-03 15:59:33 +01:00
"--enable-eap-tnc" "--enable-eap-ttls" "--enable-eap-dynamic" "--enable-tnccs-20"
"--enable-tnc-imc" "--enable-imc-os" "--enable-imc-attestation"
"--enable-tnc-imv" "--enable-imv-attestation"
2015-08-04 18:16:27 +01:00
"--enable-tnc-ifmap" "--enable-tnc-imc" "--enable-tnc-imv"
2015-08-03 15:59:33 +01:00
"--with-tss=trousers"
"--enable-aikgen"
"--enable-sqlite" ];
2014-09-16 19:10:37 +01:00
NIX_LDFLAGS = "-lgcc_s" ;
2014-09-16 19:10:37 +01:00
meta = {
description = "OpenSource IPsec-based VPN Solution";
homepage = https://www.strongswan.org;
license = stdenv.lib.licenses.gpl2Plus;
2014-11-26 20:04:59 +00:00
platforms = stdenv.lib.platforms.all;
2014-09-16 19:10:37 +01:00
};
}