Skip to content

Commit

Permalink
nginx: Fix cross-OS build
Browse files Browse the repository at this point in the history
nginx uses uname to find the target platform by default.
This works fine when building locally or when building on the same OS
for most architectures, but breaks when building e.g. Linux to BSD.

Explicitly tell the target to the configure script instead.
  • Loading branch information
artemist committed Jan 8, 2025
1 parent c8693b4 commit 65580ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkgs/servers/http/nginx/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ stdenv.mkDerivation {
[ "--with-http_geoip_module" ] ++ lib.optional withStream "--with-stream_geoip_module"
)
++ lib.optional (with stdenv.hostPlatform; isLinux || isFreeBSD) "--with-file-aio"
++ lib.optional (
stdenv.buildPlatform != stdenv.hostPlatform
) "--crossbuild=${stdenv.hostPlatform.uname.system}::${stdenv.hostPlatform.uname.processor}"
++ configureFlags
++ map (mod: "--add-module=${mod.src}") modules;

Expand Down

0 comments on commit 65580ee

Please sign in to comment.