diff --git a/pkgs/development/libraries/physics/clhep/default.nix b/pkgs/development/libraries/physics/clhep/default.nix new file mode 100644 index 000000000000..6f648463c854 --- /dev/null +++ b/pkgs/development/libraries/physics/clhep/default.nix @@ -0,0 +1,36 @@ +{ lib +, stdenv +, fetchurl +, cmake +}: + +stdenv.mkDerivation rec { + pname = "clhep"; + version = "2.4.5.3"; + + src = fetchurl { + url = "https://proj-clhep.web.cern.ch/proj-clhep/dist1/clhep-${version}.tgz"; + hash = "sha256-RfY+6wl/Av5nuGp9rb8Q1Am0AcKKGj4XLbNiUsMJfBM="; + }; + + prePatch = '' + cd CLHEP + ''; + + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace "clhep_ensure_out_of_source_build()" "" + ''; + + nativeBuildInputs = [ + cmake + ]; + + meta = with lib; { + description = "Set of HEP-specific foundation and utility classes such as random generators, physics vectors, geometry and linear algebra"; + homepage = "https://cern.ch/clhep"; + license = with licenses; [ gpl3Only lgpl3Only ]; + maintainers = with maintainers; [ veprbl ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/development/libraries/physics/geant4/default.nix b/pkgs/development/libraries/physics/geant4/default.nix index 3a23d25d8751..65735896d659 100644 --- a/pkgs/development/libraries/physics/geant4/default.nix +++ b/pkgs/development/libraries/physics/geant4/default.nix @@ -10,7 +10,7 @@ # Standard build environment with cmake. , lib, stdenv, fetchurl, fetchpatch, cmake -, clhep ? null # not packaged currently +, clhep , expat , xercesc , zlib @@ -65,7 +65,7 @@ stdenv.mkDerivation rec { "-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_CLHEP=ON" "-DGEANT4_USE_SYSTEM_EXPAT=ON" "-DGEANT4_USE_SYSTEM_ZLIB=ON" "-DGEANT4_BUILD_MULTITHREADED=${if enableMultiThreading then "ON" else "OFF"}" @@ -88,11 +88,11 @@ stdenv.mkDerivation rec { ]; dontWrapQtApps = true; # no binaries - buildInputs = [ libGLU xlibsWrapper libXmu ] + buildInputs = [ clhep libGLU xlibsWrapper libXmu ] ++ lib.optionals enableInventor [ libXpm coin3d soxt motif ] ++ lib.optionals enablePython [ boost_python python3 ]; - propagatedBuildInputs = [ clhep expat xercesc zlib libGL ] + propagatedBuildInputs = [ expat xercesc zlib libGL ] ++ lib.optionals enableXM [ motif ] ++ lib.optionals enableQt [ qtbase ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e1bb2dcf0e46..e912dc80f158 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34343,6 +34343,8 @@ with pkgs; cernlib = callPackage ../development/libraries/physics/cernlib { }; + clhep = callPackage ../development/libraries/physics/clhep { }; + hepmc2 = callPackage ../development/libraries/physics/hepmc2 { }; hepmc3 = callPackage ../development/libraries/physics/hepmc3 {