From 06c0cce0e5e3cfd2f19e53563d966c727166efd6 Mon Sep 17 00:00:00 2001 From: oxalica Date: Fri, 9 Dec 2022 02:52:00 +0800 Subject: [PATCH] boost: add configurable `enableIcu` flag This makes it easier to disable ICU support with `override`, where the closure size matters. --- pkgs/development/libraries/boost/generic.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix index bea3f007e631..feb41bf62941 100644 --- a/pkgs/development/libraries/boost/generic.nix +++ b/pkgs/development/libraries/boost/generic.nix @@ -13,6 +13,7 @@ , enableStatic ? !enableShared , enablePython ? false , enableNumpy ? false +, enableIcu ? stdenv.hostPlatform == stdenv.buildPlatform , taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic)) , patches ? [] , boostBuildPatches ? [] @@ -226,7 +227,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ which boost-build ] ++ optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; buildInputs = [ expat zlib bzip2 libiconv ] - ++ optional (stdenv.hostPlatform == stdenv.buildPlatform) icu + ++ optional enableIcu icu ++ optionals enablePython [ libxcrypt python ] ++ optional enableNumpy python.pkgs.numpy; @@ -239,7 +240,7 @@ stdenv.mkDerivation { "--libdir=$(out)/lib" "--with-bjam=b2" # prevent bootstrapping b2 in configurePhase ] ++ optional (toolset != null) "--with-toolset=${toolset}" - ++ [ (if stdenv.hostPlatform == stdenv.buildPlatform then "--with-icu=${icu.dev}" else "--without-icu") ]; + ++ [ (if enableIcu then "--with-icu=${icu.dev}" else "--without-icu") ]; buildPhase = '' runHook preBuild