about summary refs log tree commit diff
path: root/pkgs/servers/http
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2018-12-11 01:01:30 +0000
committerRobin Gloster <mail@glob.in>2018-12-11 18:13:21 +0100
commit8871ffccffe2e626c0bf326e8253aa1c692be6f5 (patch)
treea69118107395951527cdba153b81a99908f3a232 /pkgs/servers/http
parent693b47bc0b30d5a0c28174674882af04dd03f584 (diff)
downloadnixlib-8871ffccffe2e626c0bf326e8253aa1c692be6f5.tar
nixlib-8871ffccffe2e626c0bf326e8253aa1c692be6f5.tar.gz
nixlib-8871ffccffe2e626c0bf326e8253aa1c692be6f5.tar.bz2
nixlib-8871ffccffe2e626c0bf326e8253aa1c692be6f5.tar.lz
nixlib-8871ffccffe2e626c0bf326e8253aa1c692be6f5.tar.xz
nixlib-8871ffccffe2e626c0bf326e8253aa1c692be6f5.tar.zst
nixlib-8871ffccffe2e626c0bf326e8253aa1c692be6f5.zip
nginx: fix cross-build
Diffstat (limited to 'pkgs/servers/http')
-rw-r--r--pkgs/servers/http/nginx/generic.nix19
1 files changed, 18 insertions, 1 deletions
diff --git a/pkgs/servers/http/nginx/generic.nix b/pkgs/servers/http/nginx/generic.nix
index 25ff20635aff..9ea49267cf8c 100644
--- a/pkgs/servers/http/nginx/generic.nix
+++ b/pkgs/servers/http/nginx/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, openssl, zlib, pcre, libxml2, libxslt
+{ stdenv, fetchurl, fetchpatch, openssl, zlib, pcre, libxml2, libxslt
 , gd, geoip
 , withDebug ? false
 , withStream ? true
@@ -60,8 +60,25 @@ stdenv.mkDerivation {
 
   NIX_CFLAGS_COMPILE = [ "-I${libxml2.dev}/include/libxml2" ] ++ optional stdenv.isDarwin "-Wno-error=deprecated-declarations";
 
+  configurePlatforms = [];
+
   preConfigure = (concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules);
 
+  patches = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/openwrt/packages/master/net/nginx/patches/102-sizeof_test_fix.patch";
+      sha256 = "0i2k30ac8d7inj9l6bl0684kjglam2f68z8lf3xggcc2i5wzhh8a";
+    })
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/openwrt/packages/master/net/nginx/patches/101-feature_test_fix.patch";
+      sha256 = "0v6890a85aqmw60pgj3mm7g8nkaphgq65dj4v9c6h58wdsrc6f0y";
+    })
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/openwrt/packages/master/net/nginx/patches/103-sys_nerr.patch";
+      sha256 = "0s497x6mkz947aw29wdy073k8dyjq8j99lax1a1mzpikzr4rxlmd";
+    })
+  ];
+
   hardeningEnable = optional (!stdenv.isDarwin) "pie";
 
   enableParallelBuilding = true;