1{
2 lib,
3 stdenv,
4 fetchurl,
5 boost,
6 fastjet,
7 fixDarwinDylibNames,
8 hepmc,
9 lhapdf,
10 rsync,
11 zlib,
12}:
13
14stdenv.mkDerivation rec {
15 pname = "pythia";
16 version = "8.313";
17
18 src = fetchurl {
19 url = "https://pythia.org/download/pythia83/pythia${
20 builtins.replaceStrings [ "." ] [ "" ] version
21 }.tgz";
22 sha256 = "sha256-0H6AFQHE3LdtlI3GMoU3X1l0U8HW7GXnEodgPcd2cYw=";
23 };
24
25 nativeBuildInputs = [ rsync ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ];
26 buildInputs = [
27 boost
28 fastjet
29 hepmc
30 zlib
31 lhapdf
32 ];
33
34 configureFlags =
35 [
36 "--enable-shared"
37 "--with-lhapdf6=${lhapdf}"
38 ]
39 ++ (
40 if lib.versions.major hepmc.version == "3" then
41 [
42 "--with-hepmc3=${hepmc}"
43 ]
44 else
45 [
46 "--with-hepmc2=${hepmc}"
47 ]
48 );
49
50 enableParallelBuilding = true;
51
52 meta = with lib; {
53 description = "Program for the generation of high-energy physics events";
54 mainProgram = "pythia8-config";
55 license = licenses.gpl2Only;
56 homepage = "https://pythia.org";
57 platforms = platforms.unix;
58 maintainers = with maintainers; [ veprbl ];
59 };
60}