nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, fetchurl, gfortran, hoppet, lhapdf, root5 }:
2
3stdenv.mkDerivation rec {
4 name = "applgrid-${version}";
5 version = "1.4.70";
6
7 src = fetchurl {
8 url = "https://www.hepforge.org/archive/applgrid/${name}.tgz";
9 sha256 = "1yw9wrk3vjv84kd3j4s1scfhinirknwk6xq0hvj7x2srx3h93q9p";
10 };
11
12 buildInputs = [ gfortran hoppet lhapdf root5 ];
13
14 patches = [
15 ./bad_code.patch
16 ];
17
18 preConfigure = ''
19 substituteInPlace src/Makefile.in \
20 --replace "-L\$(subst /libgfortran.a, ,\$(FRTLIB) )" "-L${gfortran.cc.lib}/lib"
21 '' + (if stdenv.isDarwin then ''
22 substituteInPlace src/Makefile.in \
23 --replace "gfortran -print-file-name=libgfortran.a" "gfortran -print-file-name=libgfortran.dylib"
24 '' else "");
25
26 enableParallelBuilding = false; # broken
27
28 # Install private headers required by APFELgrid
29 postInstall = ''
30 for header in src/*.h; do
31 install -Dm644 "$header" "$out"/include/appl_grid/"`basename $header`"
32 done
33 '';
34
35 meta = with stdenv.lib; {
36 description = "The APPLgrid project provides a fast and flexible way to reproduce the results of full NLO calculations with any input parton distribution set in only a few milliseconds rather than the weeks normally required to gain adequate statistics";
37 license = licenses.gpl3;
38 homepage = http://applgrid.hepforge.org;
39 platforms = platforms.unix;
40 maintainers = with maintainers; [ veprbl ];
41 };
42}