lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

boost-build: allow supplying a boost version to build b2 for

The `useBoost` argument expects an attribute set with an src and version
attribute (so a boost derivation works) and builds b2 for the given
version of boost. This is useful when bootstrapping boost: We can
override boost-build to get a boost-build derivation matching the
current boost version we want to build (b2 is not backwards compatible
enough to build older boost versions) without the need of having
one boost-build${version} attribute for every boost version we have
which is not very useful for nixpkgs' users.

+29 -6
+29 -6
pkgs/development/tools/boost-build/default.nix
··· 2 2 , stdenv 3 3 , fetchFromGitHub 4 4 , bison 5 + # boost derivation to use for the src and version. 6 + # This is used by the boost derivation to build 7 + # a b2 matching their version (by overriding this 8 + # argument). Infinite recursion is not an issue 9 + # since we only look at src and version of boost. 10 + , useBoost ? {} 5 11 }: 6 12 7 - stdenv.mkDerivation rec { 13 + let 14 + defaultVersion = "4.4.1"; 15 + in 16 + 17 + stdenv.mkDerivation { 8 18 pname = "boost-build"; 9 - version = "4.4.1"; 19 + version = 20 + if useBoost ? version 21 + then "boost-${useBoost.version}" 22 + else defaultVersion; 10 23 11 - src = fetchFromGitHub { 24 + src = useBoost.src or (fetchFromGitHub { 12 25 owner = "boostorg"; 13 26 repo = "build"; 14 - rev = version; 27 + rev = defaultVersion; 15 28 sha256 = "1r4rwlq87ydmsdqrik4ly5iai796qalvw7603mridg2nwcbbnf54"; 16 - }; 29 + }); 30 + 31 + # b2 is in a subdirectory of boost source tarballs 32 + postUnpack = lib.optionalString (useBoost ? src) '' 33 + sourceRoot="$sourceRoot/tools/build" 34 + ''; 17 35 18 36 patches = [ 19 37 # Upstream defaults to gcc on darwin, but we use clang. ··· 32 50 33 51 installPhase = '' 34 52 runHook preInstall 53 + 35 54 ./b2 install --prefix="$out" 36 - ln -s b2 "$out/bin/bjam" 55 + 56 + # older versions of b2 created this symlink, 57 + # which we want to support building via useBoost. 58 + test -e "$out/bin/bjam" || ln -s b2 "$out/bin/bjam" 59 + 37 60 runHook postInstall 38 61 ''; 39 62