boost: enable setting toolset

Contribution suggested/initially implemented by Martin Bravenboer

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2014-01-14 07:23:48 -05:00
parent f0037b85d1
commit cc26a4b803

View file

@ -1,4 +1,5 @@
{ stdenv, fetchurl, icu, expat, zlib, bzip2, python { stdenv, fetchurl, icu, expat, zlib, bzip2, python
, toolset ? null
, enableRelease ? true , enableRelease ? true
, enableDebug ? false , enableDebug ? false
, enableSingleThreaded ? false , enableSingleThreaded ? false
@ -35,6 +36,8 @@ let
"cflags=-fexceptions" "cflags=-fexceptions"
else else
""; "";
withToolset = stdenv.lib.optionalString (toolset != null) " --with-toolset=${toolset}";
in in
stdenv.mkDerivation { stdenv.mkDerivation {
@ -59,15 +62,15 @@ stdenv.mkDerivation {
buildInputs = [icu expat zlib bzip2 python]; buildInputs = [icu expat zlib bzip2 python];
configureScript = "./bootstrap.sh"; configureScript = "./bootstrap.sh";
configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python"; configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python" + withToolset;
buildPhase = "./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install"; buildPhase = "${stdenv.lib.optionalString (toolset == "clang") "unset NIX_ENFORCE_PURITY; "}./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install${withToolset}";
# normal install does not install bjam, this is a separate step # normal install does not install bjam, this is a separate step
installPhase = '' installPhase = ''
cd tools/build/v2 cd tools/build/v2
sh bootstrap.sh sh bootstrap.sh${withToolset}
./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install${withToolset}
''; '';
crossAttrs = rec { crossAttrs = rec {