commit:     91fe002717045ce64aabe093c241f3c878f27510
Author:     Matt Whitlock <gentoo <AT> mattwhitlock <DOT> name>
AuthorDate: Fri Mar 15 01:03:43 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 15 04:04:01 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91fe0027

net-p2p/bitcoin-core: add unkeyworded 27.0_rc1 + bump 26.1_rc{1=>2}

Signed-off-by: Matt Whitlock <gentoo <AT> mattwhitlock.name>
Closes: https://github.com/gentoo/gentoo/pull/35764
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-p2p/bitcoin-core/Manifest                      |   5 +-
 ...6.1_rc1.ebuild => bitcoin-core-26.1_rc2.ebuild} |   0
 ...6.1_rc1.ebuild => bitcoin-core-27.0_rc1.ebuild} |  14 +-
 net-p2p/bitcoin-core/files/27.0-syslibs.patch      | 296 +++++++++++++++++++++
 4 files changed, 306 insertions(+), 9 deletions(-)

diff --git a/net-p2p/bitcoin-core/Manifest b/net-p2p/bitcoin-core/Manifest
index 1bf4be169a74..d6dcb289c108 100644
--- a/net-p2p/bitcoin-core/Manifest
+++ b/net-p2p/bitcoin-core/Manifest
@@ -1,4 +1,5 @@
 DIST bitcoin-25.1.tar.gz 12498596 BLAKE2B 
e8e4ea99cb40db420033c4df75e985af93cbb64f9862376e2de1a0731b4aeafbf43a95b33770e882ad77b73e454d48dbd5744902c78ade2b965e3d2d4e4b4656
 SHA512 
310e5d976a062496d2b99d0e64c4d5d2b536a747901e887f85b75151d94237f0de800163b534c812d390eb5e93b3f7284cd7f71843ec35e891f34634b6b142ab
-DIST bitcoin-core-25.2_rc1.tar.gz 12499745 BLAKE2B 
db05eb84f80aebfcbb269367ac95f8e9f710210ddb99ea44755344260be3000e0c41cf9e458fb66288f8e206a376f63b2e486ff430daee4719d201b2c18f435e
 SHA512 
40c1b13f887d7229742155d48946e42adedf1431d92acc322426a4df38625f7acabff226a70d2a864ea12d34a16b67d657db3274891c313534c46f64e7b07a3a
 DIST bitcoin-26.0.tar.gz 12753904 BLAKE2B 
35b5d40390dc5eab18a12b0f120619d40d9d0eaf4a59f5ed943a59189c0ede5d78207b7606f1c3490b90f14c17e87882242d6637fdc348005a6f60a1d8202d13
 SHA512 
31b7bc66b43d073611ccf19adc80a4dd3ce3a4b5cf4c8b814f4be9e771e88721d20ae0aa83d89cd8d55ffaf0853444479932b425e82081fd66bb037c6b53e4a8
-DIST bitcoin-core-26.1_rc1.tar.gz 12816436 BLAKE2B 
05a3c774901f75368a42f4f81b2dcf181efc1db4f82b230bca1c5f78ee9a310e00654960fdab368eb169bbc283628f9c5a020d1e7c7abcad6fe15ca4feba01c5
 SHA512 
5f93bc3061e93c57d65c00c458c39ede19e1908a25804b2191ed4866a7cf92438b068de15e8685a37d38608d750be3ce64d3e7cc22418e27b47ed65d9bcb7557
+DIST bitcoin-core-25.2_rc1.tar.gz 12499745 BLAKE2B 
db05eb84f80aebfcbb269367ac95f8e9f710210ddb99ea44755344260be3000e0c41cf9e458fb66288f8e206a376f63b2e486ff430daee4719d201b2c18f435e
 SHA512 
40c1b13f887d7229742155d48946e42adedf1431d92acc322426a4df38625f7acabff226a70d2a864ea12d34a16b67d657db3274891c313534c46f64e7b07a3a
+DIST bitcoin-core-26.1_rc2.tar.gz 12823146 BLAKE2B 
92d193936475fd2bf8f4cb2e823546a5b51722dd80e035fbbdd1e501b9d65cfcc25f2ff60afd0702030c57e572af92bc16eae1a9a27aad7d588b5f4e77697b8c
 SHA512 
