Skip to content

Commit

Permalink
sci-physics/openloops: offer processes
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Puck Neuwirth <alexander@neuwirth-informatik.de>
  • Loading branch information
APN-Pucky committed Dec 12, 2024
1 parent 20a07b3 commit 1672fca
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 14 deletions.
4 changes: 4 additions & 0 deletions sci-physics/openloops/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
DIST OpenLoops-OpenLoops-2.1.3.tar.bz2 3769562 BLAKE2B ddb664a7310662e2d0891e31870d614c191b0248f1b4c8816d4f33b6709005eea7435fda73c354092a28d55a0b106ec9358fb4e4a7a6ed592d61208ff5334e85 SHA512 a5ae2431506f8e169c42dd1d5fa3db70b4e2d62dfa744041fcd61d8554daba0700d453e9198e50a3e85cb3f196277c0f011fb408fd5913cd6a1c42ed71bb9d51
DIST ppllj-a3a36918.tar.bz2 475014 BLAKE2B b73022c23c082637eb2658fafab716eb749b87de5304ef6672552e7bbbb637a915d0f29c4dee352d9d6f18af7c4139047405bf031bf3986e7353fe73ac82903c SHA512 7ffb11b8910782a9316b86388a2de2d7ce7b9fdc2742bec8065f22a143cf1c988447480d10a629c4b820d5d8b1248bc10eab78560cd51b22fd3fe4a23b596b99
DIST pplljj-93a6e3f7.tar.bz2 2472469 BLAKE2B e4d22ff93ffcd3eaf2583ddfd107d75ecfca5abbcfc125d305f0a149b11b2c3784be95f3d2b473f7aee6c9819863f01bfbf3cd4b06dae8ed2ec6542f6acb1a62 SHA512 d52ee86f8b7aa5e6a339b82e0e6bd30eff5e6666ad3b1d33bc4c1122ef77dd986836abcc70b7936f10f66bd65e29dc938221da45c9654fcab2340085200c523a
DIST pplnj_ckm-4d8743c.tar.bz2 399934 BLAKE2B dbbc0f9d832c9d1758bdf7166b1936c8ecb48053981d2f96fc7ba0bd4a740515863d6b07ab4a1ec1c88cc267787f9ee061ebfc812c4f457fa4a9d135f6df64e2 SHA512 fc4e5797412951a9144bda5856d14aec9d0d4b2f4a89d9afd2d97573149498d76cdc92b9b96915b7ebd318656d44ad9c3bfa0bd14dbb2bb871f665613156075e
DIST pplnjj_ckm-d3d5302.tar.bz2 16599657 BLAKE2B 0fc98634135c3302a2316fa37fdae07380317995bd1d34de9959e8dc664980b16200a6538278d6155a5b193bf2885c069c6d9980b76d4b3f622fa0518419ee43 SHA512 b5a5b876ed97bcf406117d9d595741e439f3f8af138ddede154968e294a04342efd7b15b85a78680dd725ef258341f1c2564f84ce9968c181694700393f82377
4 changes: 4 additions & 0 deletions sci-physics/openloops/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@
<flag name="collier">Build with collier</flag>
<flag name="extra">Build libs with extra</flag>
<flag name="cuttools">Build with cuttools</flag>
<flag name="ppllj">Build pp to llj process</flag>
<flag name="pplljj">Build pp to lljj process</flag>
<flag name="pplnj-ckm">Build pp to lnj_ckm process</flag>
<flag name="pplnjj-ckm">Build pp to lljj_ckm process</flag>
</use>
</pkgmetadata>
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,23 @@ DESCRIPTION="Evaluation of tree and one-loop matrix elements for any Standard Mo
HOMEPAGE="https://openloops.hepforge.org/index.html"
#SRC_URI="https://openloops.hepforge.org/downloads?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
#S="${WORKDIR}/${MY_P}"
SRC_URI="https://gitlab.com/openloops/OpenLoops/-/archive/${MY_P}/${MY_PN}-${MY_P}.tar.bz2"
# since the files are not publicly versioned we mirror them from
# https://www.physik.uzh.ch/data/openloops/repositories/public/processes/2
COMMON_URI="https://gitlab.com/openloopsmirror/"

