boost: finish fixes for mingw

- Dynamic linking won't work, it seems.
- When using a native python, the extension isn't built,
  so let's not depend on it.
- Replace flags missing on this branch, such as `isCrossWin`.
wip/yesman
Vladimír Čunát 8 years ago
parent fb74d901d7
commit 2b0d725854
  1. 27
      pkgs/development/libraries/boost/generic.nix

@ -4,8 +4,8 @@
, enableDebug ? false
, enableSingleThreaded ? false
, enableMultiThreaded ? true
, enableShared ? true
, enableStatic ? false
, enableShared ? !(stdenv.cross.libc or null == "msvcrt") # problems for now
, enableStatic ? !enableShared
, enablePIC ? false
, enableExceptions ? false
, taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
@ -76,11 +76,11 @@ let
"--user-config=user-config.jam"
"toolset=gcc-cross"
"--without-python"
] ++ optionals stdenv.isCrossWin [
] ++ optionals (stdenv.cross.libc == "msvcrt") [
"target-os=windows"
"threadapi=win32"
"binary-format=pe"
"address-model=${if stdenv.isCross64 then "64" else "32"}"
"address-model=${if hasPrefix "x86_64-" stdenv.cross.config then "64" else "32"}"
"architecture=x86"
];
crossB2Args = concatStringsSep " " (genericB2Flags ++ crossB2Flags);
@ -114,6 +114,8 @@ let
find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \
-exec sed '1i#line 1 "{}"' -i '{}' \;
)
'' + optionalString (stdenv.cross.libc or null == "msvcrt") ''
${stdenv.cross.config}-ranlib "$lib"/lib/*.a
'';
in
@ -149,14 +151,15 @@ stdenv.mkDerivation {
enableParallelBuilding = true;
buildInputs = [ icu expat zlib bzip2 python ]
buildInputs = [ expat zlib bzip2 ]
++ stdenv.lib.optionals (! stdenv ? cross) [ python icu ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
configureScript = "./bootstrap.sh";
configureFlags = commonConfigureFlags ++ [
"--with-icu=${icu.dev}"
"--with-python=${python.interpreter}"
] ++ optional (toolset != null) "--with-toolset=${toolset}";
configureFlags = commonConfigureFlags
++ [ "--with-python=${python.interpreter}" ]
++ optional (! stdenv ? cross) "--with-icu=${icu.dev}"
++ optional (toolset != null) "--with-toolset=${toolset}";
buildPhase = builder nativeB2Args;
@ -168,10 +171,6 @@ stdenv.mkDerivation {
setOutputFlags = false;
crossAttrs = rec {
buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
# all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
# override them.
propagatedBuildInputs = buildInputs;
# We want to substitute the contents of configureFlags, removing thus the
# usual --build and --host added on cross building.
preConfigure = ''
@ -183,7 +182,7 @@ stdenv.mkDerivation {
buildPhase = builder crossB2Args;
installPhase = installer crossB2Args;
postFixup = fixup;
} // optionalAttrs stdenv.isCrossWin {
} // optionalAttrs (stdenv.cross.libc == "msvcrt") {
patches = fetchurl {
url = "https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/"
+ "boost-mingw.patch";

Loading…
Cancel
Save