2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, apfel
|
|
|
|
, apfelgrid
|
|
|
|
, applgrid
|
|
|
|
, blas
|
|
|
|
, ceres-solver
|
|
|
|
, cmake
|
|
|
|
, gfortran
|
|
|
|
, gsl
|
|
|
|
, lapack
|
|
|
|
, lhapdf
|
|
|
|
, libtirpc
|
|
|
|
, libyaml
|
2023-02-02 18:25:31 +00:00
|
|
|
, yaml-cpp
|
2022-04-27 09:35:20 +00:00
|
|
|
, pkg-config
|
|
|
|
, qcdnum
|
|
|
|
, root
|
|
|
|
, zlib
|
2021-09-18 10:52:07 +00:00
|
|
|
, memorymappingHook, memstreamHook
|
2020-10-16 20:44:37 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "xfitter";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "2.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
name = "${pname}-${version}.tgz";
|
|
|
|
url = "https://www.xfitter.org/xFitter/xFitter/DownloadPage?action=AttachFile&do=get&target=${pname}-${version}.tgz";
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-ZHIQ5hOY+k0/wmpE0o4Po+RZ4MkVMk+bK1Rc6eqwwH0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
patches = [
|
|
|
|
# Avoid need for -fallow-argument-mismatch
|
|
|
|
./0001-src-GetChisquare.f-use-correct-types-in-calls-to-DSY.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [ cmake gfortran pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs =
|
2023-02-02 18:25:31 +00:00
|
|
|
[ apfel blas ceres-solver lhapdf lapack libyaml root qcdnum gsl yaml-cpp zlib ]
|
2022-04-27 09:35:20 +00:00
|
|
|
++ lib.optionals ("5" == lib.versions.major root.version) [ apfelgrid applgrid ]
|
2021-09-18 10:52:07 +00:00
|
|
|
++ lib.optionals (stdenv.system == "x86_64-darwin") [ memorymappingHook memstreamHook ]
|
2021-05-04 21:07:42 +00:00
|
|
|
++ lib.optional (stdenv.hostPlatform.libc == "glibc") libtirpc
|
2020-04-24 23:36:52 +00:00
|
|
|
;
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "-I${libtirpc.dev}/include/tirpc";
|
2021-05-04 21:07:42 +00:00
|
|
|
NIX_LDFLAGS = lib.optional (stdenv.hostPlatform.libc == "glibc") "-ltirpc";
|
2020-10-16 20:44:37 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
# workaround wrong library IDs
|
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
|
|
|
ln -sv "$out/lib/xfitter/"* "$out/lib/"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "XFitter project is an open source QCD fit framework ready to extract PDFs and assess the impact of new data";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
homepage = "https://www.xfitter.org/xFitter";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ veprbl ];
|
|
|
|
};
|
|
|
|
}
|