SRC_URI="
https://gitlab.com/openloops/OpenLoops/-/archive/${MY_P}/${MY_PN}-${MY_P}.tar.bz2
ppllj? ( ${COMMON_URI}/ppllj/-/archive/a3a36918/ppllj-a3a36918.tar.bz2 )
pplljj? ( ${COMMON_URI}/pplljj/-/archive/93a6e3f7/pplljj-93a6e3f7.tar.bz2 )
pplnj-ckm? ( ${COMMON_URI}/pplnj_ckm/-/archive/4d8743c/pplnj_ckm-4d8743c.tar.bz2 )
pplnjj-ckm? ( ${COMMON_URI}/pplnjj_ckm/-/archive/d3d5302/pplnjj_ckm-d3d5302.tar.bz2 )
"
S="${WORKDIR}/${MY_PN}-${MY_P}"

LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+collier +cuttools +extra"
IUSE="+collier +cuttools +extra ppllj pplljj pplnj-ckm pplnjj-ckm"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

RDEPEND="
Expand All @@ -39,7 +49,7 @@ PATCHES=(
src_prepare() {
default
mv openloops.cfg.tmpl openloops.cfg || die
sed -i "s|scons -Q|scons -Q -C /opt/${MY_P}/|g" openloops || die
sed -i "s|\\\$BASEDIR/scons -Q|scons -Q -C /opt/${MY_P}/|g" openloops || die
if use extra ; then
sed -i "s|#compile_extra.*|compile_extra = 1|" openloops.cfg || die
fi
Expand All @@ -54,9 +64,7 @@ src_prepare() {
cc = $(tc-getCC)
cxx = $(tc-getCXX)
fortran_compiler = $(tc-getFC)
process_src_dir = ${EPREFIX}/opt/${MY_P}/process_src/
process_obj_dir = ${EPREFIX}/opt/${MY_P}/process_obj/
process_lib_dir = ${EPREFIX}/opt/${MY_P}/proclib/
release = $PV
import_env = @all
EOF
Expand All @@ -70,16 +78,40 @@ src_prepare() {

src_compile() {
escons --cache-disable
for OLPROC in ppllj pplljj pplnj_ckm pplnjj_ckm; do
if use ${OLPROC//_/-}; then
# move downloaded files to src
mkdir -p "${S}/process_src/${OLPROC}" || die
mv "${WORKDIR}/${OLPROC}-*/*" "${S}/process_src/${OLPROC}" || die
# compile it
escons auto=${OLPROC} generator=0
fi
done

# insert these later since we are done with compiling in ${S} now
cat <<-EOF >> openloops.cfg || die
process_src_dir = ${EPREFIX}/opt/${MY_P}/process_src/
process_obj_dir = ${EPREFIX}/opt/${MY_P}/process_obj/
process_lib_dir = ${EPREFIX}/usr/$(get_libdir)/
EOF
}

src_install() {
dosym ../opt/${MY_P} /opt/OpenLoops2
dobin openloops
cd include || die
doheader openloops.h
cd ../lib || die

# Also install so.version links
cd ../lib || die
dolib.so libolcommon.so* libopenloops.so* librambo.so* libtrred.so*
# install proccesses
cd ../proclib || die
dolib.so *.so
# also install the process info files
insinto /usr/$(get_libdir)/
doins *.info

cd ../lib_src/olcommon/mod || die
doheader *.mod
cd ../../openloops/mod || die
Expand All @@ -94,15 +126,11 @@ src_install() {
doins openloops.cfg SConstruct
doins -r pyol

# Previous method of allowing everyone everything
# maybe better to use a group for that
# for now like lhapdf just let root install
#fperms -R a=u /opt/${MY_P}
#fperms a=u /opt/${MY_P}

# no need to also install the source code
#doins -r process_src
}

pkg_postinst() {
elog "Install processes with openloops libinstall."
elog "They are installed in /opt/${MY_P}/proclib."
elog "They are installed in ${EPREFIX}/usr/$(get_libdir)/."
}

0 comments on commit 1672fca

Please sign in to comment.