mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 06:03:40 +00:00
python312Packages.fastnlo-toolkit: fix build (#359805)
This commit is contained in:
commit
b71f4a89a4
@ -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 {
|
||||
@ -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
|
||||
@ -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 \
|
||||
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user