5
5
6
6
inherit autotools
7
7
8
- MY_PN=${PN## lib}
9
-
8
+ MyPN=secp256k1
10
9
DESCRIPTION=" Optimized C library for EC operations on curve secp256k1"
11
10
HOMEPAGE=" https://github.com/bitcoin-core/secp256k1"
12
- if [[ ${PV} == * _p* ]] ; then
13
- MY_COMMIT=" 3967d96bf184519eb98b766af665b4d4b072563e"
14
- SRC_URI=" https://github.com/bitcoin-core/${MyPN} /archive/${COMMITHASH} .tar.gz -> ${P} .tar.gz"
15
- S=" ${WORKDIR} " /${MY_PN} -${MY_COMMIT}
16
- else
17
- SRC_URI=" https://github.com/bitcoin-core/secp256k1/archive/refs/tags/v${PV} .tar.gz -> ${P} .tar.gz"
18
- S=" ${WORKDIR} " /${MY_PN} -${PV}
19
- fi
11
+ SRC_URI=" https://github.com/bitcoin-core/secp256k1/archive/v${PV} .tar.gz -> ${P} .tar.gz"
20
12
21
13
LICENSE=" MIT"
22
- SLOT=" 0/1"
14
+ SLOT=" 0/1" # subslot is "$((_LIB_VERSION_CURRENT-_LIB_VERSION_AGE))" from configure.ac
23
15
KEYWORDS=" ~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
24
16
IUSE=" +asm ecdh experimental +extrakeys lowmem precompute-ecmult +schnorr +recovery test valgrind"
25
17
RESTRICT=" !test? ( test )"
18
+
26
19
REQUIRED_USE="
27
20
?? ( lowmem precompute-ecmult )
28
- asm? (
29
- || ( amd64 arm )
30
- )
21
+ asm? ( || ( amd64 arm ) arm? ( experimental ) )
31
22
schnorr? ( extrakeys )
32
23
"
33
-
34
24
BDEPEND="
35
25
virtual/pkgconfig
36
26
test? ( dev-libs/openssl )
37
27
valgrind? ( dev-util/valgrind )
38
28
"
39
29
30
+ S=" ${WORKDIR} /${MyPN} -${PV} "
31
+
40
32
src_prepare () {
41
33
default
42
34
eautoreconf
@@ -46,37 +38,33 @@ src_prepare() {
46
38
}
47
39
48
40
src_configure () {
49
- local asm_opt
50
- if use asm; then
51
- if use arm; then
52
- asm_opt=arm
53
- else
54
- asm_opt=auto
55
- fi
56
- else
57
- asm_opt=no
58
- fi
59
-
60
41
local myeconfargs=(
61
42
--disable-benchmark
62
43
$( use_enable experimental)
63
44
$( use_enable test tests)
64
45
$( use_enable test exhaustive-tests)
65
- $( use_enable ecdh module-ecdh)
66
- $( use_enable extrakeys module-extrakeys)
67
- --with-asm=${asm_opt}
68
- $( use_enable recovery module-recovery)
46
+ $( use_enable {,module-}ecdh)
47
+ $( use_enable {,module-}extrakeys)
48
+ $( use_enable {,module-}recovery)
69
49
$( use_enable schnorr module-schnorrsig)
70
50
$( usev lowmem ' --with-ecmult-window=2 --with-ecmult-gen-precision=2' )
71
51
$( usev precompute-ecmult ' --with-ecmult-window=24 --with-ecmult-gen-precision=8' )
72
52
$( use_with valgrind)
73
53
)
54
+ if use asm; then
55
+ if use arm; then
56
+ myeconfargs+=( --with-asm=arm )
57
+ else
58
+ myeconfargs+=( --with-asm=auto )
59
+ fi
60
+ else
61
+ myeconfargs+=( --with-asm=no )
62
+ fi
74
63
75
64
econf " ${myeconfargs[@]} "
76
65
}
77
66
78
67
src_install () {
79
68
default
80
-
81
69
find " ${ED} " -name ' *.la' -delete || die
82
70
}
0 commit comments