From 17399d3824abc5b64e9a3af22784a8cf55cba507 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Thu, 28 Nov 2024 17:32:17 +0800 Subject: [PATCH 1/2] fastnlo-toolkit: nixfmt --- pkgs/by-name/fa/fastnlo-toolkit/package.nix | 32 ++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/pkgs/by-name/fa/fastnlo-toolkit/package.nix b/pkgs/by-name/fa/fastnlo-toolkit/package.nix index 820afcbd8f68..65cdc94622c6 100644 --- a/pkgs/by-name/fa/fastnlo-toolkit/package.nix +++ b/pkgs/by-name/fa/fastnlo-toolkit/package.nix @@ -1,16 +1,17 @@ -{ lib -, stdenv -, fetchurl -, boost -, gfortran -, lhapdf -, ncurses -, perl -, python ? null -, swig -, yoda -, zlib -, withPython ? false +{ + lib, + stdenv, + fetchurl, + boost, + gfortran, + lhapdf, + ncurses, + perl, + python ? null, + swig, + yoda, + zlib, + withPython ? false, }: stdenv.mkDerivation rec { @@ -33,8 +34,7 @@ stdenv.mkDerivation rec { gfortran.cc.lib lhapdf yoda - ] ++ lib.optional withPython python - ++ lib.optional (withPython && python.isPy3k) ncurses; + ] ++ lib.optional withPython python ++ lib.optional (withPython && python.isPy3k) ncurses; propagatedBuildInputs = [ zlib @@ -67,7 +67,7 @@ stdenv.mkDerivation rec { # None of our currently packaged versions of swig are C++17-friendly # Use a workaround from https://github.com/swig/swig/issues/1538 - env.CXXFLAGS="-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES"; + env.CXXFLAGS = "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES"; meta = with lib; { homepage = "http://fastnlo.hepforge.org"; From d3021e5509bdd7a6969b4f9928cc6aa5858540f1 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Thu, 28 Nov 2024 17:34:57 +0800 Subject: [PATCH 2/2] 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 65cdc94622c6..3b1a011e10ff 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 \