about summary refs log tree commit diff
path: root/pkgs/tools/networking/strongswan
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/networking/strongswan')
-rw-r--r--pkgs/tools/networking/strongswan/default.nix5
-rw-r--r--pkgs/tools/networking/strongswan/respect-path.patch19
2 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/tools/networking/strongswan/default.nix b/pkgs/tools/networking/strongswan/default.nix
index 0187f2ba5167..960da95120ef 100644
--- a/pkgs/tools/networking/strongswan/default.nix
+++ b/pkgs/tools/networking/strongswan/default.nix
@@ -8,6 +8,11 @@ stdenv.mkDerivation rec {
     sha256 = "1ki6v9c54ykppqnj3prgh62na97yajnvnm2zr1gjxzv05syk035h";
   };
 
+  patches = [ ./respect-path.patch ];
+
+  # --sysconfdir=/etc makes the build try to write to /etc...
+  NIX_CFLAGS_COMPILE = "-DIPSEC_CONFDIR=\"/etc\"";
+
   buildInputs = [ gmp ];
 
   meta = {
diff --git a/pkgs/tools/networking/strongswan/respect-path.patch b/pkgs/tools/networking/strongswan/respect-path.patch
new file mode 100644
index 000000000000..82f6a356b85a
--- /dev/null
+++ b/pkgs/tools/networking/strongswan/respect-path.patch
@@ -0,0 +1,19 @@
+commit 09c4ae5b7bcd7057bede788f02c1d2d30aeeacda
+Author: Shea Levy <shea@shealevy.com>
+Date:   Thu Sep 18 02:00:03 2014 -0400
+
+    ipsec script: just append to PATH if already set
+
+diff --git a/src/ipsec/_ipsec.in b/src/ipsec/_ipsec.in
+index e6725d0..82041f4 100644
+--- a/src/ipsec/_ipsec.in
++++ b/src/ipsec/_ipsec.in
+@@ -15,7 +15,7 @@
+ # for more details.
+ 
+ # define a minimum PATH environment in case it is not set
+-PATH="/sbin:/bin:/usr/sbin:/usr/bin:@IPSEC_SBINDIR@:@IPSEC_BINDIR@"
++PATH="${PATH:-/sbin:/bin:/usr/sbin:/usr/bin}:@IPSEC_SBINDIR@:@IPSEC_BINDIR@"
+ export PATH
+ 
+ # set daemon name