From 1dea6175784e082ef77bcbf960fe6c43238592e3 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 27 Feb 2023 10:21:41 +0000 Subject: 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. --- pkgs/development/libraries/physics/hepmc3/default.nix | 9 +++------ 1 file 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"; -- cgit 1.4.1