2018-11-05 03:12:55 +01:00
|
|
|
{ stdenv, fetchurl, apfel, apfelgrid, applgrid, blas, gfortran, lhapdf, liblapack, libyaml, lynx, mela, root5, qcdnum, which }:
|
2018-09-24 20:32:37 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "xfitter";
|
2018-09-24 20:32:37 +02:00
|
|
|
version = "2.0.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
name = "${pname}-${version}.tgz";
|
|
|
|
url = "https://www.xfitter.org/xFitter/xFitter/DownloadPage?action=AttachFile&do=get&target=${pname}-${version}.tgz";
|
2018-09-24 20:32:37 +02:00
|
|
|
sha256 = "0j47s8laq3aqjlgp769yicvgyzqjb738a3rqss51d9fjrihi2515";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2018-10-08 16:59:17 +02:00
|
|
|
./undefined_behavior.patch
|
2018-09-24 20:32:37 +02:00
|
|
|
];
|
|
|
|
|
2018-10-08 16:59:17 +02:00
|
|
|
CXXFLAGS = "-Werror=return-type";
|
|
|
|
|
2018-09-24 20:32:37 +02:00
|
|
|
preConfigure =
|
|
|
|
# Fix F77LD to workaround for a following build error:
|
|
|
|
#
|
|
|
|
# gfortran: error: unrecognized command line option '-stdlib=libc++'
|
|
|
|
#
|
|
|
|
stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace src/Makefile.in \
|
|
|
|
--replace "F77LD = \$(F77)" "F77LD = \$(CXXLD)" \
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-apfel"
|
|
|
|
"--enable-apfelgrid"
|
|
|
|
"--enable-applgrid"
|
|
|
|
"--enable-mela"
|
|
|
|
"--enable-lhapdf"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ gfortran which ];
|
|
|
|
buildInputs =
|
2018-11-05 03:12:55 +01:00
|
|
|
[ apfel apfelgrid applgrid blas lhapdf liblapack mela root5 qcdnum ]
|
2018-09-24 20:32:37 +02:00
|
|
|
# pdf2yaml requires fmemopen and open_memstream which are not readily available on Darwin
|
|
|
|
++ stdenv.lib.optional (!stdenv.isDarwin) libyaml
|
|
|
|
;
|
|
|
|
propagatedBuildInputs = [ lynx ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "The xFitter project is an open source QCD fit framework ready to extract PDFs and assess the impact of new data";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
homepage = https://www.xfitter.org/xFitter;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ veprbl ];
|
|
|
|
};
|
|
|
|
}
|