From c74abf990d32765245eeb94b36ad4af642cae8c0 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 17 Aug 2023 15:32:39 +0100 Subject: gentoo auto-resync : 17:08:2023 - 15:32:39 --- sci-physics/Manifest.gz | Bin 4208 -> 4206 bytes sci-physics/pythia/Manifest | 13 +- sci-physics/pythia/metadata.xml | 5 + sci-physics/pythia/pythia-6.4.28-r2.ebuild | 15 ++- sci-physics/pythia/pythia-8.2.45-r2.ebuild | 6 +- sci-physics/pythia/pythia-8.3.09.ebuild | 188 +++++++++++++++++++++++++++ sci-physics/pythia/pythia-9999.ebuild | 196 +++++++++++++++++++++++++++++ 7 files changed, 413 insertions(+), 10 deletions(-) create mode 100644 sci-physics/pythia/pythia-8.3.09.ebuild create mode 100644 sci-physics/pythia/pythia-9999.ebuild (limited to 'sci-physics') diff --git a/sci-physics/Manifest.gz b/sci-physics/Manifest.gz index e3322bf0d484..b7955bc595ec 100644 Binary files a/sci-physics/Manifest.gz and b/sci-physics/Manifest.gz differ diff --git a/sci-physics/pythia/Manifest b/sci-physics/pythia/Manifest index f776e7ff7fcc..7e27ae4af1ad 100644 --- a/sci-physics/pythia/Manifest +++ b/sci-physics/pythia/Manifest @@ -9,11 +9,14 @@ DIST cteq66.tar.gz 8647237 BLAKE2B 3ac47b6eee434f89ff329cfcb8268782af4ffa552ca4b DIST cteq6l1.tar.gz 317834 BLAKE2B eccad131853f9a760d0dfd43a3f8705f8edbac3ec7373de9ef9a8936f13ba06500ba5758cd04649dd1b85ac04fc778e9d96222877e74e9ff02263455b233fa41 SHA512 7177608e97077eaf45a292db4ea74eb9a28b4b500ab8be02098b4837a5583cd397828abc3bf43ead448926eaa75ae3968bd059ecde333d90ed6e4295cbe1873c DIST lutp0613man2.pdf 2902047 BLAKE2B c2f8e8f9031c843933cd927b32921813b580a1811733279d67ece7d1181a47225bc37e5a3de57b48ec353db46362fb313c986edde00efb5268f1fc86200e32f5 SHA512 a8439b3b150b6f3924d4d3671a4fad6a815c374b1f46060072ca6c1faa797a2f73f8727920aaa7ae885c4f6f135c8d8f94d43e518cfe25271bb95652112def58 DIST pythia-6.4.18-examples.tar.bz2 36366 BLAKE2B ec655014d3904b66da4a1e748a37c366c2adf9e914b9abf8c38968dcbc09129badcccd2705bc9437c05e73ee4489807835383546f55fbc9cd65399fb507e704e SHA512 ba921379a6df4ca417b60ea5b78af506f13135cdf896fa6beeca9713428ad6f298c94c0fe65fca3e583f8f268dcf84ebe4f1f81b46fd865d5f641f7c1e9fa7e1 -DIST pythia-6.4.28.tar.xz 490248 BLAKE2B aff9006a4d3a0536d39a5b5161329f058b980554046a57979cc72c80067be96f00b5056dee29fc7f0039ddae074560823427c3a0e24e59f69662f08524fbdcd4 SHA512 f9db72658f2132ce08d31c8a9f7fe727466b184ef41cc4b762fe2bde48dbdfd7b5df19b21a869e20a1f107c96e9daec115c980e11592968eb2cad666b7c96bdc DIST pythia6-20160413.tar.gz 567976 BLAKE2B 92ee81e41db46d49706599ee387a650f67d54a0ea165648de0d09d6cec811c2a4b22903c15cca0abaf5f34cf28333d70315a2c71f4ce0ec0bc48757c20114ae7 SHA512 2a9ea2ae299e8d49bd9750f8c68f0b7f534fb91254c2eebc60ef40828400bdf5e5c4e0956d61807e773a51db873ab4a036c3ac264f904d0bb2b85f4860e538d3 -DIST pythia8245.tgz 23737440 BLAKE2B 74fd060229a342a32ddd33cd1911708c03e23ee0656a23ed91663fa08b35bb015f75bedba2e6ef13cfc9524affde8e8b65653596eb34f1f080781e655b85af5b SHA512 25107eb98474217ac697476143e879c62fcf5653994a2daf61cfca892f91fbaea3c274019fb4469e9ef547e87d69b8842ee28db5fdac6433965a62eeb16ef95a +DIST pythia6428-split.tgz 689807 BLAKE2B 5acb53a75db22509e3def7d0a2fa31672e50f8db6ce64052ba0b68869c706c44e810f288f08fbbba3ef5a0c78c937556a290651f172bdec4158702fc1a76a7ac SHA512 48c08f0212b8cd7847f19d381ff4412acc3eb72fc99ed3254bff770faec500f113367e8cb37740486bd18678d6862433653b549059d0545374d069d551d4b506 +DIST pythia8245.tgz 23605527 BLAKE2B 1007c2f8b50a115d29fe1b0363a187feca717cb2147ef759e999aeaf51ac457e9edbbdc78be47ed57d008e572b99fb327823249b31596241ee72ff587b81c8f1 SHA512 1cc579581475bfe2381059cc4789069041fa63649c86353f65cc2baa12c85142fb6c087e1607c2004b6284a21cada30a172da9853a71afa01c787272a7534574 DIST pythia8307.tgz 26016414 BLAKE2B 0253309d71ca4e46183de80396c3a226d072ea2e8aeaf87da33994b3303017a6ca567f6731902aba43c20fec2c0aeace0728f2ce725f9221f161a70055fa6043 SHA512 63e7a3e76f8bfe0cd7b34ef523d8bbcfa50ee780c8437384ef7eb208f0f682481b0166673647db98468baeb6df855fdbf0cbb1509dcc5eda39c90f3f3461fd2a -EBUILD pythia-6.4.28-r2.ebuild 2016 BLAKE2B 1fe9d2e29b8ed794a84fc8f7cfb070e22b49cd97df6116d70d3a17ba3a8e09633435e4474a2d0499825ef6e8cf415404d92eef8041969a2a35036c73d09c484f SHA512 0dc8ffc1166af84cedeecba440e4b242fe454909bb95789c32a562b4871ffc1bc82c39daf1286c518bed2c1d4fde55063944581348c8db008f83714e6262c591 -EBUILD pythia-8.2.45-r2.ebuild 5738 BLAKE2B a4e94f9c23ce66ee9b0f9704a001fa5ba2b9f46e393ae24c9869acf9e87ec06027e9d7b6cc6e844fdcd7d285ead16c37226dadf927a21015b4b23308f9b885c1 SHA512 84a5a2824a5d0b0f9ffc21894af521d0cc1cc88f99669f81a35fb63afaede9b552ab2e88a878763211f3f9f81702b03ee7c861724da37949e01497cd28de7e36 +DIST pythia8309.tgz 28407620 BLAKE2B 0ef226e2e65829952d670b57c24bff2108d916ca547233041e97dabb81d9616be3e404da7225f9cb4a2c9773c0c22939d813eaed92560e01c6fbe37e4690c232 SHA512 c7d99a9a1f7bf1441532720667ab224283b866e7f3ea9e730c839ac62e3b8b9e5c01471fb94a4a48d481635544e4ed230796a710531650bfffde96f0f78590bf +EBUILD pythia-6.4.28-r2.ebuild 2226 BLAKE2B 989fb48c476d334a3af1fec6eeb4ea90fa454a1fb4db173d1dda7c544e61cb72bb48945c79051e2971a663c767469fa84385413bb15cd548aa7320802ec73dad SHA512 14d7e3d2e8f9b4c7ee9f472bc80124bdf50005b0bf973765edb9da3b07014255049089b13bdaa8b3b58c64ffba707cbf16fbfd6d491849dc0153d0001562c8c9 +EBUILD pythia-8.2.45-r2.ebuild 5745 BLAKE2B 6ad238f95ad2e8d49f087ac56651341737f11243487ae1030667c9a5a3c12d7a7e2f32ae44286d44251504d2c46c2ec57940881888403b292c70ad5d0a2141f8 SHA512 4d1a81b53ae800ae014f6d1da9256c49878dedc98315d6808c1a2d43062d018f976e925c165c70431bd172a2353514a2db56f0455f86cb0ba92b65e51fe0fb8c EBUILD pythia-8.3.07-r1.ebuild 5639 BLAKE2B 40557ea473da0614030ce8c727533ee6a0a02292331b053fd33dac4e6b40cddbbc26183990b2d2f5ac37c170e322b78cc0fa0d02e64814e62c39e934f51f90bc SHA512 12fa4c13fffed492ebefd9b17300202d9ea6f59b3a9c0a5ec0eca9ccb2b1a63c53cfd8dbae1e04b68239850711ea564e7225cea2c229fb6c8014276fa018f585 -MISC metadata.xml 1301 BLAKE2B 0bc55c98b16d7c36f2fe63742dff66385fb077ad561ba020d188e03b8ef13236ef074d7461ac018ef9645b315cab9eb4d631a978021273250c859b4ff82e9542 SHA512 40182189f55d31d2b88ae7b61f3d4f447ecec0cc76d523fef11e40346a7ddae872948150084d803c7326501c5a29c4b9a8442018eb52d5657e3c19abb7f22d7e +EBUILD pythia-8.3.09.ebuild 5646 BLAKE2B 6199b3ed46b1a11bfc5b2fb1e43d5b39a827b4675ad132b6b3411e668624bea744010a6437f0580e8f0c12fb340e8eba1062e64b0490918f77f5cbd3fe9867e8 SHA512 0863cd49173f49407cdd536f7cd1500f24512a638ef002f105f67db08db1d41209ced3eb7cc961e7b2da25d1094869c2b7aa52e75c09bff498a0dd7eaa5a0e9f +EBUILD pythia-9999.ebuild 5788 BLAKE2B 4a69b1ae8196e325f4583eac4745caf7d2636f20a3f1539c6451195798f84f1843d31f63579cfcede0463640ca845ae5478f4a52c7fde117571ef14ea367b572 SHA512 5aa00a8ff91e9207fe347a96b729f595fb129ecb3a5b2b5ebeb3c1028e9a107902efc8f10f672efca1a7bcc4529a1f6e6f4bf9264b5aa2eb1b487222f973e11f +MISC metadata.xml 1630 BLAKE2B 23311f637bde6058acc3d5840a92e101038e514c49d3a0600a7f3d484d8305e737d12e0540679ecf91aaf02168bd9e12daf90b4571db5223ad77a0ba61c3b119 SHA512 a9f8e67ee203233540316338cb63c1d37b6cb7f75b3750cfd949550ea7ce91af96bb6490cba23550a27d9a85f348b90cdaed03f320cfe1b56fc2e2b55925ddcf diff --git a/sci-physics/pythia/metadata.xml b/sci-physics/pythia/metadata.xml index 6d4b2f695ab6..fb8f9f855f2b 100644 --- a/sci-physics/pythia/metadata.xml +++ b/sci-physics/pythia/metadata.xml @@ -19,7 +19,12 @@ Build jets using the sci-physics/fastjet package Adds support for High Energy Physics Monte Carlo Generators sci-physics/hepmc + Adds support for High Energy Physics Monte Carlo Generators 2 sci-physics/hepmc + Adds support for High Energy Physics Monte Carlo Generators 3 sci-physics/hepmc Support the use of external PDF sets via sci-physics/lhapdf Use sci-physics/root trees and histograms (in examples only) + + Pythia8/releases + diff --git a/sci-physics/pythia/pythia-6.4.28-r2.ebuild b/sci-physics/pythia/pythia-6.4.28-r2.ebuild index 9d17582d521d..01ffdc71dd71 100644 --- a/sci-physics/pythia/pythia-6.4.28-r2.ebuild +++ b/sci-physics/pythia/pythia-6.4.28-r2.ebuild @@ -9,6 +9,7 @@ MV=$(ver_cut 1) MY_PN=${PN}${MV} DOC_PV=0613 EX_PV=6.4.18 +MY_PV=${PV//./} PYR_P=pythia6-20160413 DESCRIPTION="Lund Monte Carlo high-energy physics event generator" @@ -18,10 +19,11 @@ HOMEPAGE="http://pythia6.hepforge.org/" # To produce a split version, replace the 6.4.x by the current version: # svn export http://svn.hepforge.org/pythia6/tags/v_6_4_x/ pythia-6.4.x # tar cJf pythia-6.4.x.tar.xz + SRC_URI=" - https://dev.gentoo.org/~bicatali/distfiles/${P}.tar.xz + https://pythia.org/download/pythia6/pythia${MY_PV}-split.tgz https://root.cern.ch/download/pythia6.tar.gz -> ${PYR_P}.tar.gz - doc? ( http://home.thep.lu.se/~torbjorn/pythia/lutp${DOC_PV}man2.pdf ) + doc? ( https://pythia.org/download/pythia6/lutp${DOC_PV}man2.pdf ) examples? ( mirror://gentoo/${PN}-${EX_PV}-examples.tar.bz2 )" SLOT="6" @@ -31,6 +33,15 @@ IUSE="doc examples" PATCHES=( "${FILESDIR}"/${P}-fno-common.patch ) +# workaround to official pythia-split not having a pythia subdir +src_unpack() { + mkdir -p "${S}" || die + cd "${S}" || die + unpack pythia${MY_PV}-split.tgz + cd "${WORKDIR}" || die + default +} + src_prepare() { cp ../pythia6/tpythia6_called_from_cc.F . cp ../pythia6/pythia6_common_address.c . diff --git a/sci-physics/pythia/pythia-8.2.45-r2.ebuild b/sci-physics/pythia/pythia-8.2.45-r2.ebuild index a660f6924c7d..4d9890579f3d 100644 --- a/sci-physics/pythia/pythia-8.2.45-r2.ebuild +++ b/sci-physics/pythia/pythia-8.2.45-r2.ebuild @@ -1,17 +1,17 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 inherit toolchain-funcs -MV=$(ver_cut 1) +MV=$(ver_cut 1)$(ver_cut 2) MY_P="${PN}${PV//./}" LHA_VER="6.1" DESCRIPTION="Lund Monte Carlo high-energy physics event generator" HOMEPAGE="https://pythia.org/" -SRC_URI="http://home.thep.lu.se/~torbjorn/${PN}${MV}/${MY_P}.tgz +SRC_URI="https://pythia.org/download/${PN}${MV}/${MY_P}.tgz test? ( lhapdf? ( https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/CT10.tar.gz https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/MRST2007lomod.tar.gz diff --git a/sci-physics/pythia/pythia-8.3.09.ebuild b/sci-physics/pythia/pythia-8.3.09.ebuild new file mode 100644 index 000000000000..251f96ebbcd6 --- /dev/null +++ b/sci-physics/pythia/pythia-8.3.09.ebuild @@ -0,0 +1,188 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +MV=$(ver_cut 1-2) +MY_P="${PN}${PV//./}" +LHA_VER="6.2.1" + +DESCRIPTION="Lund Monte Carlo high-energy physics event generator" +HOMEPAGE="https://pythia.org/" +SRC_URI="https://pythia.org/download/${PN}${MV//./}/${MY_P}.tgz + test? ( lhapdf? ( + https://lhapdfsets.web.cern.ch/lhapdfsets/current/CT10.tar.gz + https://lhapdfsets.web.cern.ch/lhapdfsets/current/MRST2007lomod.tar.gz + https://lhapdfsets.web.cern.ch/lhapdfsets/current/NNPDF23_nlo_as_0119_qed_mc.tar.gz + https://lhapdfsets.web.cern.ch/lhapdfsets/current/NNPDF23_nnlo_as_0119_qed_mc.tar.gz + https://lhapdfsets.web.cern.ch/lhapdfsets/current/cteq66.tar.gz + https://lhapdfsets.web.cern.ch/lhapdfsets/current/cteq6l1.tar.gz + https://www.hepforge.org/downloads/lhapdf/pdfsets/v6.backup/${LHA_VER}/MRST2004qed.tar.gz + ) )" + +SLOT="8" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~x86" +IUSE="doc examples fastjet +hepmc3 hepmc2 lhapdf root test zlib" +RESTRICT="!test? ( test )" +REQUIRED_USE=" + ?? ( hepmc3 hepmc2 ) +" + +RDEPEND=" + fastjet? ( sci-physics/fastjet ) + hepmc3? ( sci-physics/hepmc:3= ) + hepmc2? ( sci-physics/hepmc:2= ) + lhapdf? ( sci-physics/lhapdf:= ) + zlib? ( sys-libs/zlib )" +# ROOT is used only when building related tests +DEPEND="${RDEPEND} + test? ( + root? ( sci-physics/root:= ) + )" + +PATCHES=( + "${FILESDIR}"/${PN}8209-root-noninteractive.patch +) + +S="${WORKDIR}/${MY_P}" + +pkg_pretend() { + if use root && ! use test; then + ewarn "ROOT support will only affect examples code build during test stage." + ewarn "Since you have tests disabled, this is a no-op." + fi +} + +src_prepare() { + PYTHIADIR="/usr/share/Pythia8" + EPYTHIADIR="${EPREFIX}${PYTHIADIR}" + + default + # set datadir for xmldor in include file + sed -i \ + -e "s|../share/Pythia8/xmldoc|${EPYTHIADIR}/xmldoc|" \ + include/Pythia8/Pythia.h || die + # respect libdir, prefix, flags + sed -i \ + -e "s|/lib|/$(get_libdir)|g" \ + -e "s|/usr|${EPREFIX}/usr|g" \ + -e "s|-O2|${CXXFLAGS}|g" \ + -e "s|Cint|Core|g" \ + configure || die + sed -i 's|$(CXX) $^ -o $@ $(CXX_COMMON) $(CXX_SHARED)|$(CXX) $(LDFLAGS) $^ -o $@ $(CXX_COMMON) $(CXX_SHARED)|g' \ + Makefile || die + sed -i 's|$(CXX)|$(CXX) $(LDFLAGS)|' examples/Makefile || die + # we use lhapdf6 instead of lhapdf5 + # some PDFs changed, use something similar + sed -i \ + -e "s|LHAPDF5|LHAPDF6|g" \ + -e "s|\.LHgrid||g" \ + -e "s|\.LHpdf||g" \ + -e "s|MRST2001lo|MRST2007lomod|g" \ + -e "s|cteq6ll|cteq6l1|g" \ + -e "s|cteq6m|cteq66|g" \ + examples/*.{cc,cmnd} || die + # After lhapdf5->6 migration PDFs are identical within ~1/1000 + # https|//www.hepforge.org/archive/lhapdf/pdfsets/6.1/README + sed -i \ + -e "s|1e-8|3e-1|g" \ + -e "s|nlo_as_0119_qed|nlo_as_0119_qed_mc|g" \ + -e "s|xmldoc|share/Pythia8/xmldoc|g" \ + examples/main54.cc || die + # ask cflags from root + sed -i "s|root-config|root-config --cflags|g" examples/Makefile || die + + sed -i 's|libpythia8\.a|libpythia8$(LIB_SUFFIX)|g' \ + examples/Makefile || die +} + +# TODO: the following optional packages are out of Gentoo tree: +# - EvtGen http://atlas-computing.web.cern.ch/atlas-computing/links/externalDirectory/EvtGen/ +# - PowHEG http://powhegbox.mib.infn.it/ +# - ProMC https://github.com/Argonne-National-Laboratory/ProMC/ +src_configure() { + # homemade configure script + ./configure \ + --arch=Linux \ + --cxx="$(tc-getCXX)" \ + --prefix="${EPREFIX}/usr" \ + --prefix-lib="${EPREFIX}/usr/$(get_libdir)" \ + --prefix-share="${EPYTHIADIR}" \ + $(usex fastjet "--with-fastjet3" "") \ + $(usex zlib "--with-gzip" "") \ + $(use_with hepmc3) \ + $(use_with hepmc2) \ + $(usex lhapdf "--with-lhapdf6 + --with-lhapdf6-plugin=LHAPDF6.h + --with-lhapdf6-lib=${EPREFIX}/usr/$(get_libdir)" "") \ + $(usex root "--with-root + --with-root-include=${EPREFIX}/usr/include/root + --with-root-lib=${EPREFIX}/usr/$(get_libdir)/root" "") \ + || die + + # fix pythia config script + sed -i \ + -e 's|Pythia8/examples/Makefile.inc|Pythia8/Makefile.inc|' \ + -e 's|LINE%=|LINE%%=|' \ + bin/pythia8-config || die +} + +src_test() { + cd examples || die + + local tests="$(echo main{{01..32},37,38,61,62,73,80}.out)" + use hepmc3 && tests+=" $(echo main{41,42,85,86}.out)" + use hepmc3 && use lhapdf && tests+=" $(echo main{43,{87..89}}.out)" + use lhapdf && tests+=" $(echo main{51..54}.out)" + use fastjet && tests+=" $(echo main{71,72}.out)" + use fastjet && use hepmc3 && use lhapdf && tests+=" $(echo main{81..84}).out" + use root && tests+=" main91.out" + # Disabled tests: + # 33 needs PowHEG + # 46 needs ProMC + # 48 needs EvtGen + # 92 generated ROOT dictionary is badly broken + + # use emake for parallel instead of long runmains + LD_LIBRARY_PATH="${S}/$(get_libdir):${LD_LIBRARY_PATH}" \ + PYTHIA8DATA="../share/Pythia8/xmldoc/" \ + LHAPDF_DATA_PATH="${WORKDIR}" \ + emake ${tests} + emake clean +} + +src_install() { + # make install is too broken, much easier to install manually + dobin bin/pythia8-config + doheader -r include/* + dolib.so lib/libpythia8.so + use lhapdf && dolib.so lib/libpythia8lhapdf6.so + insinto "${PYTHIADIR}" + doins -r share/Pythia8/xmldoc share/Pythia8/pdfdata examples/Makefile.inc + + newenvd - 99pythia8 <<- _EOF_ + PYTHIA8DATA=${EPYTHIADIR}/xmldoc + _EOF_ + + dodoc AUTHORS GUIDELINES README + if use doc; then + dodoc -r share/Pythia8/pdfdoc/. + dodoc -r share/Pythia8/htmldoc/. + fi + if use examples; then + # reuse system Makefile.inc + rm examples/Makefile.inc || die + sed -i "s|include Makefile.inc|include ${EPYTHIADIR}|" \ + examples/Makefile || die + + insinto /usr/share/${PN} + doins -r examples + docompress -x /usr/share/doc/${PF}/examples + fi + + # cleanup + unset PYTHIADIR EPYTHIADIR +} diff --git a/sci-physics/pythia/pythia-9999.ebuild b/sci-physics/pythia/pythia-9999.ebuild new file mode 100644 index 000000000000..fa0f3f011561 --- /dev/null +++ b/sci-physics/pythia/pythia-9999.ebuild @@ -0,0 +1,196 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +MV=$(ver_cut 1-2) +MY_P="${PN}${PV//./}" +LHA_VER="6.2.1" + +DESCRIPTION="Lund Monte Carlo high-energy physics event generator" +HOMEPAGE="https://pythia.org/" + +# just data +SRC_URI="test? ( lhapdf? ( + https://lhapdfsets.web.cern.ch/lhapdfsets/current/CT10.tar.gz + https://lhapdfsets.web.cern.ch/lhapdfsets/current/MRST2007lomod.tar.gz + https://lhapdfsets.web.cern.ch/lhapdfsets/current/NNPDF23_nlo_as_0119_qed_mc.tar.gz + https://lhapdfsets.web.cern.ch/lhapdfsets/current/NNPDF23_nnlo_as_0119_qed_mc.tar.gz + https://lhapdfsets.web.cern.ch/lhapdfsets/current/cteq66.tar.gz + https://lhapdfsets.web.cern.ch/lhapdfsets/current/cteq6l1.tar.gz + https://www.hepforge.org/downloads/lhapdf/pdfsets/v6.backup/${LHA_VER}/MRST2004qed.tar.gz + ) )" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.com/Pythia8/releases" +else + SRC_URI="https://pythia.org/download/${PN}${MV//./}/${MY_P}.tgz + $SRC_URI" + KEYWORDS="~amd64 ~x86" + S="${WORKDIR}/${MY_P}" +fi + +SLOT="8" +LICENSE="GPL-2" +IUSE="doc examples fastjet +hepmc3 hepmc2 lhapdf root test zlib" +RESTRICT="!test? ( test )" +REQUIRED_USE=" + ?? ( hepmc3 hepmc2 ) +" + +RDEPEND=" + fastjet? ( sci-physics/fastjet ) + hepmc3? ( sci-physics/hepmc:3= ) + hepmc2? ( sci-physics/hepmc:2= ) + lhapdf? ( sci-physics/lhapdf:= ) + zlib? ( sys-libs/zlib )" +# ROOT is used only when building related tests +DEPEND="${RDEPEND} + test? ( + root? ( sci-physics/root:= ) + )" + +PATCHES=( + "${FILESDIR}"/${PN}8209-root-noninteractive.patch +) + +pkg_pretend() { + if use root && ! use test; then + ewarn "ROOT support will only affect examples code build during test stage." + ewarn "Since you have tests disabled, this is a no-op." + fi +} + +src_prepare() { + PYTHIADIR="/usr/share/Pythia8" + EPYTHIADIR="${EPREFIX}${PYTHIADIR}" + + default + # set datadir for xmldor in include file + sed -i \ + -e "s|../share/Pythia8/xmldoc|${EPYTHIADIR}/xmldoc|" \ + include/Pythia8/Pythia.h || die + # respect libdir, prefix, flags + sed -i \ + -e "s|/lib|/$(get_libdir)|g" \ + -e "s|/usr|${EPREFIX}/usr|g" \ + -e "s|-O2|${CXXFLAGS}|g" \ + -e "s|Cint|Core|g" \ + configure || die + sed -i 's|$(CXX) $^ -o $@ $(CXX_COMMON) $(CXX_SHARED)|$(CXX) $(LDFLAGS) $^ -o $@ $(CXX_COMMON) $(CXX_SHARED)|g' \ + Makefile || die + sed -i 's|$(CXX)|$(CXX) $(LDFLAGS)|' examples/Makefile || die + # we use lhapdf6 instead of lhapdf5 + # some PDFs changed, use something similar + sed -i \ + -e "s|LHAPDF5|LHAPDF6|g" \ + -e "s|\.LHgrid||g" \ + -e "s|\.LHpdf||g" \ + -e "s|MRST2001lo|MRST2007lomod|g" \ + -e "s|cteq6ll|cteq6l1|g" \ + -e "s|cteq6m|cteq66|g" \ + examples/*.{cc,cmnd} || die + # After lhapdf5->6 migration PDFs are identical within ~1/1000 + # https|//www.hepforge.org/archive/lhapdf/pdfsets/6.1/README + sed -i \ + -e "s|1e-8|3e-1|g" \ + -e "s|nlo_as_0119_qed|nlo_as_0119_qed_mc|g" \ + -e "s|xmldoc|share/Pythia8/xmldoc|g" \ + examples/main54.cc || die + # ask cflags from root + sed -i "s|root-config|root-config --cflags|g" examples/Makefile || die + + sed -i 's|libpythia8\.a|libpythia8$(LIB_SUFFIX)|g' \ + examples/Makefile || die +} + +# TODO: the following optional packages are out of Gentoo tree: +# - EvtGen http://atlas-computing.web.cern.ch/atlas-computing/links/externalDirectory/EvtGen/ +# - PowHEG http://powhegbox.mib.infn.it/ +# - ProMC https://github.com/Argonne-National-Laboratory/ProMC/ +src_configure() { + # homemade configure script + ./configure \ + --arch=Linux \ + --cxx="$(tc-getCXX)" \ + --prefix="${EPREFIX}/usr" \ + --prefix-lib="${EPREFIX}/usr/$(get_libdir)" \ + --prefix-share="${EPYTHIADIR}" \ + $(usex fastjet "--with-fastjet3" "") \ + $(usex zlib "--with-gzip" "") \ + $(use_with hepmc3) \ + $(use_with hepmc2) \ + $(usex lhapdf "--with-lhapdf6 + --with-lhapdf6-plugin=LHAPDF6.h + --with-lhapdf6-lib=${EPREFIX}/usr/$(get_libdir)" "") \ + $(usex root "--with-root + --with-root-include=${EPREFIX}/usr/include/root + --with-root-lib=${EPREFIX}/usr/$(get_libdir)/root" "") \ + || die + + # fix pythia config script + sed -i \ + -e 's|Pythia8/examples/Makefile.inc|Pythia8/Makefile.inc|' \ + -e 's|LINE%=|LINE%%=|' \ + bin/pythia8-config || die +} + +src_test() { + cd examples || die + + local tests="$(echo main{{01..32},37,38,61,62,73,80}.out)" + use hepmc3 && tests+=" $(echo main{41,42,85,86}.out)" + use hepmc3 && use lhapdf && tests+=" $(echo main{43,{87..89}}.out)" + use lhapdf && tests+=" $(echo main{51..54}.out)" + use fastjet && tests+=" $(echo main{71,72}.out)" + use fastjet && use hepmc3 && use lhapdf && tests+=" $(echo main{81..84}).out" + use root && tests+=" main91.out" + # Disabled tests: + # 33 needs PowHEG + # 46 needs ProMC + # 48 needs EvtGen + # 92 generated ROOT dictionary is badly broken + + # use emake for parallel instead of long runmains + LD_LIBRARY_PATH="${S}/$(get_libdir):${LD_LIBRARY_PATH}" \ + PYTHIA8DATA="../share/Pythia8/xmldoc/" \ + LHAPDF_DATA_PATH="${WORKDIR}" \ + emake ${tests} + emake clean +} + +src_install() { + # make install is too broken, much easier to install manually + dobin bin/pythia8-config + doheader -r include/* + dolib.so lib/libpythia8.so + use lhapdf && dolib.so lib/libpythia8lhapdf6.so + insinto "${PYTHIADIR}" + doins -r share/Pythia8/xmldoc share/Pythia8/pdfdata examples/Makefile.inc + + newenvd - 99pythia8 <<- _EOF_ + PYTHIA8DATA=${EPYTHIADIR}/xmldoc + _EOF_ + + dodoc AUTHORS GUIDELINES README + if use doc; then + dodoc -r share/Pythia8/pdfdoc/. + dodoc -r share/Pythia8/htmldoc/. + fi + if use examples; then + # reuse system Makefile.inc + rm examples/Makefile.inc || die + sed -i "s|include Makefile.inc|include ${EPYTHIADIR}|" \ + examples/Makefile || die + + insinto /usr/share/${PN} + doins -r examples + docompress -x /usr/share/doc/${PF}/examples + fi + + # cleanup + unset PYTHIADIR EPYTHIADIR +} -- cgit v1.2.3