strongswan: enable charon-systemd (#21872)

See: https://wiki.strongswan.org/projects/strongswan/wiki/Charon-systemd
This commit is contained in:
Bas van Dijk 2017-01-14 20:41:51 +01:00 committed by Franz Pletz
parent 666810cd25
commit f0338024b9

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, gmp, pkgconfig, python, autoreconfHook { stdenv, fetchurl, gmp, pkgconfig, python, autoreconfHook
, curl, trousers, sqlite, iptables, libxml2, openresolv , curl, trousers, sqlite, iptables, libxml2, openresolv
, ldns, unbound, pcsclite, openssl , ldns, unbound, pcsclite, openssl, systemd
, enableTNC ? false }: , enableTNC ? false }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
dontPatchELF = true; dontPatchELF = true;
buildInputs = buildInputs =
[ gmp pkgconfig python autoreconfHook iptables ldns unbound openssl pcsclite ] [ gmp pkgconfig python autoreconfHook iptables ldns unbound openssl pcsclite systemd.dev ]
++ stdenv.lib.optionals enableTNC [ curl trousers sqlite libxml2 ]; ++ stdenv.lib.optionals enableTNC [ curl trousers sqlite libxml2 ];
patches = [ patches = [
@ -26,10 +26,21 @@ stdenv.mkDerivation rec {
postPatch = '' postPatch = ''
substituteInPlace src/libcharon/plugins/resolve/resolve_handler.c --replace "/sbin/resolvconf" "${openresolv}/sbin/resolvconf" 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\""
'';
preConfigure = ''
configureFlagsArray+=("--with-systemdsystemunitdir=$out/etc/systemd/system")
''; '';
configureFlags = configureFlags =
[ "--enable-swanctl" "--enable-cmd" [ "--enable-swanctl" "--enable-cmd" "--enable-systemd"
"--enable-farp" "--enable-dhcp" "--enable-farp" "--enable-dhcp"
"--enable-eap-sim" "--enable-eap-sim-file" "--enable-eap-simaka-pseudonym" "--enable-eap-sim" "--enable-eap-sim-file" "--enable-eap-simaka-pseudonym"
"--enable-eap-simaka-reauth" "--enable-eap-identity" "--enable-eap-md5" "--enable-eap-simaka-reauth" "--enable-eap-identity" "--enable-eap-md5"