From fc4f99a8dd0b0e02d453f20e3fc1d60effdf3364 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Thu, 16 Aug 2018 14:48:03 -0400 Subject: [PATCH] g4py: fix for new boost --- .../libraries/physics/geant4/g4py/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/physics/geant4/g4py/default.nix b/pkgs/development/libraries/physics/geant4/g4py/default.nix index 197b842ff476..551d61af3ada 100644 --- a/pkgs/development/libraries/physics/geant4/g4py/default.nix +++ b/pkgs/development/libraries/physics/geant4/g4py/default.nix @@ -11,6 +11,7 @@ let # g4py does not support MT and will fail to build against MT geant geant4_nomt = geant4.override { enableMultiThreading = false; }; + boost_python = boost.override { enablePython = true; inherit python; }; in stdenv.mkDerivation rec { @@ -20,10 +21,20 @@ stdenv.mkDerivation rec { sourceRoot = "geant4.10.04.p01/environments/g4py"; nativeBuildInputs = [ cmake ]; - buildInputs = [ geant4_nomt xercesc boost python ]; + buildInputs = [ geant4_nomt xercesc boost_python python ]; GEANT4_INSTALL = geant4_nomt; + preConfigure = '' + # Fix for boost 1.67+ + substituteInPlace CMakeLists.txt \ + --replace "find_package(Boost)" "find_package(Boost 1.40 REQUIRED COMPONENTS python${builtins.replaceStrings ["."] [""] python.majorVersion})" + for f in `find . -name CMakeLists.txt`; do + substituteInPlace "$f" \ + --replace "boost_python" "\''${Boost_LIBRARIES}" + done + ''; + enableParallelBuilding = true; setupHook = ./setup-hook.sh;