Explorar o código

package/bitcoin: add the wallet support option

The bitcoin Buildroot package has always disabled the wallet support.

This commit adds a config option to enable this support. This allows the
bitcoin-cli command to create wallets, generate addresses and send an
amount to a given address.

Signed-off-by: Julien Olivain <ju.o@free.fr>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
Julien Olivain hai 1 ano
pai
achega
958085d5f6
Modificáronse 2 ficheiros con 24 adicións e 1 borrados
  1. 10 0
      package/bitcoin/Config.in
  2. 14 1
      package/bitcoin/bitcoin.mk

+ 10 - 0
package/bitcoin/Config.in

@@ -36,6 +36,16 @@ config BR2_PACKAGE_BITCOIN
 
 	  https://bitcoincore.org
 
+if BR2_PACKAGE_BITCOIN
+
+config BR2_PACKAGE_BITCOIN_WALLET
+	bool "wallet support"
+	select BR2_PACKAGE_SQLITE
+	help
+	  Enable bitcoin wallet support.
+
+endif
+
 comment "bitcoin needs a toolchain w/ C++, threads, wchar, gcc >= 9"
 	depends on BR2_PACKAGE_BITCOIN_ARCH_SUPPORTS
 	depends on BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS

+ 14 - 1
package/bitcoin/bitcoin.mk

@@ -13,14 +13,27 @@ BITCOIN_CPE_ID_VENDOR = bitcoin
 BITCOIN_CPE_ID_PRODUCT = bitcoin_core
 BITCOIN_DEPENDENCIES = host-pkgconf boost libevent
 BITCOIN_MAKE_ENV = BITCOIN_GENBUILD_NO_GIT=1
+# Berkeley Database (bdb) support is always disabled. It is only
+# needed for legacy wallet format. New wallets are using SQLite.
 BITCOIN_CONF_OPTS = \
 	--disable-bench \
-	--disable-wallet \
 	--disable-tests \
 	--with-boost-libdir=$(STAGING_DIR)/usr/lib/ \
 	--disable-hardening \
+	--without-bdb \
 	--without-gui
 
+ifeq ($(BR2_PACKAGE_BITCOIN_WALLET),y)
+BITCOIN_DEPENDENCIES += sqlite
+BITCOIN_CONF_OPTS += \
+	--enable-wallet \
+	--with-sqlite
+else
+BITCOIN_CONF_OPTS += \
+	--disable-wallet \
+	--without-sqlite
+endif
+
 ifeq ($(BR2_PACKAGE_LIBMINIUPNPC),y)
 BITCOIN_DEPENDENCIES += libminiupnpc
 BITCOIN_CONF_OPTS += --with-miniupnpc