1 |
commit: 1a3cd2703835fc0e25c47695c0ed1eeea4e59bb2 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Dec 22 09:46:40 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 22 09:46:40 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a3cd270 |
7 |
|
8 |
dev-libs/libtomcrypt: Fix linking to math libs |
9 |
|
10 |
Closes: https://bugs.gentoo.org/761226 |
11 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
12 |
|
13 |
...-1.18.2.ebuild => libtomcrypt-1.18.2-r1.ebuild} | 32 ++++++++++------------ |
14 |
1 file changed, 14 insertions(+), 18 deletions(-) |
15 |
|
16 |
diff --git a/dev-libs/libtomcrypt/libtomcrypt-1.18.2.ebuild b/dev-libs/libtomcrypt/libtomcrypt-1.18.2-r1.ebuild |
17 |
similarity index 81% |
18 |
rename from dev-libs/libtomcrypt/libtomcrypt-1.18.2.ebuild |
19 |
rename to dev-libs/libtomcrypt/libtomcrypt-1.18.2-r1.ebuild |
20 |
index 9b87379612a..4a2fbf1ca84 100644 |
21 |
--- a/dev-libs/libtomcrypt/libtomcrypt-1.18.2.ebuild |
22 |
+++ b/dev-libs/libtomcrypt/libtomcrypt-1.18.2-r1.ebuild |
23 |
@@ -36,9 +36,18 @@ mymake() { |
24 |
local extra_libs=() |
25 |
|
26 |
# Build support as appropriate for consumers (MPI) |
27 |
- use gmp && enabled_features+=( -DGMP_DESC=1 ) |
28 |
- use libtommath && enabled_features+=( -DLTM_DESC=1 ) |
29 |
- use tomsfastmath && enabled_features+=( -DTFM_DESC=1 ) |
30 |
+ if use gmp; then |
31 |
+ enabled_features+=( -DGMP_DESC=1 ) |
32 |
+ extra_libs+=( -lgmp ) |
33 |
+ fi |
34 |
+ if use libtommath; then |
35 |
+ enabled_features+=( -DLTM_DESC=1 ) |
36 |
+ extra_libs+=( -ltommath ) |
37 |
+ fi |
38 |
+ if use tomsfastmath; then |
39 |
+ enabled_features+=( -DTFM_DESC=1 ) |
40 |
+ extra_libs+=( -ltfm ) |
41 |
+ fi |
42 |
|
43 |
# For the test and example binaries, we have to choose |
44 |
# which MPI we want to use. |
45 |
@@ -46,27 +55,14 @@ mymake() { |
46 |
# gmp > libtommath > tomsfastmath > none |
47 |
if use gmp ; then |
48 |
enabled_features+=( -DUSE_GMP=1 ) |
49 |
- extra_libs=( -lgmp ) |
50 |
elif use libtommath ; then |
51 |
enabled_features+=( -DUSE_LTM=1 ) |
52 |
- extra_libs=( -ltommath ) |
53 |
elif use tomsfastmath ; then |
54 |
enabled_features+=( -DUSE_TFM=1 ) |
55 |
- extra_libs=( -ltfm ) |
56 |
- fi |
57 |
- |
58 |
- # If none of the above are being used, |
59 |
- # the tests don't need to link against any extra |
60 |
- # libraries. |
61 |
- |
62 |
- # We only need to do this strange logic for tests |
63 |
- # anyway because we're choosing what to build a binary with. |
64 |
- if [[ ${TEST} != 1 ]] ; then |
65 |
- extra_libs=() |
66 |
fi |
67 |
|
68 |
# IGNORE_SPEED=1 is needed to respect CFLAGS |
69 |
- EXTRALIBS="${extra_libs}" emake \ |
70 |
+ EXTRALIBS="${extra_libs[*]}" emake \ |
71 |
CFLAGS="${CFLAGS} ${enabled_features[*]}" \ |
72 |
CC="$(tc-getCC)" \ |
73 |
AR="$(tc-getAR)" \ |
74 |
@@ -88,7 +84,7 @@ src_test() { |
75 |
# 1) https://github.com/libtom/libtomcrypt/commit/a65cfb8dbe4 |
76 |
# 2) https://github.com/libtom/libtomcrypt/commit/fdc6cd20137 |
77 |
# is made, we can run tests for each provider. |
78 |
- TEST=1 mymake test |
79 |
+ mymake test |
80 |
./test || die "Running tests failed" |
81 |
} |