summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-physics')
-rw-r--r--sci-physics/pythia/Manifest1
-rw-r--r--sci-physics/pythia/files/pythia-8.2.26-run-tests.patch27
-rw-r--r--sci-physics/pythia/pythia-8.2.26.ebuild184
3 files changed, 212 insertions, 0 deletions
diff --git a/sci-physics/pythia/Manifest b/sci-physics/pythia/Manifest
index b3c074b8e0eb..a37a121c34c7 100644
--- a/sci-physics/pythia/Manifest
+++ b/sci-physics/pythia/Manifest
@@ -12,3 +12,4 @@ DIST pythia6-20160413.tar.gz 567976 SHA256 d613dcb27c905710e2f13a934913cc5545e3e
DIST pythia6.tar.gz 567451 SHA256 ebc90b8ec94897d8b09030341323d2c7c6e5c7c65077f98b96c8cff00d40a5ce SHA512 baa18023de22c3e90f14d2a5a39efa171905f507a31a90f87c65dca271b3be4c9f0d1a56282f5a04b3efabe0b5b15c964e4569d1f9994a75750e52e0be4360b1 WHIRLPOOL e334779f77e938cde85ecd0fbc2dbf0d86a52fc1ef673c909b8533f779e51d6d6680bc5de3aceeb002015ccfdf03da3f975aaf0cc7a249c462cdd3b206c359a2
DIST pythia8186.tgz 8921248 SHA256 1c0914fc04801ee922c1ad3b544a3cd48b34d9afa4407ae40afbacd009039bd2 SHA512 84729004abbdf522183c27918ae35db037a8954af761a2b452dcff54f82076b1e3bfc7fe9ea0a7cb2c0b6499aedb1c25cc13768d47b24edaa08d631b55d0b86b WHIRLPOOL ecef83d2cb018b1aac55225850cf2a3a8f2b87d08f99bd9c5881f4fa341f012eeabed3b9a43ffda3699daebc54c181d08aac30c1f6b514e98516c29e88a6fbaf
DIST pythia8210.tgz 14301345 SHA256 a2564c6011235a286115ba9da065f50c1233229b2f1a824583565dfeec0baa35 SHA512 fe2d02e32fd5d25bcdcc216754b91ca509a189c58f1a06ca8deba975af552586632fc8cf8ad3e62920884ee64c4af596fbe7c6872f5ddbd1f5a0cea4ba4bc90d WHIRLPOOL d2d3f212ed2ad700fa6ae44b2b670cce1623e80382af04072bee884a72ea269346c10728cc77cfa4c9377e8cd775febe9488427cb0b890e52c651efebd66f60c
+DIST pythia8226.tgz 17639842 SHA256 8ff4281bce9d22b17f1ec88e9e9353e8172512d5ef96296ace9486860e9ed2c9 SHA512 85db807264f99c27dd87ad0572b98f4ac8d37fed818c3dd1ac89f0ac124ae0a5ee13b290727e515cb04269a6e0be8b386d954bed62309f26d1e60b431f952ca0 WHIRLPOOL 6e020ec815b4d0b9649ebf2f9a149fc4680ba804568625e854005fa8ccdd3bbabde79df78da4f1ffaa1710df4809a17b4b8e745bcd909e9e914f05500d061472
diff --git a/sci-physics/pythia/files/pythia-8.2.26-run-tests.patch b/sci-physics/pythia/files/pythia-8.2.26-run-tests.patch
new file mode 100644
index 000000000000..34c7179fa55d
--- /dev/null
+++ b/sci-physics/pythia/files/pythia-8.2.26-run-tests.patch
@@ -0,0 +1,27 @@
+--- examples/Makefile.orig 2017-07-25 11:56:03.545393093 +0200
++++ examples/Makefile 2017-07-25 11:56:37.468572887 +0200
+@@ -158,6 +158,7 @@
+ rm -f $(LOCAL_EXAMPLE)/weakbosons.lhe
+ rm -f $(LOCAL_EXAMPLE)/Pythia8.promc
+ rm -f $(LOCAL_EXAMPLE)/hist.root
++ rm main*out *.dat
+
+ # Clean all temporary and generated files.
+ distclean: clean
+@@ -168,3 +169,16 @@
+ rm -f $(LOCAL_SHARE)/COPYING
+ rm -f $(LOCAL_SHARE)/GUIDELINES
+ rm -f $(LOCAL_SHARE)/README
++
++# Run tests, inject test-specific arguments when needed
++main%.out: main%
++ ./$< \
++ $(if $(findstring $*,16 42 43 $(shell seq 81 89)), main$*.cmnd) \
++ $(if $(findstring $*, $(shell seq 81 83)), w+_production_lhc_0.lhe) \
++ $(if $(findstring $*, 84), hepmcout84.dat 2 w+_production_lhc) \
++ $(if $(findstring $*, $(shell seq 85 88)), w_production) \
++ $(if $(findstring $*, 42 43 $(shell seq 81 89)), histout$*.dat) \
++ > $@
++
++main89.out: main89
++ $(foreach cmd, $(wildcard main89*.cmnd), ./$< $(cmd) histout-$(cmd).dat >> $@ || exit;)
diff --git a/sci-physics/pythia/pythia-8.2.26.ebuild b/sci-physics/pythia/pythia-8.2.26.ebuild
new file mode 100644
index 000000000000..2851fad340e6
--- /dev/null
+++ b/sci-physics/pythia/pythia-8.2.26.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils multilib toolchain-funcs versionator
+
+MV=$(get_major_version)
+MY_P=${PN}$(replace_all_version_separators "" ${PV})
+LHA_VER="6.1"
+
+DESCRIPTION="Lund Monte Carlo high-energy physics event generator"
+HOMEPAGE="http://pythia8.hepforge.org/"
+SRC_URI="http://home.thep.lu.se/~torbjorn/${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
+ https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/NNPDF23_nlo_as_0119_qed_mc.tar.gz
+ https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/NNPDF23_nnlo_as_0119_qed_mc.tar.gz
+ https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/cteq66.tar.gz
+ https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/cteq6l1.tar.gz
+ https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/unvalidated/MRST2004qed.tar.gz
+ ) )"
+
+SLOT="8"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples gzip +hepmc fastjet lhapdf root static-libs test"
+
+RDEPEND="
+ fastjet? ( >=sci-physics/fastjet-3 )
+ gzip? ( sys-libs/zlib )
+ hepmc? ( sci-physics/hepmc:0= )
+ lhapdf? ( >=sci-physics/lhapdf-6:= )
+"
+# ROOT is used only when building related tests
+DEPEND="${RDEPEND}
+ test? ( root? ( sci-physics/root:= ) )
+"
+
+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}"
+ # 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
+ if ! use static-libs; then
+ sed -i \
+ -e '/TARGETS=$(LOCAL_LIB)\/libpythia8\.a/d' \
+ -e 's:libpythia8\.a$:libpythia8$(LIB_SUFFIX):g' \
+ Makefile || die
+ sed -i 's:libpythia8\.a:libpythia8$(LIB_SUFFIX):g' \
+ examples/Makefile || die
+ fi
+
+ eapply "${FILESDIR}/${PF}-run-tests.patch"
+ eapply "${FILESDIR}/${PN}8209-root-noninteractive.patch"
+ eapply_user
+}
+
+# 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) \
+ --enable-shared \
+ --prefix="${EPREFIX}/usr" \
+ --prefix-lib="$(get_libdir)" \
+ --prefix-share="${EPYTHIADIR}" \
+ $(usex fastjet "--with-fastjet3" "") \
+ $(usex gzip "--with-gzip" "") \
+ $(usex hepmc "--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 hepmc && tests+=" $(echo main{41,42,85,86}.out)"
+ use hepmc && 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 hepmc && 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 lib/*
+ insinto "${PYTHIADIR}"
+ doins -r share/Pythia8/xmldoc examples/Makefile.inc
+
+ echo "PYTHIA8DATA=${EPYTHIADIR}/xmldoc" >> 99pythia8
+ doenvd 99pythia8
+
+ dodoc AUTHORS GUIDELINES README
+ if use doc; then
+ dodoc share/Pythia8/pdfdoc/*
+ dohtml -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/doc/${PF}
+ doins -r examples
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+
+ # cleanup
+ unset PYTHIADIR EPYTHIADIR
+}