commit:     f5adbcfabe52b1e36bc357dd54339905f776c3d8
Author:     Alexander Puck Neuwirth <alexander <AT> neuwirth-informatik <DOT> 
de>
AuthorDate: Tue May  7 18:44:35 2024 +0000
Commit:     Alexander Puck Neuwirth <alexander <AT> neuwirth-informatik <DOT> 
de>
CommitDate: Thu May 16 14:01:53 2024 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=f5adbcfa

sci-physics/madgraph5: new package, add 3.5.3

Closes: https://github.com/gentoo/sci/pull/1270
Co-authored-by: Andrew Nowa Ammerlaan <andrewammerlaan <AT> gentoo.org>
Signed-off-by: Alexander Puck Neuwirth <alexander <AT> neuwirth-informatik.de>

 sci-physics/madgraph5/files/cuttools.patch   | 44 +++++++++++++
 sci-physics/madgraph5/madgraph5-3.5.3.ebuild | 93 ++++++++++++++++++++++++++++
 sci-physics/madgraph5/metadata.xml           | 32 ++++++++++
 3 files changed, 169 insertions(+)

diff --git a/sci-physics/madgraph5/files/cuttools.patch 
b/sci-physics/madgraph5/files/cuttools.patch
new file mode 100644
index 000000000..0d6249af8
--- /dev/null
+++ b/sci-physics/madgraph5/files/cuttools.patch
@@ -0,0 +1,44 @@
+diff -Naru MG5_aMC_v2_9_6.orig/vendor/CutTools/makefile 
MG5_aMC_v2_9_6/vendor/CutTools/makefile
+--- MG5_aMC_v2_9_6.orig/vendor/CutTools/makefile       2022-04-13 
11:13:28.277248753 +0200
++++ MG5_aMC_v2_9_6/vendor/CutTools/makefile    2022-04-13 11:13:43.702292725 
+0200
+@@ -42,15 +42,15 @@
+ endif
+ 
+ cpmp:   
+-      cp  -p ./src/cts/cts_mpr.in ./src/cts/cts_mpr.h
+-      cp  -p ./src/cts/cts_mpc.in ./src/cts/cts_mpc.h
+-      cp  -p ./src/cts/cts_mprec.in ./src/cts/cts_mprec.h 
+-      cp  -p ./src/cts/cts_mpinit.in ./src/cts/cts_mpinit.h
++      cp   ./src/cts/cts_mpr.in ./src/cts/cts_mpr.h
++      cp   ./src/cts/cts_mpc.in ./src/cts/cts_mpc.h
++      cp   ./src/cts/cts_mprec.in ./src/cts/cts_mprec.h 
++      cp   ./src/cts/cts_mpinit.in ./src/cts/cts_mpinit.h
+ cpqp:   
+-      cp  -p ./src/cts/cts_qpr.in ./src/cts/cts_mpr.h
+-      cp  -p ./src/cts/cts_qpc.in ./src/cts/cts_mpc.h
+-      cp  -p ./src/cts/cts_qprec.in ./src/cts/cts_mprec.h
+-      cp  -p ./src/cts/cts_qpinit.in ./src/cts/cts_mpinit.h
++      cp   ./src/cts/cts_qpr.in ./src/cts/cts_mpr.h
++      cp   ./src/cts/cts_qpc.in ./src/cts/cts_mpc.h
++      cp   ./src/cts/cts_qprec.in ./src/cts/cts_mprec.h
++      cp   ./src/cts/cts_qpinit.in ./src/cts/cts_mpinit.h
+ 
+ clean$(BLD): default
+       rm -fr  $(BLD)/*.f
+@@ -68,11 +68,11 @@
+ 
+ $(BLD)/version.h: 
+       -mkdir -p $(BLD)
+-      cp  -p ./src/avh/* $(BLD)/ 
+-      cp  -p ./src/cts/* $(BLD)/ 
+-      cp  -p ./src/mpfun90/* $(BLD)/ 
+-      cp  -p ./src/qcdloop/* $(BLD)/ 
+-      cp  -p ./src/makefile $(BLD)/ 
++      cp   ./src/avh/* $(BLD)/ 
++      cp   ./src/cts/* $(BLD)/ 
++      cp   ./src/mpfun90/* $(BLD)/ 
++      cp   ./src/qcdloop/* $(BLD)/ 
++      cp   ./src/makefile $(BLD)/ 
+ 
+ tar:
+       tar -czvf $(CTS_TAR) *

diff --git a/sci-physics/madgraph5/madgraph5-3.5.3.ebuild 
b/sci-physics/madgraph5/madgraph5-3.5.3.ebuild
new file mode 100644
index 000000000..3ced7918c
--- /dev/null
+++ b/sci-physics/madgraph5/madgraph5-3.5.3.ebuild
@@ -0,0 +1,93 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# does not escape strings properly, so no python3_12 for now
+PYTHON_COMPAT=( python3_11 )
+inherit fortran-2 python-single-r1
+
+MY_PNN="MadGraph5"
+MY_PV=$(ver_rs 1-3 '_')
+MY_PN="MG5_aMC_v"
+MY_PF=${MY_PN}${MY_PV}
+
+DESCRIPTION="MadGraph5_aMC@NLO"
+HOMEPAGE="https://launchpad.net/mg5amcnlo";
+SRC_URI="https://launchpad.net/mg5amcnlo/$(ver_cut 1).0/$(ver_cut 
1-2).x/+download/${MY_PN}${PV}.tar.gz -> ${MY_PNN}-${PV}.tar.gz"
+S="${WORKDIR}/${MY_PF}"
+
+LICENSE="UoI-NCSA"
+SLOT="3"
+KEYWORDS="~amd64"
+# TODO add pineapple, herwig, syscalc, pjfrym, pineappl
+IUSE="+hepmc2 +lhapdf +fastjet pythia collier thepeg" # td madanalysis5 ninja 
samurai golem95
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+       ${PYTHON_DEPS}
+       sys-libs/zlib
+       sys-devel/gcc:*[fortran]
+       $(python_gen_cond_dep '
+               dev-python/numpy[${PYTHON_USEDEP}]
+       ')
+       lhapdf? ( sci-physics/lhapdf[${PYTHON_SINGLE_USEDEP}] )
+       fastjet? ( sci-physics/fastjet[${PYTHON_SINGLE_USEDEP}] )
+       pythia? ( sci-physics/pythia:8=[examples] )
+       hepmc2? ( sci-physics/hepmc:2 )
+       collier? ( sci-physics/collier[static-libs] )
+       thepeg? (
+             sci-physics/thepeg[hepmc3(-),fastjet?,lhapdf?]
+       )
+"
+#   madanalysis5? ( sci-physics/madanalysis5 )
+#      td? ( sci-physics/topdrawer )
+#      ninja? ( sci-physics/ninja[static-libs] )
+#      samurai? ( sci-physics/samurai )
+#      golem95? ( sci-physics/golem95 )
+DEPEND="${RDEPEND}"
+
+PATCHES=( "${FILESDIR}"/cuttools.patch )
+
+src_unpack() {
+       # Perserve permissions
+       tar xvzf "${DISTDIR}/${MY_PNN}-${PV}.tar.gz" -C "${WORKDIR}" || die
+}
+
+src_configure() {
+       cat <<-EOF >> input/mg5_configuration.txt || die
+       $(usex lhapdf "lhapdf_py3 = ${EPREFIX}/usr/bin/lhapdf-config" "")
+       $(usex fastjet "fastjet = ${EPREFIX}/usr/bin/fastjet-config" "")
+       $(usex pythia "pythia8_path = ${EPREFIX}/usr" "")
+       $(usex hepmc2 "hepmc_path = ${EPREFIX}/usr" "")
+       $(usex collier "collier = ${EPREFIX}/usr/$(get_libdir)" "")
+       $(usex thepeg "thepeg_path = ${EPREFIX}/usr/$(get_libdir)" "")
+       auto_update = 0
+       EOF
+
+       #use ninja && echo "ninja = ${EPREFIX}/usr/$(get_libdir)" >> 
input/mg5_configuration.txt
+       #use samurai && echo "samurai = ${EPREFIX}/usr/$(get_libdir)" >> 
input/mg5_configuration.txt
+       #use golem95 && echo "golem = ${EPREFIX}/usr/$(get_libdir)" >> 
input/mg5_configuration.txt
+       #use td && echo "td_path = ${EPREFIX}/usr/bin/td" >> 
input/mg5_configuration.txt
+       #use madanalysis5 && echo "madanalysis5_path = 
${EPREFIX}/opt/MadAnalysis5/" >> input/mg5_configuration.txt
+}
+
+src_compile() {
+       # MadGraph needs to generate `Template/LO/Source/make_opts` which is 
done
+       # automatically at startup.  This needs to be done during setup (or 
with root access)
+       echo "exit" > tmpfile || die
+       bin/mg5_aMC ./tmpfile || die
+       rm tmpfile || die
+}
+
+src_install() {
+       # symlink entrypoint
+       dosym ../../opt/${MY_PF}/bin/mg5_aMC /usr/bin/mg5_aMC3
+       dosym  ../opt/${MY_PF} /opt/"${MY_PNN}"
+       mv "${WORKDIR}/${MY_PF}" "${ED}/opt/" || die
+
+       # allow all users to modify mg directory
+       # as it changes it self
+       #fperms -R a=u /opt/${MY_PF}
+       #fperms a=u /opt/${MY_PF}
+}

diff --git a/sci-physics/madgraph5/metadata.xml 
b/sci-physics/madgraph5/metadata.xml
new file mode 100644
index 000000000..8fc26f579
--- /dev/null
+++ b/sci-physics/madgraph5/metadata.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>alexan...@neuwirth-informatik.de</email>
+               <name>Alexander Puck Neuwirth</name>
+       </maintainer>
+       <longdescription lang="en">
+       MadGraph5_aMC@NLO is a framework that aims at providing all the 
elements necessary for SM and BSM phenomenology, such as the computations of 
cross sections, the generation of hard events and their matching with event 
generators, and the use of a variety of tools relevant to event manipulation 
and analysis. Processes can be simulated to LO accuracy for any user-defined 
Lagrangian, an the NLO accuracy in the case of models that support this kind of 
calculations -- prominent among these are QCD and EW corrections to SM 
processes. Matrix elements at the tree- and one-loop-level can also be obtained.
+       </longdescription>      
+       <use>
+               <flag name="lhapdf">USE system LHAPDF</flag>
+               <flag name="fastjet">USE system FASTJET</flag>
+               <flag name="pythia">USE system PYTHIA</flag>
+               <flag name="hepmc2">USE system hepmc version 2</flag>
+               <flag name="thepeg">USE system thepeg</flag>
+               <flag name="collier">USE system collier</flag>
+<!--
+               <flag name="ninja">USE system ninja</flag>
+               <flag name="samurai">USE system samurai</flag>
+               <flag name="pineappl">USE system pineappl</flag>
+               <flag name="herwig">USE system herwig</flag>
+               <flag name="madanalysis5">USE system madanalysis5</flag>
+               <flag name="golem95">USE system golem95</flag>
+               <flag name="td">USE system topdrawer</flag>
+               <flag name="rivet">USE system rivet</flag>
+-->
+       </use>
+       <upstream>
+               <remote-id type="launchpad">mg5amcnlo</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to