boost: updated to version 1.47.0

Packages that don't build with the latest libraries can use 'boost144', which
is the version we had before.

svn path=/nixpkgs/trunk/; revision=27740
This commit is contained in:
Peter Simons 2011-07-12 14:24:01 +00:00
parent cc34c985d3
commit 67bbb5203c
3 changed files with 96 additions and 15 deletions

View File

@ -0,0 +1,90 @@
{ stdenv, fetchurl, icu, expat, zlib, bzip2, python
, enableRelease ? true
, enableDebug ? false
, enableSingleThreaded ? false
, enableMultiThreaded ? true
, enableShared ? true
, enableStatic ? false
, enablePIC ? false
}:
let
variant = stdenv.lib.concatStringsSep ","
(stdenv.lib.optional enableRelease "release" ++
stdenv.lib.optional enableDebug "debug");
threading = stdenv.lib.concatStringsSep ","
(stdenv.lib.optional enableSingleThreaded "single" ++
stdenv.lib.optional enableMultiThreaded "multi");
link = stdenv.lib.concatStringsSep ","
(stdenv.lib.optional enableShared "shared" ++
stdenv.lib.optional enableStatic "static");
# To avoid library name collisions
finalLayout = if ((enableRelease && enableDebug) ||
(enableSingleThreaded && enableMultiThreaded) ||
(enableShared && enableStatic)) then
"tagged" else "system";
cflags = if (enablePIC) then "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" else "";
in
stdenv.mkDerivation {
name = "boost-1.44.0";
meta = {
homepage = "http://boost.org/";
description = "Boost C++ Library Collection";
license = "boost-license";
maintainers = [ stdenv.lib.maintainers.simons ];
};
src = fetchurl {
url = "mirror://sourceforge/boost/boost_1_44_0.tar.bz2";
sha256 = "1nvq36mvzr1fr85q0jh86rk3bk65s1y55jgqgzfg3lcpkl12ihs5";
};
enableParallelBuilding = true;
buildInputs = [icu expat zlib bzip2 python];
configureScript = "./bootstrap.sh";
configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python";
buildPhase = "./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${finalLayout} variant=${variant} threading=${threading} link=${link} ${cflags} install";
installPhase = ":";
patches = [
# Patch to get rid of following error, experienced by some packages like encfs, bitcoin:
# terminate called after throwing an instance of 'std::runtime_error'
# what(): locale::facet::_S_create_c_locale name not valid
(fetchurl {
url = https://svn.boost.org/trac/boost/raw-attachment/ticket/4688/boost_filesystem.patch ;
sha256 = "15k91ihzs6190pnryh4cl0b3c2pjpl9d790mr14x16zq52y7px2d";
})
];
crossAttrs = rec {
buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
# 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 = ''
export configureFlags="--prefix=$out --without-icu"
'';
buildPhase = ''
set -x
cat << EOF > user-config.jam
using gcc : cross : $crossConfig-g++ ;
EOF
./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
'';
};
}

View File

@ -33,7 +33,7 @@ let
in in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "boost-1.44.0"; name = "boost-1.47.0";
meta = { meta = {
homepage = "http://boost.org/"; homepage = "http://boost.org/";
@ -44,8 +44,8 @@ stdenv.mkDerivation {
}; };
src = fetchurl { src = fetchurl {
url = "mirror://sourceforge/boost/boost_1_44_0.tar.bz2"; url = "mirror://sourceforge/boost/boost_1_47_0.tar.bz2";
sha256 = "1nvq36mvzr1fr85q0jh86rk3bk65s1y55jgqgzfg3lcpkl12ihs5"; sha256 = "815a5d9faac4dbd523fbcf3fe1065e443c0bbf43427c44aa423422c6ec4c2e31";
}; };
enableParallelBuilding = true; enableParallelBuilding = true;
@ -55,20 +55,10 @@ stdenv.mkDerivation {
configureScript = "./bootstrap.sh"; configureScript = "./bootstrap.sh";
configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python"; configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python";
buildPhase = "./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${finalLayout} variant=${variant} threading=${threading} link=${link} ${cflags} install"; buildPhase = "./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${finalLayout} variant=${variant} threading=${threading} link=${link} ${cflags} install";
installPhase = ":"; installPhase = ":";
patches = [
# Patch to get rid of following error, experienced by some packages like encfs, bitcoin:
# terminate called after throwing an instance of 'std::runtime_error'
# what(): locale::facet::_S_create_c_locale name not valid
(fetchurl {
url = https://svn.boost.org/trac/boost/raw-attachment/ticket/4688/boost_filesystem.patch ;
sha256 = "15k91ihzs6190pnryh4cl0b3c2pjpl9d790mr14x16zq52y7px2d";
})
];
crossAttrs = rec { crossAttrs = rec {
buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ]; buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
# all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
@ -84,7 +74,7 @@ stdenv.mkDerivation {
cat << EOF > user-config.jam cat << EOF > user-config.jam
using gcc : cross : $crossConfig-g++ ; using gcc : cross : $crossConfig-g++ ;
EOF EOF
./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
''; '';
}; };
} }

View File

@ -2923,6 +2923,7 @@ let
boost = callPackage ../development/libraries/boost { }; boost = callPackage ../development/libraries/boost { };
boost142 = callPackage ../development/libraries/boost/1.42.nix { }; boost142 = callPackage ../development/libraries/boost/1.42.nix { };
boost144 = callPackage ../development/libraries/boost/1.44.nix { };
boost146 = callPackage ../development/libraries/boost/1.46.nix { }; boost146 = callPackage ../development/libraries/boost/1.46.nix { };
# A Boost build with all library variants enabled. Very large (about 250 MB). # A Boost build with all library variants enabled. Very large (about 250 MB).