Skip to content

Commit

Permalink
apacheHttpd_2_4: fix cross compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCao committed Aug 25, 2024
1 parent dc05f34 commit d2b1a6d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion pkgs/servers/http/apache-httpd/2.4.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, perl, zlib, apr, aprutil, pcre2, libiconv, lynx, which, libxcrypt
{ lib, stdenv, fetchurl, fetchpatch2, perl, zlib, apr, aprutil, pcre2, libiconv, lynx, which, libxcrypt, buildPackages
, nixosTests
, proxySupport ? true
, sslSupport ? true, openssl
Expand All @@ -19,10 +19,22 @@ stdenv.mkDerivation rec {
hash = "sha256-Z0GI579EztgtqNtSLalGhJ4iCA1z0WyT9/TfieJXKew=";
};

patches = [
# Fix cross-compilation by using CC_FOR_BUILD for generator program
# https://issues.apache.org/bugzilla/show_bug.cgi?id=51257#c6
(fetchpatch2 {
name = "apache-httpd-cross-compile.patch";
url = "https://gitlab.com/buildroot.org/buildroot/-/raw/5dae8cddeecf16c791f3c138542ec51c4e627d75/package/apache/0001-cross-compile.patch";
hash = "sha256-KGnAa6euOt6dkZQwURyVITcfqTkDkSR8zpE97DywUUw=";
})
];

# FIXME: -dev depends on -doc
outputs = [ "out" "dev" "man" "doc" ];
setOutputFlags = false; # it would move $out/modules, etc.

depsBuildBuild = [ buildPackages.stdenv.cc ];

nativeBuildInputs = [ which ];

buildInputs = [ perl libxcrypt zlib ] ++
Expand Down Expand Up @@ -70,6 +82,10 @@ stdenv.mkDerivation rec {

(lib.enableFeature luaSupport "lua")
(lib.withFeatureAs luaSupport "lua" lua5)
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
# skip bad config check when cross compiling
# https://gitlab.com/buildroot.org/buildroot/-/blob/5dae8cddeecf16c791f3c138542ec51c4e627d75/package/apache/apache.mk#L23
"ap_cv_void_ptr_lt_long=no"
];

enableParallelBuilding = true;
Expand Down

0 comments on commit d2b1a6d

Please sign in to comment.