nginx: Apply patch to fix endianess detection (#437668)
This commit is contained in:
@@ -175,32 +175,37 @@ stdenv.mkDerivation {
|
||||
++ configureFlags
|
||||
++ map (mod: "--add-module=${mod.src}") modules;
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = toString (
|
||||
[
|
||||
"-I${libxml2.dev}/include/libxml2"
|
||||
"-Wno-error=implicit-fallthrough"
|
||||
(
|
||||
# zlig-ng patch needs this
|
||||
if stdenv.cc.isGNU then
|
||||
"-Wno-error=discarded-qualifiers"
|
||||
else
|
||||
"-Wno-error=incompatible-pointer-types-discards-qualifiers"
|
||||
)
|
||||
]
|
||||
++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11") [
|
||||
# fix build vts module on gcc11
|
||||
"-Wno-error=stringop-overread"
|
||||
]
|
||||
++ lib.optionals stdenv.cc.isClang [
|
||||
"-Wno-error=deprecated-declarations"
|
||||
"-Wno-error=gnu-folding-constant"
|
||||
"-Wno-error=unused-but-set-variable"
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isMusl [
|
||||
# fix sys/cdefs.h is deprecated
|
||||
"-Wno-error=cpp"
|
||||
]
|
||||
);
|
||||
env = {
|
||||
NIX_CFLAGS_COMPILE = toString (
|
||||
[
|
||||
"-I${libxml2.dev}/include/libxml2"
|
||||
"-Wno-error=implicit-fallthrough"
|
||||
(
|
||||
# zlig-ng patch needs this
|
||||
if stdenv.cc.isGNU then
|
||||
"-Wno-error=discarded-qualifiers"
|
||||
else
|
||||
"-Wno-error=incompatible-pointer-types-discards-qualifiers"
|
||||
)
|
||||
]
|
||||
++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11") [
|
||||
# fix build vts module on gcc11
|
||||
"-Wno-error=stringop-overread"
|
||||
]
|
||||
++ lib.optionals stdenv.cc.isClang [
|
||||
"-Wno-error=deprecated-declarations"
|
||||
"-Wno-error=gnu-folding-constant"
|
||||
"-Wno-error=unused-but-set-variable"
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isMusl [
|
||||
# fix sys/cdefs.h is deprecated
|
||||
"-Wno-error=cpp"
|
||||
]
|
||||
);
|
||||
}
|
||||
// lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
|
||||
CONFIG_BIG_ENDIAN = if stdenv.hostPlatform.isBigEndian then "y" else "n";
|
||||
};
|
||||
|
||||
configurePlatforms = [ ];
|
||||
|
||||
@@ -218,6 +223,9 @@ stdenv.mkDerivation {
|
||||
./nix-etag-1.15.4.patch
|
||||
./nix-skip-check-logs-path.patch
|
||||
]
|
||||
# Upstream may be against cross-compilation patches.
|
||||
# https://trac.nginx.org/nginx/ticket/2240 https://trac.nginx.org/nginx/ticket/1928#comment:6
|
||||
# That dev quit the project in 2024 so the stance could be different now.
|
||||
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||
(fetchpatch {
|
||||
url = "https://raw.githubusercontent.com/openwrt/packages/c057dfb09c7027287c7862afab965a4cd95293a3/net/nginx/patches/102-sizeof_test_fix.patch";
|
||||
@@ -231,6 +239,10 @@ stdenv.mkDerivation {
|
||||
url = "https://raw.githubusercontent.com/openwrt/packages/c057dfb09c7027287c7862afab965a4cd95293a3/net/nginx/patches/103-sys_nerr.patch";
|
||||
sha256 = "0s497x6mkz947aw29wdy073k8dyjq8j99lax1a1mzpikzr4rxlmd";
|
||||
})
|
||||
(fetchpatch {
|
||||
url = "https://raw.githubusercontent.com/openwrt/packages/c057dfb09c7027287c7862afab965a4cd95293a3/net/nginx/patches/104-endianness_fix.patch";
|
||||
sha256 = "sha256-M7V3ZJfKImur2OoqXcoL+CbgFj/huWnfZ4xMCmvkqfc=";
|
||||
})
|
||||
]
|
||||
++ mapModules "patches"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user