Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-physics/pythia/
Date: Fri, 26 Aug 2022 11:13:20
Message-Id: 1661512380.9b1b955a2314b0d7f778c35640edcc2d44a35b8b.andrewammerlaan@gentoo
1 commit: 9b1b955a2314b0d7f778c35640edcc2d44a35b8b
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 26 11:11:07 2022 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 26 11:13:00 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b1b955a
7
8 sci-physics/pythia: add 8.3.07
9
10 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
11
12 sci-physics/pythia/Manifest | 1 +
13 sci-physics/pythia/pythia-8.3.07.ebuild | 182 ++++++++++++++++++++++++++++++++
14 2 files changed, 183 insertions(+)
15
16 diff --git a/sci-physics/pythia/Manifest b/sci-physics/pythia/Manifest
17 index b9d8657ca23c..6da91b47b53d 100644
18 --- a/sci-physics/pythia/Manifest
19 +++ b/sci-physics/pythia/Manifest
20 @@ -10,3 +10,4 @@ DIST pythia-6.4.18-examples.tar.bz2 36366 BLAKE2B ec655014d3904b66da4a1e748a37c3
21 DIST pythia-6.4.28.tar.xz 490248 BLAKE2B aff9006a4d3a0536d39a5b5161329f058b980554046a57979cc72c80067be96f00b5056dee29fc7f0039ddae074560823427c3a0e24e59f69662f08524fbdcd4 SHA512 f9db72658f2132ce08d31c8a9f7fe727466b184ef41cc4b762fe2bde48dbdfd7b5df19b21a869e20a1f107c96e9daec115c980e11592968eb2cad666b7c96bdc
22 DIST pythia6-20160413.tar.gz 567976 BLAKE2B 92ee81e41db46d49706599ee387a650f67d54a0ea165648de0d09d6cec811c2a4b22903c15cca0abaf5f34cf28333d70315a2c71f4ce0ec0bc48757c20114ae7 SHA512 2a9ea2ae299e8d49bd9750f8c68f0b7f534fb91254c2eebc60ef40828400bdf5e5c4e0956d61807e773a51db873ab4a036c3ac264f904d0bb2b85f4860e538d3
23 DIST pythia8245.tgz 23737440 BLAKE2B 74fd060229a342a32ddd33cd1911708c03e23ee0656a23ed91663fa08b35bb015f75bedba2e6ef13cfc9524affde8e8b65653596eb34f1f080781e655b85af5b SHA512 25107eb98474217ac697476143e879c62fcf5653994a2daf61cfca892f91fbaea3c274019fb4469e9ef547e87d69b8842ee28db5fdac6433965a62eeb16ef95a
24 +DIST pythia8307.tgz 26016414 BLAKE2B 0253309d71ca4e46183de80396c3a226d072ea2e8aeaf87da33994b3303017a6ca567f6731902aba43c20fec2c0aeace0728f2ce725f9221f161a70055fa6043 SHA512 63e7a3e76f8bfe0cd7b34ef523d8bbcfa50ee780c8437384ef7eb208f0f682481b0166673647db98468baeb6df855fdbf0cbb1509dcc5eda39c90f3f3461fd2a
25
26 diff --git a/sci-physics/pythia/pythia-8.3.07.ebuild b/sci-physics/pythia/pythia-8.3.07.ebuild
27 new file mode 100644
28 index 000000000000..08fe8482f92e
29 --- /dev/null
30 +++ b/sci-physics/pythia/pythia-8.3.07.ebuild
31 @@ -0,0 +1,182 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +inherit toolchain-funcs
38 +
39 +MV=$(ver_cut 1-2)
40 +MY_P="${PN}${PV//./}"
41 +LHA_VER="6.2.1"
42 +
43 +DESCRIPTION="Lund Monte Carlo high-energy physics event generator"
44 +HOMEPAGE="https://pythia8.hepforge.org/"
45 +SRC_URI="https://pythia.org/download/${PN}${MV//./}/${MY_P}.tgz
46 + test? ( lhapdf? (
47 + https://www.hepforge.org/archive/lhapdf/pdfsets/v6.backup/${LHA_VER}/CT10.tar.gz
48 + https://www.hepforge.org/archive/lhapdf/pdfsets/v6.backup/${LHA_VER}/MRST2007lomod.tar.gz
49 + https://www.hepforge.org/archive/lhapdf/pdfsets/v6.backup/${LHA_VER}/NNPDF23_nlo_as_0119_qed_mc.tar.gz
50 + https://www.hepforge.org/archive/lhapdf/pdfsets/v6.backup/${LHA_VER}/NNPDF23_nnlo_as_0119_qed_mc.tar.gz
51 + https://www.hepforge.org/archive/lhapdf/pdfsets/v6.backup/${LHA_VER}/cteq66.tar.gz
52 + https://www.hepforge.org/archive/lhapdf/pdfsets/v6.backup/${LHA_VER}/cteq6l1.tar.gz
53 + https://www.hepforge.org/archive/lhapdf/pdfsets/v6.backup/${LHA_VER}/unvalidated/MRST2004qed.tar.gz
54 + ) )"
55 +
56 +SLOT="8"
57 +LICENSE="GPL-2"
58 +KEYWORDS="~amd64"
59 +IUSE="doc examples fastjet +hepmc lhapdf root test zlib"
60 +RESTRICT="!test? ( test )"
61 +
62 +RDEPEND="
63 + fastjet? ( sci-physics/fastjet )
64 + hepmc? ( sci-physics/hepmc:3= )
65 + lhapdf? ( sci-physics/lhapdf:= )
66 + zlib? ( sys-libs/zlib )"
67 +# ROOT is used only when building related tests
68 +DEPEND="${RDEPEND}
69 + test? (
70 + root? ( sci-physics/root:= )
71 + )"
72 +
73 +PATCHES=(
74 + "${FILESDIR}"/${PN}8209-root-noninteractive.patch
75 +)
76 +
77 +S="${WORKDIR}/${MY_P}"
78 +
79 +pkg_pretend() {
80 + if use root && ! use test; then
81 + ewarn "ROOT support will only affect examples code build during test stage."
82 + ewarn "Since you have tests disabled, this is a no-op."
83 + fi
84 +}
85 +
86 +src_prepare() {
87 + PYTHIADIR="/usr/share/pythia8"
88 + EPYTHIADIR="${EPREFIX}${PYTHIADIR}"
89 +
90 + default
91 + # set datadir for xmldor in include file
92 + sed -i \
93 + -e "s|../share/Pythia8/xmldoc|${EPYTHIADIR}/xmldoc|" \
94 + include/Pythia8/Pythia.h || die
95 + # respect libdir, prefix, flags
96 + sed -i \
97 + -e "s|/lib|/$(get_libdir)|g" \
98 + -e "s|/usr|${EPREFIX}/usr|g" \
99 + -e "s|-O2|${CXXFLAGS}|g" \
100 + -e "s|Cint|Core|g" \
101 + configure || die
102 + sed -i 's|$(CXX) $^ -o $@ $(CXX_COMMON) $(CXX_SHARED)|$(CXX) $(LDFLAGS) $^ -o $@ $(CXX_COMMON) $(CXX_SHARED)|g' \
103 + Makefile || die
104 + sed -i 's|$(CXX)|$(CXX) $(LDFLAGS)|' examples/Makefile || die
105 + # we use lhapdf6 instead of lhapdf5
106 + # some PDFs changed, use something similar
107 + sed -i \
108 + -e "s|LHAPDF5|LHAPDF6|g" \
109 + -e "s|\.LHgrid||g" \
110 + -e "s|\.LHpdf||g" \
111 + -e "s|MRST2001lo|MRST2007lomod|g" \
112 + -e "s|cteq6ll|cteq6l1|g" \
113 + -e "s|cteq6m|cteq66|g" \
114 + examples/*.{cc,cmnd} || die
115 + # After lhapdf5->6 migration PDFs are identical within ~1/1000
116 + # https|//www.hepforge.org/archive/lhapdf/pdfsets/6.1/README
117 + sed -i \
118 + -e "s|1e-8|3e-1|g" \
119 + -e "s|nlo_as_0119_qed|nlo_as_0119_qed_mc|g" \
120 + -e "s|xmldoc|share/Pythia8/xmldoc|g" \
121 + examples/main54.cc || die
122 + # ask cflags from root
123 + sed -i "s|root-config|root-config --cflags|g" examples/Makefile || die
124 +
125 + sed -i 's|libpythia8\.a|libpythia8$(LIB_SUFFIX)|g' \
126 + examples/Makefile || die
127 +}
128 +
129 +# TODO: the following optional packages are out of Gentoo tree:
130 +# - EvtGen http://atlas-computing.web.cern.ch/atlas-computing/links/externalDirectory/EvtGen/
131 +# - PowHEG http://powhegbox.mib.infn.it/
132 +# - ProMC https://github.com/Argonne-National-Laboratory/ProMC/
133 +src_configure() {
134 + # homemade configure script
135 + ./configure \
136 + --arch=Linux \
137 + --cxx="$(tc-getCXX)" \
138 + --prefix="${EPREFIX}/usr" \
139 + --prefix-lib="$(get_libdir)" \
140 + --prefix-share="${EPYTHIADIR}" \
141 + $(usex fastjet "--with-fastjet3" "") \
142 + $(usex zlib "--with-gzip" "") \
143 + $(usex hepmc "--with-hepmc3" "") \
144 + $(usex lhapdf "--with-lhapdf6
145 + --with-lhapdf6-plugin=LHAPDF6.h
146 + --with-lhapdf6-lib=${EPREFIX}/usr/$(get_libdir)" "") \
147 + $(usex root "--with-root
148 + --with-root-include=${EPREFIX}/usr/include/root
149 + --with-root-lib=${EPREFIX}/usr/$(get_libdir)/root" "") \
150 + || die
151 +
152 + # fix pythia config script
153 + sed -i \
154 + -e 's|pythia8/examples/Makefile.inc|pythia8/Makefile.inc|' \
155 + -e 's|LINE%=|LINE%%=|' \
156 + bin/pythia8-config || die
157 +}
158 +
159 +src_test() {
160 + cd examples || die
161 +
162 + local tests="$(echo main{{01..32},37,38,61,62,73,80}.out)"
163 + use hepmc && tests+=" $(echo main{41,42,85,86}.out)"
164 + use hepmc && use lhapdf && tests+=" $(echo main{43,{87..89}}.out)"
165 + use lhapdf && tests+=" $(echo main{51..54}.out)"
166 + use fastjet && tests+=" $(echo main{71,72}.out)"
167 + use fastjet && use hepmc && use lhapdf && tests+=" $(echo main{81..84}).out"
168 + use root && tests+=" main91.out"
169 + # Disabled tests:
170 + # 33 needs PowHEG
171 + # 46 needs ProMC
172 + # 48 needs EvtGen
173 + # 92 generated ROOT dictionary is badly broken
174 +
175 + # use emake for parallel instead of long runmains
176 + LD_LIBRARY_PATH="${S}/$(get_libdir):${LD_LIBRARY_PATH}" \
177 + PYTHIA8DATA="../share/Pythia8/xmldoc/" \
178 + LHAPDF_DATA_PATH="${WORKDIR}" \
179 + emake ${tests}
180 + emake clean
181 +}
182 +
183 +src_install() {
184 + # make install is too broken, much easier to install manually
185 + dobin bin/pythia8-config
186 + doheader -r include/*
187 + dolib.so lib/libpythia8.so
188 + insinto "${PYTHIADIR}"
189 + doins -r share/Pythia8/xmldoc examples/Makefile.inc
190 +
191 + newenvd - 99pythia8 <<- _EOF_
192 + PYTHIA8DATA=${EPYTHIADIR}/xmldoc
193 + _EOF_
194 +
195 + dodoc AUTHORS GUIDELINES README
196 + if use doc; then
197 + dodoc -r share/Pythia8/pdfdoc/.
198 + dodoc -r share/Pythia8/htmldoc/.
199 + fi
200 + if use examples; then
201 + # reuse system Makefile.inc
202 + rm examples/Makefile.inc || die
203 + sed -i "s|include Makefile.inc|include ${EPYTHIADIR}|" \
204 + examples/Makefile || die
205 +
206 + insinto /usr/share/${PN}
207 + doins -r examples
208 + docompress -x /usr/share/doc/${PF}/examples
209 + fi
210 +
211 + # cleanup
212 + unset PYTHIADIR EPYTHIADIR
213 +}