dev-libs/libsecp256k1: bump to 0.7.0

Note: This release switches from Autotools to CMake.

See: https://github.com/bitcoin-core/secp256k1/releases/tag/v0.7.0
Signed-off-by: Matt Whitlock <gentoo@mattwhitlock.name>
Part-of: https://github.com/gentoo/gentoo/pull/43104
Closes: https://github.com/gentoo/gentoo/pull/43104
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Matt Whitlock
2025-07-21 16:47:47 -04:00
committed by Sam James
parent 151c5f26c2
commit 6a34251e0d
3 changed files with 86 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
DIST libsecp256k1-0.5.1.tar.gz 1962518 BLAKE2B edff454529755c5de4f7a5192235b7e461426cc05da83ba1be03a3f9f4327397ae96b11bbf4250cd09165a1a6bd5383b928d4374713c47ef930de0af11cfc772 SHA512 5cba94794ac9c0e9a72111958562690bfb79b1ccd3071e0aaa22c4c6a4fe4007b87e402c00bbab1bdc93f31490d4b528d7ac368870ac05de12ee76db8313e510
DIST libsecp256k1-0.6.0.tar.gz 1996783 BLAKE2B 6c8ec26bd3d10f463ac4aeed4aa092718a8101012d9ae0b8931166a4bec717f9d5bdc2c8ef21395f6ce2285828871deefa1e47299654d19634c9398d7447acea SHA512 bccaa15295b0633e1fe5a4a4d7a80be812e40c8ed815be4f0d3f3348a5e185633c599cd50b7461a3584f89aea94f6d5321772876c5146553e2732df8b72becc2
DIST libsecp256k1-0.7.0.tar.gz 2143012 BLAKE2B 5255c1740812bdf3248c87c40f4efaf63bdd0cdc61b863961bc313dde3e95f1804a3634c78dd06551ed62b770d2664966c10aee98e4c4fe2902b2d7300d6d043 SHA512 1e07587df5e693b59410b019e6ece961891faa234ebf91577a0cee4307f6fa18d7bf87873410e74693990b9464eb46157d0bdfb527a11bf679a8a579e01443fe

View File

@@ -0,0 +1,84 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake edo toolchain-funcs
MyPN=secp256k1
DESCRIPTION="Optimized C library for EC operations on curve secp256k1"
HOMEPAGE="https://github.com/bitcoin-core/secp256k1"
SRC_URI="https://github.com/bitcoin-core/secp256k1/archive/v${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${MyPN}-${PV}"
LICENSE="MIT"
SLOT="0/6" # subslot is "$((_LIB_VERSION_CURRENT-_LIB_VERSION_AGE))" from configure.ac
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
IUSE="asm +ecdh +ellswift experimental +extrakeys lowmem musig +recovery +schnorr test test-full valgrind"
RESTRICT="!test? ( test )"
REQUIRED_USE="
asm? ( || ( amd64 arm ) arm? ( experimental ) )
musig? ( schnorr )
schnorr? ( extrakeys )
test-full? ( test )
"
BDEPEND="
>=dev-build/cmake-3.22
virtual/pkgconfig
valgrind? ( dev-debug/valgrind )
"
PATCHES=(
)
DOCS=(
README.md
doc/safegcd_implementation.md
)
src_prepare() {
cmake_src_prepare
# Generation of the precomputed tables has not been migrated to CMake.
rm -f src/precomputed_ecmult.c src/precomputed_ecmult_gen.c || die
local precompute_defines=(
# These magic numbers come from configure.ac.
-DECMULT_WINDOW_SIZE=$(usex lowmem 4 15)
-DCOMB_BLOCKS=$(usex lowmem 2 43)
-DCOMB_TEETH=$(usex lowmem 5 6)
-DVERIFY
)
tc-env_build emake -C src precompute_ecmult{,_gen} CPPFLAGS+="${precompute_defines[*]}"
edo src/precompute_ecmult
edo src/precompute_ecmult_gen
}
src_configure() {
local mycmakeargs=(
-DSECP256K1_BUILD_BENCHMARK=OFF
-DSECP256K1_EXPERIMENTAL=$(usex experimental)
-DSECP256K1_BUILD_TESTS=$(usex test)
-DSECP256K1_BUILD_EXHAUSTIVE_TESTS=$(usex test-full)
-DSECP256K1_ENABLE_MODULE_ECDH=$(usex ecdh)
-DSECP256K1_ENABLE_MODULE_ELLSWIFT=$(usex ellswift)
-DSECP256K1_ENABLE_MODULE_EXTRAKEYS=$(usex extrakeys)
-DSECP256K1_ENABLE_MODULE_MUSIG=$(usex musig)
-DSECP256K1_ENABLE_MODULE_RECOVERY=$(usex recovery)
-DSECP256K1_ENABLE_MODULE_SCHNORRSIG=$(usex schnorr)
-DSECP256K1_ASM=$(usex asm "$(usex arm arm32 AUTO)" OFF)
-DSECP256K1_VALGRIND=$(usex valgrind ON OFF)
)
use lowmem && mycmakeargs+=(
-DSECP256K1_ECMULT_WINDOW_SIZE=4
-DSECP256K1_ECMULT_GEN_KB=2
)
cmake_src_configure
}
src_install() {
use ellswift && DOCS+=( doc/ellswift.md )
use musig && DOCS+=( doc/musig.md )
cmake_src_install
}

View File

@@ -22,6 +22,7 @@
<flag name="musig">Enable MuSig2 module</flag>
<flag name="recovery">Enable ECDSA pubkey recovery module</flag>
<flag name="schnorr">Enable Schnorr signature module</flag>
<flag name="test-full">Enable exhaustive tests</flag>
</use>
<upstream>
<remote-id type="github">bitcoin-core/secp256k1</remote-id>