mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-15 10:12:58 +00:00
ninja: fix cross compilation
This commit is contained in:
parent
7c824bb1b1
commit
70599398d8
@ -9,6 +9,7 @@
|
||||
, libxslt
|
||||
, python3
|
||||
, re2c
|
||||
, buildPackages
|
||||
, buildDocs ? true
|
||||
}:
|
||||
|
||||
@ -23,6 +24,8 @@ stdenv.mkDerivation rec {
|
||||
hash = "sha256-LvV/Fi2ARXBkfyA1paCRmLUwCh/rTyz+tGMg2/qEepI=";
|
||||
};
|
||||
|
||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
python3
|
||||
re2c
|
||||
@ -35,10 +38,25 @@ stdenv.mkDerivation rec {
|
||||
libxslt.bin
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# write rebuild args to file after bootstrap
|
||||
substituteInPlace configure.py --replace "subprocess.check_call(rebuild_args)" "open('rebuild_args','w').write(rebuild_args[0])"
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
# for list of env vars
|
||||
# see https://github.com/ninja-build/ninja/blob/v1.11.1/configure.py#L264
|
||||
CXX="$CXX_FOR_BUILD" \
|
||||
AR="$AR_FOR_BUILD" \
|
||||
CFLAGS="$CFLAGS_FOR_BUILD" \
|
||||
CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
|
||||
LDFLAGS="$LDFLAGS_FOR_BUILD" \
|
||||
python configure.py --bootstrap
|
||||
python configure.py
|
||||
|
||||
source rebuild_args
|
||||
'' + lib.optionalString buildDocs ''
|
||||
# "./ninja -vn manual" output copied here to support cross compilation.
|
||||
asciidoc -b docbook -d book -o build/manual.xml doc/manual.asciidoc
|
||||
|
Loading…
Reference in New Issue
Block a user