boost: run build and install hooks

Users who want to patch boost may put a postInstall hook in an overlay, which
requires that that expression runs them on the buildPhase and installPhase.
This commit is contained in:
Benjamin Hipple 2019-05-24 17:40:37 -04:00
parent 084d75adb8
commit 3232cadf96

View File

@ -97,9 +97,9 @@ let
in in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "boost-${version}"; pname = "boost";
inherit src; inherit src version;
patchFlags = ""; patchFlags = "";
@ -112,11 +112,10 @@ stdenv.mkDerivation {
meta = { meta = {
homepage = http://boost.org/; homepage = http://boost.org/;
description = "Collection of C++ libraries"; description = "Collection of C++ libraries";
license = stdenv.lib.licenses.boost; license = licenses.boost;
platforms = platforms.unix ++ platforms.windows; platforms = platforms.unix ++ platforms.windows;
badPlatforms = stdenv.lib.optional (versionOlder version "1.59") "aarch64-linux" badPlatforms = optional (versionOlder version "1.59") "aarch64-linux"
++ stdenv.lib.optional ((versionOlder version "1.57") || version == "1.58") "x86_64-darwin"; ++ optional ((versionOlder version "1.57") || version == "1.58") "x86_64-darwin";
maintainers = with maintainers; [ peti ]; maintainers = with maintainers; [ peti ];
}; };
@ -158,16 +157,22 @@ stdenv.mkDerivation {
++ optional (toolset != null) "--with-toolset=${toolset}"; ++ optional (toolset != null) "--with-toolset=${toolset}";
buildPhase = '' buildPhase = ''
runHook preBuild
./b2 ${b2Args} ./b2 ${b2Args}
runHook postBuild
''; '';
installPhase = '' installPhase = ''
runHook preInstall
# boostbook is needed by some applications # boostbook is needed by some applications
mkdir -p $dev/share/boostbook mkdir -p $dev/share/boostbook
cp -a tools/boostbook/{xsl,dtd} $dev/share/boostbook/ cp -a tools/boostbook/{xsl,dtd} $dev/share/boostbook/
# Let boost install everything else # Let boost install everything else
./b2 ${b2Args} install ./b2 ${b2Args} install
runHook postInstall
''; '';
postFixup = '' postFixup = ''