diff options
author | Alyssa Ross <hi@alyssa.is> | 2020-07-13 23:20:04 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2020-07-13 23:21:06 +0000 |
commit | a42c1d6d62656dcf9bd85de620f2e200a5ad22d8 (patch) | |
tree | 7d481fea9872f62a034452612be17f4494159baa /nixpkgs/pkgs/development/libraries/physics | |
parent | 55f69a6b0e53c1c4b3e0396937c53bf5662b5519 (diff) | |
parent | 9480bae337095fd24f61380bce3174fdfe926a00 (diff) | |
download | nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.gz nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.bz2 nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.lz nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.xz nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.zst nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.zip |
Merge commit '9480bae337095fd24f61380bce3174fdfe926a00'
This is the last nixos-unstable release before 13b2903169f, which I'm a bit nervous about. So I want the update including that one to be as small as possible, hence going to this one first.
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/physics')
4 files changed, 34 insertions, 70 deletions
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix index df44fa275f5d..85ad11b79b16 100644 --- a/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix +++ b/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix @@ -109,4 +109,11 @@ in sha256 = "0l3gs0nlp10cjlwiln3f72zfch0av2g1r8m2ny9afgvwgbwiyj4h"; envvar = "REALSURFACE"; } + + { + name = "G4TENDL"; + version = "1.3.2"; + sha256 = "0jdqmz3rz5a7yrq1mli6dj3bnmn73igf4fdxwfbl3rxywg38fa9v"; + envvar = "PARTICLEHP"; + } ]) diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix index 8c7ff230e011..97822d769dd5 100644 --- a/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix +++ b/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix @@ -5,6 +5,7 @@ , enableQT ? false , enableXM ? false , enableOpenGLX11 ? true +, enablePython ? false , enableRaytracerX11 ? false # Standard build environment with cmake. @@ -33,17 +34,35 @@ , libGLU, libGL , xlibsWrapper , libXmu + +# For enablePython +, boost +, python3 }: +let + boost_python = boost.override { enablePython = true; python = python3; }; +in + stdenv.mkDerivation rec { - version = "10.6.1"; + version = "10.6.2"; pname = "geant4"; src = fetchurl{ - url = "https://geant4-data.web.cern.ch/geant4-data/releases/geant4.10.06.p01.tar.gz"; - sha256 = "0ssxg7dd7vxljb3fdyb0llg7gsxack21qjfsb3n23k107a19yibk"; + url = "https://geant4-data.web.cern.ch/geant4-data/releases/geant4.10.06.p02.tar.gz"; + sha256 = "0vznm3pjlbihjy1wsxc4gj229k0dzc283wvil2xghyl08vwdpnpc"; }; + boost_python_lib = "python${builtins.replaceStrings ["."] [""] python3.pythonVersion}"; + postPatch = '' + # Fix for boost 1.67+ + substituteInPlace environments/g4py/CMakeLists.txt \ + --replace "find_package(Boost REQUIRED python)" \ + "find_package(Boost REQUIRED COMPONENTS $boost_python_lib)" + substituteInPlace environments/g4py/G4PythonHelpers.cmake \ + --replace "Boost::python" "Boost::$boost_python_lib" + ''; + cmakeFlags = [ "-DGEANT4_INSTALL_DATA=OFF" "-DGEANT4_USE_GDML=${if enableGDML then "ON" else "OFF"}" @@ -52,11 +71,14 @@ stdenv.mkDerivation rec { "-DGEANT4_USE_XM=${if enableXM then "ON" else "OFF"}" "-DGEANT4_USE_OPENGL_X11=${if enableOpenGLX11 then "ON" else "OFF"}" "-DGEANT4_USE_INVENTOR=${if enableInventor then "ON" else "OFF"}" + "-DGEANT4_USE_PYTHON=${if enablePython then "ON" else "OFF"}" "-DGEANT4_USE_RAYTRACER_X11=${if enableRaytracerX11 then "ON" else "OFF"}" "-DGEANT4_USE_SYSTEM_CLHEP=${if clhep != null then "ON" else "OFF"}" "-DGEANT4_USE_SYSTEM_EXPAT=${if expat != null then "ON" else "OFF"}" "-DGEANT4_USE_SYSTEM_ZLIB=${if zlib != null then "ON" else "OFF"}" "-DGEANT4_BUILD_MULTITHREADED=${if enableMultiThreading then "ON" else "OFF"}" + ] ++ stdenv.lib.optionals (enableMultiThreading && enablePython) [ + "-DGEANT4_BUILD_TLS_MODEL=global-dynamic" ] ++ stdenv.lib.optionals enableInventor [ "-DINVENTOR_INCLUDE_DIR=${coin3d}/include" "-DINVENTOR_LIBRARY_RELEASE=${coin3d}/lib/libCoin.so" @@ -66,7 +88,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ libGLU xlibsWrapper libXmu ] - ++ stdenv.lib.optionals enableInventor [ libXpm coin3d soxt motif ]; + ++ stdenv.lib.optionals enableInventor [ libXpm coin3d soxt motif ] + ++ stdenv.lib.optionals enablePython [ boost_python python3 ]; propagatedBuildInputs = [ clhep expat zlib libGL ] ++ stdenv.lib.optionals enableGDML [ xercesc ] diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/g4py/default.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/g4py/default.nix deleted file mode 100644 index 4937cc0eca93..000000000000 --- a/nixpkgs/pkgs/development/libraries/physics/geant4/g4py/default.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ stdenv, cmake, xercesc - -# The target version of Geant4 -, geant4 - -# Python (obviously) and boost::python for wrapping. -, python -, boost -}: - -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 { - inherit (geant4_nomt) version src; - pname = "g4py"; - - nativeBuildInputs = [ cmake ]; - buildInputs = [ geant4_nomt xercesc boost_python python ]; - - GEANT4_INSTALL = geant4_nomt; - - postPatch = '' - cd environments/g4py - ''; - - preConfigure = '' - # Fix for boost 1.67+ - substituteInPlace CMakeLists.txt \ - --replace "find_package(Boost)" "find_package(Boost 1.40 REQUIRED COMPONENTS python${builtins.replaceStrings ["."] [""] python.pythonVersion})" - for f in `find . -name CMakeLists.txt`; do - substituteInPlace "$f" \ - --replace "boost_python" "\''${Boost_LIBRARIES}" - done - ''; - - enableParallelBuilding = true; - - setupHook = ./setup-hook.sh; - - # Make sure we set PYTHONPATH - shellHook = '' - source $out/nix-support/setup-hook - ''; - - meta = { - description = "Python bindings and utilities for Geant4"; - longDescription = '' - Geant4 is a toolkit for the simulation of the passage of particles - through matter. Its areas of application include high energy, - nuclear and accelerator physics, as well as studies in medical and - space science. The two main reference papers for Geant4 are - published in Nuclear Instruments and Methods in Physics Research A - 506 (2003) 250-303, and IEEE Transactions on Nuclear Science 53 No. 1 - (2006) 270-278. - ''; - homepage = "http://www.geant4.org"; - license = stdenv.lib.licenses.g4sl; - maintainers = [ ]; - platforms = stdenv.lib.platforms.all; - }; -} diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/g4py/setup-hook.sh b/nixpkgs/pkgs/development/libraries/physics/geant4/g4py/setup-hook.sh deleted file mode 100644 index 8abfb461fc0f..000000000000 --- a/nixpkgs/pkgs/development/libraries/physics/geant4/g4py/setup-hook.sh +++ /dev/null @@ -1 +0,0 @@ -export PYTHONPATH=$PYTHONPATH:@out@/lib |