4d77fd5fa05b53be0a0b67f6c999fedfec28c7264ed65e6173a7ab9fe1586bfc4d7947fca2a7466dbd23ebb771da5cfb6383f072f15120b2645ad8430647a5bf
+DIST bitcoin-core-27.0_rc1.tar.gz 13084690 BLAKE2B 
c4fe8de0ae8e46a5ce9f00ef0274a1ddb7bc6c448b467224375fe5f317e3af0a12a53b704b56ed4f77cfd3efd043349905e72ada1cc12db82e72be5e07374d17
 SHA512 
515fb0ad1dfce7d1a3b580a0200cebe6a51a267210c1218e6c601048c3ce64be52e20aa662f97183deb9d0e4e36ac23fe989f8189458c9755000c02c825353fc

diff --git a/net-p2p/bitcoin-core/bitcoin-core-26.1_rc1.ebuild 
b/net-p2p/bitcoin-core/bitcoin-core-26.1_rc2.ebuild
similarity index 100%
copy from net-p2p/bitcoin-core/bitcoin-core-26.1_rc1.ebuild
copy to net-p2p/bitcoin-core/bitcoin-core-26.1_rc2.ebuild

diff --git a/net-p2p/bitcoin-core/bitcoin-core-26.1_rc1.ebuild 
b/net-p2p/bitcoin-core/bitcoin-core-27.0_rc1.ebuild
similarity index 98%
rename from net-p2p/bitcoin-core/bitcoin-core-26.1_rc1.ebuild
rename to net-p2p/bitcoin-core/bitcoin-core-27.0_rc1.ebuild
index cf31b6360f4b..71f4e9421dd1 100644
--- a/net-p2p/bitcoin-core/bitcoin-core-26.1_rc1.ebuild
+++ b/net-p2p/bitcoin-core/bitcoin-core-27.0_rc1.ebuild
@@ -43,11 +43,11 @@ RDEPEND="
        )
        gui? (
                !net-p2p/bitcoin-qt
-               >=dev-qt/qtcore-5.15.10:5
-               >=dev-qt/qtgui-5.15.10:5
-               >=dev-qt/qtnetwork-5.15.10:5
-               >=dev-qt/qtwidgets-5.15.10:5
-               dbus? ( >=dev-qt/qtdbus-5.15.10:5 )
+               >=dev-qt/qtcore-5.15.11:5
+               >=dev-qt/qtgui-5.15.11:5
+               >=dev-qt/qtnetwork-5.15.11:5
+               >=dev-qt/qtwidgets-5.15.11:5
+               dbus? ( >=dev-qt/qtdbus-5.15.11:5 )
        )
        libs? ( !net-libs/libbitcoinconsensus )
        nat-pmp? ( >=net-libs/libnatpmp-20220705:= )
@@ -68,7 +68,7 @@ BDEPEND="
                acct-group/bitcoin
                acct-user/bitcoin
        )
-       gui? ( >=dev-qt/linguist-tools-5.15.10:5 )
+       gui? ( >=dev-qt/linguist-tools-5.15.11:5 )
        test? ( ${PYTHON_DEPS} )
 "
 IDEPEND="
@@ -93,7 +93,7 @@ DOCS=(
 )
 
 PATCHES=(
-       "${FILESDIR}/26.0-syslibs.patch"
+       "${FILESDIR}/27.0-syslibs.patch"
        "${FILESDIR}/26.0-init.patch"
 )
 

