Skip to content

Commit c86101b

Browse files
committed
dev-libs/libsecp256k1: trivial/aesthetic touchups
Signed-off-by: Matt Whitlock <[email protected]>
1 parent 631bb82 commit c86101b

File tree

1 file changed

+19
-31
lines changed

1 file changed

+19
-31
lines changed

dev-libs/libsecp256k1/libsecp256k1-0.2.0-r1.ebuild

+19-31
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,30 @@ EAPI=8
55

66
inherit autotools
77

8-
MY_PN=${PN##lib}
9-
8+
MyPN=secp256k1
109
DESCRIPTION="Optimized C library for EC operations on curve secp256k1"
1110
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"
2012

2113
LICENSE="MIT"
22-
SLOT="0/1"
14+
SLOT="0/1" # subslot is "$((_LIB_VERSION_CURRENT-_LIB_VERSION_AGE))" from configure.ac
2315
KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
2416
IUSE="+asm ecdh experimental +extrakeys lowmem precompute-ecmult +schnorr +recovery test valgrind"
2517
RESTRICT="!test? ( test )"
18+
2619
REQUIRED_USE="
2720
?? ( lowmem precompute-ecmult )
28-
asm? (
29-
|| ( amd64 arm )
30-
)
21+
asm? ( || ( amd64 arm ) arm? ( experimental ) )
3122
schnorr? ( extrakeys )
3223
"
33-
3424
BDEPEND="
3525
virtual/pkgconfig
3626
test? ( dev-libs/openssl )
3727
valgrind? ( dev-util/valgrind )
3828
"
3929

30+
S="${WORKDIR}/${MyPN}-${PV}"
31+
4032
src_prepare() {
4133
default
4234
eautoreconf
@@ -46,37 +38,33 @@ src_prepare() {
4638
}
4739

4840
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-
6041
local myeconfargs=(
6142
--disable-benchmark
6243
$(use_enable experimental)
6344
$(use_enable test tests)
6445
$(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)
6949
$(use_enable schnorr module-schnorrsig)
7050
$(usev lowmem '--with-ecmult-window=2 --with-ecmult-gen-precision=2')
7151
$(usev precompute-ecmult '--with-ecmult-window=24 --with-ecmult-gen-precision=8')
7252
$(use_with valgrind)
7353
)
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
7463

7564
econf "${myeconfargs[@]}"
7665
}
7766

7867
src_install() {
7968
default
80-
8169
find "${ED}" -name '*.la' -delete || die
8270
}

0 commit comments

Comments
 (0)