From db6d91c9f523461a2830db6b20caa104940c05d5 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Thu, 28 Nov 2024 17:34:57 +0800 Subject: [PATCH] python312Packagesfastnlo-toolkit: fix build --- pkgs/by-name/fa/fastnlo-toolkit/package.nix | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/fa/fastnlo-toolkit/package.nix b/pkgs/by-name/fa/fastnlo-toolkit/package.nix index 65cdc94622c6e..739492926750e 100644 --- a/pkgs/by-name/fa/fastnlo-toolkit/package.nix +++ b/pkgs/by-name/fa/fastnlo-toolkit/package.nix @@ -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 \