nixpkgs/pkgs/development/libraries/boost/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
708 B
Nix
Raw Normal View History

boost*: use packaged b2 instead it of building in configurePhase If we build two things in one derivation, it becomes more complicated and its build time is extended. Therefore we should avoid this if possible. There's a good opportunity for this with boost: We have boost-build packaged already. This has the additional benefit that we can get rid of $CC_FOR_BUILD entirely in boost, meaning we don't need to rely on (as many) hacks to make boost understand our way of cross compiling. Unfortunately boost-build is not backwards compatible, so we need to build a specific boost-build for each boost derivation (the number could probably be reduced, but I'm not interested in testing a lot of boost builds at the moment). Additionally we fix a few cross compilation problems: - boost couldn't cope with different types of compilers for native and cross (as happens if useLLVM is true). Since we only use one of them per derivation, this is no longer an issue. - boost didn't find the cross ar and ranlib for compilation (since it doesn't check $AR or $RANLIB). Instead it used plain ar and ranlib form $PATH which were the native ones before. This is now fixed by setting these tools explicitly in user-config.jam (and no longer providing the native tools). With these changes, pkgsLLVM.boost builds. On darwin, instead of patching the clang-darwin.jam definition, we instead supply -rpath $out/lib via <linkflags> which causes the correct directory to be added to the libraries' rpaths, so that they find each other.
2021-08-03 21:05:12 +00:00
{ lib
, callPackage
, boost-build
, fetchurl
}:
let
makeBoost = file:
lib.fix (self:
callPackage file {
boost-build = boost-build.override {
# useBoost allows us passing in src and version from
# the derivation we are building to get a matching b2 version.
2022-08-31 16:34:31 +00:00
useBoost = self;
boost*: use packaged b2 instead it of building in configurePhase If we build two things in one derivation, it becomes more complicated and its build time is extended. Therefore we should avoid this if possible. There's a good opportunity for this with boost: We have boost-build packaged already. This has the additional benefit that we can get rid of $CC_FOR_BUILD entirely in boost, meaning we don't need to rely on (as many) hacks to make boost understand our way of cross compiling. Unfortunately boost-build is not backwards compatible, so we need to build a specific boost-build for each boost derivation (the number could probably be reduced, but I'm not interested in testing a lot of boost builds at the moment). Additionally we fix a few cross compilation problems: - boost couldn't cope with different types of compilers for native and cross (as happens if useLLVM is true). Since we only use one of them per derivation, this is no longer an issue. - boost didn't find the cross ar and ranlib for compilation (since it doesn't check $AR or $RANLIB). Instead it used plain ar and ranlib form $PATH which were the native ones before. This is now fixed by setting these tools explicitly in user-config.jam (and no longer providing the native tools). With these changes, pkgsLLVM.boost builds. On darwin, instead of patching the clang-darwin.jam definition, we instead supply -rpath $out/lib via <linkflags> which causes the correct directory to be added to the libraries' rpaths, so that they find each other.
2021-08-03 21:05:12 +00:00
};
}
);
in {
boost175 = makeBoost ./1.75.nix;
2021-09-17 17:17:40 +00:00
boost177 = makeBoost ./1.77.nix;
2022-02-23 19:01:22 +00:00
boost178 = makeBoost ./1.78.nix;
2022-05-12 14:43:06 +00:00
boost179 = makeBoost ./1.79.nix;
2022-10-21 07:01:18 +00:00
boost180 = makeBoost ./1.80.nix;
2022-12-29 09:29:26 +00:00
boost181 = makeBoost ./1.81.nix;
boost182 = makeBoost ./1.82.nix;
2023-09-03 14:48:15 +00:00
boost183 = makeBoost ./1.83.nix;
2023-12-15 08:20:47 +00:00
boost184 = makeBoost ./1.84.nix;
boost185 = makeBoost ./1.85.nix;
boost*: use packaged b2 instead it of building in configurePhase If we build two things in one derivation, it becomes more complicated and its build time is extended. Therefore we should avoid this if possible. There's a good opportunity for this with boost: We have boost-build packaged already. This has the additional benefit that we can get rid of $CC_FOR_BUILD entirely in boost, meaning we don't need to rely on (as many) hacks to make boost understand our way of cross compiling. Unfortunately boost-build is not backwards compatible, so we need to build a specific boost-build for each boost derivation (the number could probably be reduced, but I'm not interested in testing a lot of boost builds at the moment). Additionally we fix a few cross compilation problems: - boost couldn't cope with different types of compilers for native and cross (as happens if useLLVM is true). Since we only use one of them per derivation, this is no longer an issue. - boost didn't find the cross ar and ranlib for compilation (since it doesn't check $AR or $RANLIB). Instead it used plain ar and ranlib form $PATH which were the native ones before. This is now fixed by setting these tools explicitly in user-config.jam (and no longer providing the native tools). With these changes, pkgsLLVM.boost builds. On darwin, instead of patching the clang-darwin.jam definition, we instead supply -rpath $out/lib via <linkflags> which causes the correct directory to be added to the libraries' rpaths, so that they find each other.
2021-08-03 21:05:12 +00:00
}