nginx/etag-patch: Use Nix store dir from build env
So far, the Nix store directory was hardcoded and if someone uses a different Nix store directory the patch won't work. Of course, this is pretty uncommon, but by not only substituting the store directory but also the length of it we also save a few calls to ngx_strlen(), which should save us a few cycles. Signed-off-by: aszlig <aszlig@nix.build>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{ stdenv, fetchurl, fetchpatch, openssl, zlib, pcre, libxml2, libxslt
|
||||
, gd, geoip
|
||||
, substituteAll, gd, geoip
|
||||
, withDebug ? false
|
||||
, withStream ? true
|
||||
, withMail ? false
|
||||
@@ -75,9 +75,12 @@ stdenv.mkDerivation {
|
||||
|
||||
preConfigure = (concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules);
|
||||
|
||||
patches = [
|
||||
./nix-etag-1.15.4.patch
|
||||
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||
patches = stdenv.lib.singleton (substituteAll {
|
||||
src = ./nix-etag-1.15.4.patch;
|
||||
preInstall = ''
|
||||
export nixStoreDir="$NIX_STORE" nixStoreDirLen="''${#NIX_STORE}"
|
||||
'';
|
||||
}) ++ 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";
|
||||
|
||||
Reference in New Issue
Block a user