Merge pull request #200770 from lopsided98/boost-python-cross

boost: enable cross-compiling Boost.Python
This commit is contained in:
Jörg Thalheim 2022-11-20 20:23:05 +01:00 committed by GitHub
commit 231da8ef22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -207,6 +207,15 @@ stdenv.mkDerivation {
<ranlib>$RANLIB
;
EOF
''
# b2 needs to be explicitly told how to find Python when cross-compiling
+ optionalString enablePython ''
cat << EOF >> user-config.jam
using python : : ${python.interpreter}
: ${python}/include/python${python.pythonVersion}
: ${python}/lib
;
EOF
'';
NIX_CFLAGS_LINK = lib.optionalString stdenv.isDarwin
@ -229,8 +238,7 @@ stdenv.mkDerivation {
"--includedir=$(dev)/include"
"--libdir=$(out)/lib"
"--with-bjam=b2" # prevent bootstrapping b2 in configurePhase
] ++ optional enablePython "--with-python=${python.interpreter}"
++ optional (toolset != null) "--with-toolset=${toolset}"
] ++ optional (toolset != null) "--with-toolset=${toolset}"
++ [ (if stdenv.hostPlatform == stdenv.buildPlatform then "--with-icu=${icu.dev}" else "--without-icu") ];
buildPhase = ''