summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-02-27 10:21:41 +0000
committerAlyssa Ross <hi@alyssa.is>2023-03-10 12:59:04 +0000
commit1dea6175784e082ef77bcbf960fe6c43238592e3 (patch)
treedc55bb5250591bb811e3dd7bb8a3cd7ccb09e361
parentcf91b242d2b806c5d3592d415cbbb84e46df4485 (diff)
downloadnixpkgs-1dea6175784e082ef77bcbf960fe6c43238592e3.tar
nixpkgs-1dea6175784e082ef77bcbf960fe6c43238592e3.tar.gz
nixpkgs-1dea6175784e082ef77bcbf960fe6c43238592e3.tar.bz2
nixpkgs-1dea6175784e082ef77bcbf960fe6c43238592e3.tar.lz
nixpkgs-1dea6175784e082ef77bcbf960fe6c43238592e3.tar.xz
nixpkgs-1dea6175784e082ef77bcbf960fe6c43238592e3.tar.zst
nixpkgs-1dea6175784e082ef77bcbf960fe6c43238592e3.zip
python3.pkgs.hepmc3: use pythonImportsCheck
Since we only depend on pythonImportsCheckHook when building with
Python, the pythonImportsCheck attribute will just be ignored when not
building with Python support.
-rw-r--r--pkgs/development/libraries/physics/hepmc3/default.nix9
1 files changed, 3 insertions, 6 deletions
diff --git a/pkgs/development/libraries/physics/hepmc3/default.nix b/pkgs/development/libraries/physics/hepmc3/default.nix
index 027100379bc..3379e3d04d2 100644
--- a/pkgs/development/libraries/physics/hepmc3/default.nix
+++ b/pkgs/development/libraries/physics/hepmc3/default.nix
@@ -25,7 +25,8 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     cmake
-  ];
+  ]
+  ++ lib.optional withPython python.pkgs.pythonImportsCheckHook;
 
   buildInputs = [
     root_py
@@ -50,11 +51,7 @@ stdenv.mkDerivation rec {
       --replace 'readlink' '${coreutils}/bin/readlink'
   '';
 
-  doInstallCheck = withPython;
-  # prevent nix from trying to dereference a null python
-  installCheckPhase = lib.optionalString withPython ''
-    PYTHONPATH=${placeholder "out"}/${python.sitePackages} python -c 'import pyHepMC3'
-  '';
+  pythonImportsCheck = [ "pyHepMC3" ];
 
   meta = with lib; {
     description = "The HepMC package is an object oriented, C++ event record for High Energy Physics Monte Carlo generators and simulation";