Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hepmc3: 3.1.2 -> 3.2.0, add python support #82170

Merged
merged 3 commits into from Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 23 additions & 10 deletions pkgs/development/libraries/physics/hepmc3/default.nix
@@ -1,28 +1,41 @@
{ stdenv, fetchurl, cmake, coreutils, root }:
{ stdenv, fetchurl, cmake, coreutils, python, root }:

let
pythonVersion = with stdenv.lib.versions; "${major python.version}${minor python.version}";
veprbl marked this conversation as resolved.
Show resolved Hide resolved
withPython = python != null;
in

stdenv.mkDerivation rec {
pname = "hepmc3";
version = "3.1.2";
version = "3.2.0";

src = fetchurl {
url = "http://hepmc.web.cern.ch/hepmc/releases/HepMC3-${version}.tar.gz";
sha256 = "1izcldnjbyn6myr7nv7b4jivf2vmdi64ng9gk1vjh998755hfcs1";
sha256 = "1z491x3blqs0a2jxmhzhmh4kqdw3ddcbvw69gidg4w6icdvkhcpi";
};

buildInputs = [ cmake root ];
nativeBuildInputs = [ cmake ];
buildInputs = [ root ]
++ stdenv.lib.optional withPython python;

cmakeFlags = [
"-DHEPMC3_ENABLE_PYTHON=${if withPython then "ON" else "OFF"}"
] ++ stdenv.lib.optionals withPython [
"-DHEPMC3_PYTHON_VERSIONS=${if python.isPy3k then "3.X" else "2.X"}"
"-DHEPMC3_Python_SITEARCH${pythonVersion}=${placeholder "out"}/${python.sitePackages}"
];

postInstall = ''
substituteInPlace "$out"/bin/HepMC3-config \
--replace 'greadlink' '${coreutils}/bin/readlink'
--replace 'greadlink' '${coreutils}/bin/readlink' \
--replace 'readlink' '${coreutils}/bin/readlink'
'';

enableParallelBuilding = true;

meta = with stdenv.lib; {
description = "The HepMC package is an object oriented, C++ event record for High Energy Physics Monte Carlo generators and simulation";
license = licenses.gpl3;
homepage = http://hepmc.web.cern.ch/hepmc/;
platforms = platforms.unix;
license = licenses.gpl3;
homepage = "http://hepmc.web.cern.ch/hepmc/";
platforms = platforms.unix;
maintainers = with maintainers; [ veprbl ];
};
}
59 changes: 0 additions & 59 deletions pkgs/development/python-modules/pyhepmc/default.nix

This file was deleted.

204 changes: 0 additions & 204 deletions pkgs/development/python-modules/pyhepmc/pyhepmc_export_edges.patch

This file was deleted.

20 changes: 0 additions & 20 deletions pkgs/development/python-modules/pyhepmc/pyhepmc_export_flow.patch

This file was deleted.

4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Expand Up @@ -24799,7 +24799,9 @@ in

hepmc2 = callPackage ../development/libraries/physics/hepmc2 { };

hepmc3 = callPackage ../development/libraries/physics/hepmc3 { };
hepmc3 = callPackage ../development/libraries/physics/hepmc3 {
python = null;
};

herwig = callPackage ../development/libraries/physics/herwig { };

Expand Down
6 changes: 4 additions & 2 deletions pkgs/top-level/python-packages.nix
Expand Up @@ -2236,6 +2236,10 @@ in {

jsonrpc-websocket = callPackage ../development/python-modules/jsonrpc-websocket { };

hepmc3 = toPythonModule (pkgs.hepmc3.override {
inherit python;
});

onkyo-eiscp = callPackage ../development/python-modules/onkyo-eiscp { };

tablib = callPackage ../development/python-modules/tablib { };
Expand Down Expand Up @@ -2327,8 +2331,6 @@ in {

pyhcl = callPackage ../development/python-modules/pyhcl { };

pyhepmc = callPackage ../development/python-modules/pyhepmc { };
jonringer marked this conversation as resolved.
Show resolved Hide resolved

pytest = if isPy3k then self.pytest_5 else self.pytest_4;

pytest_5 = callPackage ../development/python-modules/pytest {
Expand Down