Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python312Packages.fastnlo-toolkit: fix build #359805

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 32 additions & 20 deletions pkgs/by-name/fa/fastnlo-toolkit/package.nix
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -19,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
Expand All @@ -33,12 +41,16 @@ 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
] ++ lib.optional withPython swig;
propagatedBuildInputs =
[
zlib
]
++ lib.optional withPython [
swig
python.pkgs.distutils
];

preConfigure = ''
substituteInPlace ./fastnlotoolkit/Makefile.in \
Expand Down Expand Up @@ -67,7 +79,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";
Expand Down