From fcef0add76de4728b11cf9acba840a7e7d06abbb Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 28 Jun 2017 11:23:32 -0400 Subject: [PATCH] boost: Don't use stdenv.cross, and utilize new platform metadata --- pkgs/development/libraries/boost/generic.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix index 174e9fe47769..14d0c251c96f 100644 --- a/pkgs/development/libraries/boost/generic.nix +++ b/pkgs/development/libraries/boost/generic.nix @@ -1,10 +1,11 @@ { stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv +, hostPlatform , toolset ? if stdenv.cc.isClang then "clang" else null , enableRelease ? true , enableDebug ? false , enableSingleThreaded ? false , enableMultiThreaded ? true -, enableShared ? !(stdenv.cross.libc or null == "msvcrt") # problems for now +, enableShared ? !(hostPlatform.libc == "msvcrt") # problems for now , enableStatic ? !enableShared , enablePIC ? false , enableExceptions ? false @@ -76,11 +77,11 @@ let "--user-config=user-config.jam" "toolset=gcc-cross" "--without-python" - ] ++ optionals (stdenv.cross.libc == "msvcrt") [ + ] ++ optionals (hostPlatform.libc == "msvcrt") [ "target-os=windows" "threadapi=win32" "binary-format=pe" - "address-model=${if hasPrefix "x86_64-" stdenv.cross.config then "64" else "32"}" + "address-model=${toString hostPlatform.parsed.cpu.bits}" "architecture=x86" ]; crossB2Args = concatStringsSep " " (genericB2Flags ++ crossB2Flags); @@ -110,8 +111,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 "$out/lib/"*.a + '' + optionalString (hostPlatform.libc == "msvcrt") '' + ${stdenv.cc.prefix}ranlib "$out/lib/"*.a ''; in @@ -177,7 +178,7 @@ stdenv.mkDerivation { buildPhase = builder crossB2Args; installPhase = installer crossB2Args; postFixup = fixup; - } // optionalAttrs (stdenv.cross.libc == "msvcrt") { + } // optionalAttrs (hostPlatform.libc == "msvcrt") { patches = fetchurl { url = "https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/" + "boost-mingw.patch";