2022-04-15 01:21:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, apfel
|
|
|
|
, apfelgrid
|
|
|
|
, applgrid
|
|
|
|
, blas
|
|
|
|
, ceres-solver
|
|
|
|
, cmake
|
|
|
|
, gfortran
|
|
|
|
, gsl
|
|
|
|
, lapack
|
|
|
|
, lhapdf
|
|
|
|
, libtirpc
|
|
|
|
, libyaml
|
2023-01-29 14:44:19 +00:00
|
|
|
, yaml-cpp
|
2022-04-15 01:21:59 +00:00
|
|
|
, pkg-config
|
|
|
|
, qcdnum
|
|
|
|
, root
|
|
|
|
, zlib
|
2021-08-24 08:32:38 +00:00
|
|
|
, memorymappingHook, memstreamHook
|
2020-08-15 14:20:28 +00:00
|
|
|
}:
|
2018-09-24 18:32:37 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "xfitter";
|
2022-04-15 01:21:59 +00:00
|
|
|
version = "2.2.0";
|
2018-09-24 18:32:37 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
name = "${pname}-${version}.tgz";
|
|
|
|
url = "https://www.xfitter.org/xFitter/xFitter/DownloadPage?action=AttachFile&do=get&target=${pname}-${version}.tgz";
|
2022-04-15 01:21:59 +00:00
|
|
|
sha256 = "sha256-ZHIQ5hOY+k0/wmpE0o4Po+RZ4MkVMk+bK1Rc6eqwwH0=";
|
2018-09-24 18:32:37 +00:00
|
|
|
};
|
|
|
|
|
2022-05-17 01:16:45 +00:00
|
|
|
patches = [
|
|
|
|
# Avoid need for -fallow-argument-mismatch
|
|
|
|
./0001-src-GetChisquare.f-use-correct-types-in-calls-to-DSY.patch
|
|
|
|
];
|
2018-09-24 18:32:37 +00:00
|
|
|
|
2022-04-15 01:21:59 +00:00
|
|
|
nativeBuildInputs = [ cmake gfortran pkg-config ];
|
2018-09-24 18:32:37 +00:00
|
|
|
buildInputs =
|
2023-01-29 14:44:19 +00:00
|
|
|
[ apfel blas ceres-solver lhapdf lapack libyaml root qcdnum gsl yaml-cpp zlib ]
|
2022-04-15 01:21:59 +00:00
|
|
|
++ lib.optionals ("5" == lib.versions.major root.version) [ apfelgrid applgrid ]
|
2021-08-24 08:32:38 +00:00
|
|
|
++ lib.optionals (stdenv.system == "x86_64-darwin") [ memorymappingHook memstreamHook ]
|
2021-05-01 17:11:28 +00:00
|
|
|
++ lib.optional (stdenv.hostPlatform.libc == "glibc") libtirpc
|
2018-09-24 18:32:37 +00:00
|
|
|
;
|
|
|
|
|
2023-02-20 15:26:44 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "-I${libtirpc.dev}/include/tirpc";
|
2021-05-01 17:11:28 +00:00
|
|
|
NIX_LDFLAGS = lib.optional (stdenv.hostPlatform.libc == "glibc") "-ltirpc";
|
2020-08-15 14:20:28 +00:00
|
|
|
|
2022-04-15 01:21:59 +00:00
|
|
|
# workaround wrong library IDs
|
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
|
|
|
ln -sv "$out/lib/xfitter/"* "$out/lib/"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-09-24 18:32:37 +00:00
|
|
|
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;
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.xfitter.org/xFitter";
|
2018-09-24 18:32:37 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ veprbl ];
|
|
|
|
};
|
|
|
|
}
|