dev-libs/tomsfastmath: keyworded 0.13.1 for ppc64, bug #725414
[gentoo.git] / dev-libs / tomsfastmath / tomsfastmath-0.13.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit toolchain-funcs
7
8 DESCRIPTION="Fast public domain large integer arithmetic library"
9 HOMEPAGE="https://www.libtom.net/TomsFastMath/
10         https://github.com/libtom/tomsfastmath"
11 SRC_URI="https://github.com/libtom/tomsfastmath/releases/download/v${PV}/tfm-${PV}.tar.xz"
12 LICENSE="Unlicense"
13
14 # Current SONAME is 1
15 # Please bump when the ABI changes upstream
16 # Helpful site:
17 # https://abi-laboratory.pro/index.php?view=timeline&l=tomsfastmath
18 SLOT="0/1"
19
20 KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~sparc"
21
22 PATCHES=(
23         "${FILESDIR}/${P}-makefile-fix.patch"
24 )
25
26 _emake() {
27         # Standard boilerplate
28         # Upstream use homebrewed makefiles
29         # Best to use same args for all, for consistency,
30         # in case behaviour changes (v possible).
31         emake \
32                 CC="$(tc-getCC)" \
33                 AR="$(tc-getAR)" \
34                 RANLIB="$(tc-getRANLIB)" \
35                 DESTDIR="${ED}" \
36                 LIBPATH="/usr/$(get_libdir)" \
37                 IGNORE_SPEED=1 \
38                 "$@"
39 }
40
41 src_compile() {
42         _emake -f makefile.shared
43 }
44
45 src_test() {
46         _emake test_standalone stest rsatest
47
48         # We choose to be verbose during the test process
49         # because the output is quite repetitive with no
50         # clear demarcation b/t tests
51         local tests=( "test" "stest" "rsatest" )
52
53         local test
54         for test in "${tests[@]}"; do
55                 einfo "Running test (${test})"
56                 ./${test} || die "Test (${test}) failed"
57                 einfo "Completed test (${test})"
58         done
59 }
60
61 src_install() {
62         _emake -f makefile.shared install
63
64         # Remove unnecessary .la files
65         find "${ED}" -name '*.la' -delete || die
66         # Same for static libs
67         find "${ED}" -name "*.a" -delete || die
68 }