blob: e258337598b81e61f21651b0e5e38fd9bff0165a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
# python only needed for create.py to get binaries
PYTHON_COMPAT=( python3_{10..12} )
inherit fortran-2 python-any-r1 toolchain-funcs
DESCRIPTION="Library of one-loop scalar functions"
HOMEPAGE="
https://helac-phegas.web.cern.ch/OneLOop.html
https://bitbucket.org/hameren/oneloop
"
SRC_URI="https://bitbucket.org/hameren/oneloop/get/3762b8bad6ad.zip -> ${P}.zip"
S="${WORKDIR}/hameren-oneloop-3762b8bad6ad"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+dpkind +qpkind qpkind16 dpkind16 qdcpp ddcpp mpfun90 arprec tlevel cppintf"
REQUIRED_USE="
?? ( dpkind dpkind16 ddcpp )
?? ( qpkind qpkind16 qdcpp )
?? ( arprec mpfun90 )
|| ( dpkind dpkind16 ddcpp qpkind qpkind16 qdcpp )
"
DEPEND="
qpkind? ( sci-libs/qd )
qpkind16? ( sci-libs/qd )
arprec? ( sci-libs/arprec )
mpfun90? ( sci-libs/mpfun90 )
"
RDEPEND="${DEPEND}"
BDEPEND="
${PYTHON_DEPS}
app-arch/unzip
"
src_configure() {
tc-export FC
# set fortran
sed -i "/FC = /s/gfortran/${FC}/g" Config || die
sed -i "/FFLAGS = /s/ -O/${FFLAGS} -fPIC/g" Config || die
# Clear config
sed -i "s/^DPKIND.*$//g" Config || die
sed -i "s/^QPKIND.*$//g" Config || die
if use dpkind ; then
echo "DPKIND = kind(1d0)" >> Config || die
fi
if use qpkind ; then
echo "QPKIND = kind(1d0)" >> Config || die
fi
if use dpkind16 ; then
echo "DPKIND = 16" >> Config || die
fi
if use qpkind16 ; then
echo "QPKIND = 16" >> Config || die
fi
if use qdcpp ; then
echo "QDTYPE = qdcpp" >> Config || die
fi
if use ddcpp ; then
echo "DDTYPE = qdcpp" >> Config || die
fi
if use mpfun90 ; then
echo "MPTYPE = mpfun90" >> Config || die
fi
if use arprec ; then
echo "MPTYPE = arprec" >> Config || die
fi
if use tlevel ; then
sed -i "s/^.*TLEVEL.*$/TLEVEL = yes/" Config || die
else
sed -i "s/^.*TLEVEL.*$/TLEVEL = no/" Config || die
fi
if use cppintf ; then
sed -i "s/^.*CPPINTF.*$/CPPINTF = yes/" Config || die
else
sed -i "s/^.*CPPINTF.*$/CPPINTF = no/" Config || die
fi
}
src_compile() {
tc-export FC
#emake -f make_cuttools
${EPYTHON} ./create.py source || die "Failed to compile"
# create.py does not use soname, so we do it ourself
#./create.py dynamic || die
${FC} -O -fPIC -c avh_olo.f90 -o avh_olo.o || die
${FC} ${LDFLAGS} -Wl,-soname,libavh_olo.so -shared -o libavh_olo.so *.o || die
}
src_install() {
#dolib.a libavh_olo.a
dolib.so libavh_olo.so
doheader *.mod
dosym libavh_olo.so /usr/$(get_libdir)/liboneloop.so
}
|