nixpkgs/pkgs/applications/science/physics/xfitter/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.7 KiB
Nix
Raw Normal View History

2022-04-15 01:21:59 +00:00
{ lib
, stdenv
, fetchurl
, apfel
, apfelgrid
, applgrid
, blas
, ceres-solver
, cmake
, gfortran
, gsl
, lapack
, lhapdf
, libtirpc
, libyaml
, yaml-cpp
2022-04-15 01:21:59 +00:00
, pkg-config
, qcdnum
, root
, zlib
, memorymappingHook, memstreamHook
2020-08-15 14:20:28 +00:00
}:
2018-09-24 18:32:37 +00:00
stdenv.mkDerivation rec {
pname = "xfitter";
2022-04-15 01:21:59 +00:00
version = "2.2.0";
2018-09-24 18:32:37 +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-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 =
[ 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 ]
++ lib.optionals (stdenv.system == "x86_64-darwin") [ memorymappingHook memstreamHook ]
++ lib.optional (stdenv.hostPlatform.libc == "glibc") libtirpc
2018-09-24 18:32:37 +00:00
;
env.NIX_CFLAGS_COMPILE = lib.optional (stdenv.hostPlatform.libc == "glibc") "-I${libtirpc.dev}/include/tirpc";
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/"
'';
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;
homepage = "https://www.xfitter.org/xFitter";
2018-09-24 18:32:37 +00:00
platforms = platforms.unix;
maintainers = with maintainers; [ veprbl ];
};
}