diff --git a/net-p2p/bitcoin-core/files/27.0-syslibs.patch 
b/net-p2p/bitcoin-core/files/27.0-syslibs.patch
new file mode 100644
index 000000000000..984e9b5181fb
--- /dev/null
+++ b/net-p2p/bitcoin-core/files/27.0-syslibs.patch
@@ -0,0 +1,296 @@
+From d7d37c944809f8f957e7ad043b540feb4f25503c Mon Sep 17 00:00:00 2001
+From: Matt Whitlock <bitc...@mattwhitlock.name>
+Date: Sun, 17 Sep 2023 10:29:27 -0400
+Subject: [PATCH] support linking against system-installed leveldb and
+ libsecp256k1
+
+- Abort if runtime leveldb != compiled-against leveldb.
+
+Originally based on 22.0-fix_build_without_leveldb.patch.
+---
+ configure.ac              | 90 ++++++++++++++++++++++++++++++++++++++-
+ src/Makefile.am           | 13 +++++-
+ src/Makefile.test.include |  2 +
+ src/dbwrapper.cpp         | 27 +++++++++++-
+ src/dbwrapper.h           |  8 ++++
+ src/kernel/checks.cpp     |  7 +++
+ 6 files changed, 143 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index d39006be33..ee7b092131 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1291,6 +1291,41 @@ if test "$enable_fuzz_binary" = "yes"; then
+      ]])])
+ fi
+ 
++dnl Check for libsecp256k1, only if explicitly requested
++AC_ARG_WITH([system-libsecp256k1],
++  [AS_HELP_STRING([[--with-system-libsecp256k1[=PKG]]],
++    [build using system-installed libsecp256k1 instead of bundled, passing 
PKG (default: libsecp256k1) to pkg-config (default is no; DANGEROUS; NOT 
SUPPORTED)])],
++  [AS_IF([test "x$withval" = xyes], [with_system_libsecp256k1=libsecp256k1])],
++  [with_system_libsecp256k1=no])
++AM_CONDITIONAL([EMBEDDED_LIBSECP256K1],[test "x$with_system_libsecp256k1" = 
xno])
++AM_COND_IF([EMBEDDED_LIBSECP256K1], [
++  libsecp256k1_CFLAGS='-I$(srcdir)/secp256k1/include'
++  libsecp256k1_LIBS='secp256k1/libsecp256k1.la'
++], [
++  saved_CPPFLAGS=$CPPFLAGS
++  saved_LIBS=$LIBS
++  PKG_CHECK_MODULES([libsecp256k1], [$with_system_libsecp256k1])
++  CPPFLAGS="$libsecp256k1_CFLAGS $CPPFLAGS"
++  LIBS="$libsecp256k1_LIBS $LIBS"
++  missing_modules=
++  AC_DEFUN([CHECK_MODULE], [
++    AC_CHECK_HEADER([secp256k1_$1.h],
++      [AC_CHECK_FUNCS([$2], [], [missing_modules="${missing_modules} $1"])],
++      [missing_modules="${missing_modules} $1"])
++  ])
++  CHECK_MODULE([ellswift], [secp256k1_ellswift_encode])
++  CHECK_MODULE([extrakeys], [secp256k1_xonly_pubkey_parse])
++  CHECK_MODULE([recovery], [secp256k1_ecdsa_recover])
++  CHECK_MODULE([schnorrsig], [secp256k1_schnorrsig_verify])
++  AS_IF([test -n "${missing_modules}"], [
++    AC_MSG_ERROR([system-installed libsecp256k1 does not support these 
required modules:${missing_modules}])
++  ])
++  CPPFLAGS=$saved_CPPFLAGS
++  LIBS=$saved_LIBS
++])
++AC_SUBST(libsecp256k1_CFLAGS)
++AC_SUBST(libsecp256k1_LIBS)
++
+ if test "$enable_wallet" != "no"; then
+     dnl Check for libdb_cxx only if wallet enabled
+     if test "$use_bdb" != "no"; then
+@@ -1350,6 +1385,55 @@ if test 
"$build_bitcoind$bitcoin_enable_qt$use_bench$use_tests" = "nononono"; th
+   use_zmq=no
+ fi
+ 
++dnl Check for leveldb, only if explicitly requested
++AC_ARG_WITH([system-leveldb],
++  [AS_HELP_STRING([--with-system-leveldb],
++    [Build with system LevelDB (default is no; DANGEROUS; NOT SUPPORTED)])],
++  [system_leveldb=$withval],
++  [system_leveldb=no])
++AC_ARG_VAR([leveldb_CFLAGS],[C compiler flags for system-leveldb])
++AC_ARG_VAR([leveldb_LIBS],[linker flags for system-leveldb])
++AS_IF([test x$system_leveldb != xno],[
++  TEMP_CPPFLAGS="$CPPFLAGS"
++  TEMP_LIBS="$LIBS"
++  CPPFLAGS="$leveldb_CFLAGS"
++  LIBS="$leveldb_LIBS"
++  AC_SEARCH_LIBS([leveldb_open],[leveldb],[leveldb_LIBS="$LIBS"],
++    [AC_MSG_ERROR([leveldb library not found; using --with-system-leveldb is 
not supported anyway])])
++  AC_CHECK_HEADER([leveldb/filter_policy.h],[],
++    [AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is 
not supported anyway])])
++  AC_CHECK_HEADER([leveldb/helpers/memenv.h],[],
++    [AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is 
not supported anyway])])
++
++  AC_MSG_CHECKING([for library containing leveldb::NewMemEnv])
++  for searchlib in "" "-lmemenv" ERR; do
++    if test "x$searchlib" = "xERR"; then
++      AC_MSG_RESULT([no])
++      AC_MSG_ERROR([LevelDB's memenv helper not found; using 
--with-system-leveldb is not supported anyway])
++    fi
++    LIBS="$searchlib $leveldb_LIBS"
++    AC_LINK_IFELSE([AC_LANG_PROGRAM([
++        #include <leveldb/env.h>
++        #include <leveldb/helpers/memenv.h>
++      ],[
++        leveldb::Env *myenv = leveldb::NewMemEnv(leveldb::Env::Default());
++        delete myenv;
++      ])
++    ],[
++      AC_MSG_RESULT([$searchlib])
++      break
++    ])
++  done
++  leveldb_LIBS="$LIBS"
++  LIBS="$TEMP_LIBS"
++  CPPFLAGS="$TEMP_CPPFLAGS"
++],[
++  AC_DEFINE([EMBEDDED_LEVELDB],[1],[Define to use the bundled LevelDB 
sources])
++])
++AM_CONDITIONAL([EMBEDDED_LEVELDB],[test x$system_leveldb = xno])
++AC_SUBST(leveldb_CFLAGS)
++AC_SUBST(leveldb_LIBS)
++
+ dnl Check for libminiupnpc (optional)
+ if test "$use_upnp" != "no"; then
+   TEMP_CPPFLAGS="$CPPFLAGS"
+@@ -1897,8 +1981,10 @@ CPPFLAGS="$CPPFLAGS_TEMP"
+ if test -n "$use_sanitizers"; then
+   export SECP_CFLAGS="$SECP_CFLAGS $SANITIZER_CFLAGS"
+ fi
+-ac_configure_args="${ac_configure_args} --disable-shared --with-pic 
--enable-benchmark=no --enable-module-recovery --disable-module-ecdh"
+-AC_CONFIG_SUBDIRS([src/secp256k1])
++AM_COND_IF([EMBEDDED_LIBSECP256K1],[
++  ac_configure_args="${ac_configure_args} --disable-shared --with-pic 
--enable-benchmark=no --enable-module-recovery --disable-module-ecdh"
++  AC_CONFIG_SUBDIRS([src/secp256k1])
++])
+ 
+ AC_OUTPUT
+ 
+diff --git a/src/Makefile.am b/src/Makefile.am
+index b5d5c4652a..91dec582e2 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -24,7 +24,7 @@ check_PROGRAMS =
+ TESTS =
+ BENCHMARKS =
+ 
+-BITCOIN_INCLUDES=-I$(builddir) -I$(srcdir)/$(MINISKETCH_INCLUDE_DIR_INT) 
-I$(srcdir)/secp256k1/include -I$(srcdir)/$(UNIVALUE_INCLUDE_DIR_INT)
++BITCOIN_INCLUDES=-I$(builddir) -I$(srcdir)/$(MINISKETCH_INCLUDE_DIR_INT) 
$(libsecp256k1_CFLAGS) -I$(srcdir)/$(UNIVALUE_INCLUDE_DIR_INT)
+ 
+ LIBBITCOIN_NODE=libbitcoin_node.a
+ LIBBITCOIN_COMMON=libbitcoin_common.a
+@@ -33,7 +33,11 @@ LIBBITCOIN_CLI=libbitcoin_cli.a
+ LIBBITCOIN_UTIL=libbitcoin_util.a
+ LIBBITCOIN_CRYPTO_BASE=crypto/libbitcoin_crypto_base.la
+ LIBBITCOINQT=qt/libbitcoinqt.a
++if EMBEDDED_LIBSECP256K1
+ LIBSECP256K1=secp256k1/libsecp256k1.la
++else
++LIBSECP256K1=$(libsecp256k1_LIBS)
++endif
+ 
+ if ENABLE_ZMQ
+ LIBBITCOIN_ZMQ=libbitcoin_zmq.a
+@@ -68,8 +72,10 @@ LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_ARM_SHANI)
+ endif
+ noinst_LTLIBRARIES += $(LIBBITCOIN_CRYPTO)
+ 
++if EMBEDDED_LIBSECP256K1
+ $(LIBSECP256K1): $(wildcard secp256k1/src/*.h) $(wildcard secp256k1/src/*.c) 
$(wildcard secp256k1/include/*)
+       $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
++endif
+ 
+ # Make is not made aware of per-object dependencies to avoid limiting 
building parallelization
+ # But to build the less dependent modules first, we manually select their 
order here:
+@@ -1132,8 +1138,13 @@ endif
+ 
+ include Makefile.minisketch.include
+ 
++if EMBEDDED_LEVELDB
+ include Makefile.crc32c.include
+ include Makefile.leveldb.include
++else
++LEVELDB_CPPFLAGS = $(leveldb_CFLAGS)
++LIBLEVELDB = $(leveldb_LIBS)
++endif
+ 
+ include Makefile.test_util.include
+ include Makefile.test_fuzz.include
+diff --git a/src/Makefile.test.include b/src/Makefile.test.include
+index 9f9bdbbd0c..3585e16bbe 100644
+--- a/src/Makefile.test.include
++++ b/src/Makefile.test.include
+@@ -435,7 +435,9 @@ if ENABLE_BENCH
+       $(BENCH_BINARY) -sanity-check -priority-level=high
+ endif
+ endif
++if EMBEDDED_LIBSECP256K1
+       $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
++endif
+ 
+ if ENABLE_TESTS
+ UNIVALUE_TESTS = univalue/test/object univalue/test/unitester
+diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp
+index 775496e21b..1304b2a2b3 100644
+--- a/src/dbwrapper.cpp
++++ b/src/dbwrapper.cpp
+@@ -22,7 +22,11 @@
+ #include <leveldb/db.h>
+ #include <leveldb/env.h>
+ #include <leveldb/filter_policy.h>
+-#include <leveldb/helpers/memenv/memenv.h>
++#if EMBEDDED_LEVELDB
++# include <leveldb/helpers/memenv/memenv.h>
++#else
++# include <leveldb/helpers/memenv.h>
++#endif
+ #include <leveldb/iterator.h>
+ #include <leveldb/options.h>
+ #include <leveldb/slice.h>
+@@ -51,6 +55,27 @@ static void HandleError(const leveldb::Status& status)
+     throw dbwrapper_error(errmsg);
+ }
+ 
++#if !EMBEDDED_LEVELDB
++#include <node/interface_ui.h>
++#include <util/translation.h>
++#include <leveldb/c.h>
++bool dbwrapper_SanityCheck()
++{
++    unsigned long header_version = (leveldb::kMajorVersion << 16) | 
leveldb::kMinorVersion;
++    unsigned long library_version = (leveldb_major_version() << 16) | 
leveldb_minor_version();
++
++    if (header_version != library_version) {
++        InitError(Untranslated(strprintf("Compiled with LevelDB %d.%d, but 
linked with LevelDB %d.%d (incompatible).",
++            leveldb::kMajorVersion, leveldb::kMinorVersion,
++            leveldb_major_version(), leveldb_minor_version()
++        )));
++        return false;
++    }
++
++    return true;
++}
++#endif
++
+ class CBitcoinLevelDBLogger : public leveldb::Logger {
+ public:
+     // This code is adapted from posix_logger.h, which is why it is using 
vsprintf.
+diff --git a/src/dbwrapper.h b/src/dbwrapper.h
+index 63c2f99d2a..406d03f1ea 100644
+--- a/src/dbwrapper.h
++++ b/src/dbwrapper.h
+@@ -5,6 +5,10 @@
+ #ifndef BITCOIN_DBWRAPPER_H
+ #define BITCOIN_DBWRAPPER_H
+ 
++#if defined(HAVE_CONFIG_H)
++#include <config/bitcoin-config.h>
++#endif
++
+ #include <attributes.h>
+ #include <serialize.h>
+ #include <span.h>
+@@ -46,6 +50,10 @@ struct DBParams {
+     DBOptions options{};
+ };
+ 
++#if !EMBEDDED_LEVELDB
++bool dbwrapper_SanityCheck();
++#endif
++
+ class dbwrapper_error : public std::runtime_error
+ {
+ public:
+diff --git a/src/kernel/checks.cpp b/src/kernel/checks.cpp
+index bf8a2ec74c..640deb2415 100644
+--- a/src/kernel/checks.cpp
++++ b/src/kernel/checks.cpp
+@@ -4,6 +4,7 @@
+ 
+ #include <kernel/checks.h>
+ 
++#include <dbwrapper.h>
+ #include <key.h>
+ #include <random.h>
+ #include <util/time.h>
+@@ -15,6 +16,12 @@ namespace kernel {
+ 
+ util::Result<void> SanityChecks(const Context&)
+ {
++#if !EMBEDDED_LEVELDB
++    if (!dbwrapper_SanityCheck()) {
++        return util::Error{Untranslated("Database sanity check failure. 
Aborting.")};
++    }
++#endif
++
+     if (!ECC_InitSanityCheck()) {
+         return util::Error{Untranslated("Elliptic curve cryptography sanity 
check failure. Aborting.")};
+     }
+-- 
+2.44.0
+

Reply via email to