diff --git a/pkgs/development/libraries/physics/geant4/datasets.nix b/pkgs/development/libraries/physics/geant4/datasets.nix index b1df2875fab7..149f541ee42f 100644 --- a/pkgs/development/libraries/physics/geant4/datasets.nix +++ b/pkgs/development/libraries/physics/geant4/datasets.nix @@ -35,15 +35,15 @@ in builtins.listToAttrs (map (a: { name = a.pname; value = mkDataset a; }) [ { pname = "G4NDL"; - version = "4.6"; - sha256 = "sha256-nSh88q4PuIeirc6AHudPub4hsNFm2rSby+6UCKUUVAg="; + version = "4.7"; + sha256 = "sha256-fn09JiEQLcYU91OtkocwopDRlmDu2WMEqdJLRT1nAwk="; envvar = "NEUTRONHP"; } { pname = "G4EMLOW"; - version = "8.0"; - sha256 = "sha256-2Rmo5YOGiCV7kkimE5EOsqdjMFngMMi1DAosKtn9Kzs="; + version = "8.2"; + sha256 = "sha256-PXdoJk/1pTvLlgh2BLvhHGC3/qkKqsj30SUhg+Go5Cc="; envvar = "LE"; } diff --git a/pkgs/development/libraries/physics/geant4/default.nix b/pkgs/development/libraries/physics/geant4/default.nix index 4e635a08414b..b2b368f0349e 100644 --- a/pkgs/development/libraries/physics/geant4/default.nix +++ b/pkgs/development/libraries/physics/geant4/default.nix @@ -3,7 +3,8 @@ , enableQT ? false # deprecated name , enableQt ? enableQT , enableXM ? false -, enableOpenGLX11 ? true +, mesa +, enableOpenGLX11 ? !mesa.meta.broken , enablePython ? false , enableRaytracerX11 ? false @@ -47,14 +48,20 @@ in lib.warnIf (enableQT != false) "geant4: enableQT is deprecated, please use enableQt" stdenv.mkDerivation rec { - version = "11.0.4"; + version = "11.1.3"; pname = "geant4"; src = fetchurl { url = "https://cern.ch/geant4-data/releases/geant4-v${version}.tar.gz"; - hash = "sha256-4wofoo0vLPd8/9CFY8EonpL8R9mcg5Wa9H/ve9UDSyc="; + hash = "sha256-TF++pnidjWGe2sygYx1rUhGmDhv5l0w9P6ue+eImkvU="; }; + # Fix broken paths in a .pc + postPatch = '' + substituteInPlace source/externals/ptl/cmake/Modules/PTLPackageConfigHelpers.cmake \ + --replace '${"$"}{prefix}/${"$"}{PTL_INSTALL_' '${"$"}{PTL_INSTALL_' + ''; + cmakeFlags = [ "-DGEANT4_INSTALL_DATA=OFF" "-DGEANT4_USE_GDML=ON" @@ -69,7 +76,7 @@ stdenv.mkDerivation rec { "-DGEANT4_USE_SYSTEM_EXPAT=ON" "-DGEANT4_USE_SYSTEM_ZLIB=ON" "-DGEANT4_BUILD_MULTITHREADED=${if enableMultiThreading then "ON" else "OFF"}" - ] ++ lib.optionals stdenv.isDarwin [ + ] ++ lib.optionals (enableOpenGLX11 && stdenv.isDarwin) [ "-DXQuartzGL_INCLUDE_DIR=${libGL.dev}/include" "-DXQuartzGL_gl_LIBRARY=${libGL}/lib/libGL.dylib" ] ++ lib.optionals (enableMultiThreading && enablePython) [ @@ -88,11 +95,13 @@ stdenv.mkDerivation rec { ]; dontWrapQtApps = true; # no binaries - buildInputs = [ libGLU libXext libXmu ] + buildInputs = + lib.optionals enableOpenGLX11 [ libGLU libXext libXmu ] ++ lib.optionals enableInventor [ libXpm coin3d soxt motif ] ++ lib.optionals enablePython [ boost_python python3 ]; - propagatedBuildInputs = [ clhep expat xercesc zlib libGL ] + propagatedBuildInputs = [ clhep expat xercesc zlib ] + ++ lib.optionals enableOpenGLX11 [ libGL ] ++ lib.optionals enableXM [ motif ] ++ lib.optionals enableQt [ qtbase ];