python312Packagesfastnlo-toolkit: fix build

This commit is contained in:
wxt 2024-11-28 17:34:57 +08:00
parent 17399d3824
commit d3021e5509
No known key found for this signature in database
GPG Key ID: F62181757D8BF693

View File

@ -20,9 +20,16 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "https://fastnlo.hepforge.org/code/v25/fastnlo_toolkit-${version}.tar.gz";
sha256 = "sha256-7aIMYCOkHC/17CHYiEfrxvtSJxTDivrS7BQ32cGiEy0=";
hash = "sha256-7aIMYCOkHC/17CHYiEfrxvtSJxTDivrS7BQ32cGiEy0=";
};
postPatch = ''
substituteInPlace py-compile \
--replace-fail "import sys, os, py_compile, imp" "import sys, os, py_compile, importlib" \
--replace-fail "imp." "importlib." \
--replace-fail "hasattr(imp" "hasattr(importlib"
'';
patches = [
# Compatibility with YODA 2.x
./yoda2_support.patch
@ -36,9 +43,14 @@ stdenv.mkDerivation rec {
yoda
] ++ lib.optional withPython python ++ lib.optional (withPython && python.isPy3k) ncurses;
propagatedBuildInputs = [
zlib
] ++ lib.optional withPython swig;
propagatedBuildInputs =
[
zlib
]
++ lib.optional withPython [
swig
python.pkgs.distutils
];
preConfigure = ''
substituteInPlace ./fastnlotoolkit/Makefile.in \