Skip to content

Commit 19f301d

Browse files
committed
Merge #16871: build: make building protobuf optional in depends
107e030 build: make protobuf optional in depends (fanquake) ff6122f doc: clarify protobuf build requirements (fanquake) Pull request description: As mentioned by dongcarl in bitcoin/bitcoin#15584 (comment), make building `protobuf` optional in depends. With this change it will only be built if you pass `PROTOBUF=1`. ACKs for top commit: laanwj: code review ACK 107e030 Sjors: tACK 107e030 on macOS 10.14. When I build depends with `PROTOBUF=1` then `./configure` has `bip70` enabled. Tree-SHA512: 49bc247a6879aaf55b943a3d0b930544ddef1e69a481955a8bebe0b02c9ad0fe168b93025f34168334cef34bb567478eb98eacab62ba909f2f64fb21119c71b8
2 parents a953429 + 107e030 commit 19f301d

File tree

7 files changed

+18
-6
lines changed

7 files changed

+18
-6
lines changed

ci/test/00_setup_env_i686.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
export LC_ALL=C.UTF-8
88

99
export HOST=i686-pc-linux-gnu
10+
export DEP_OPTS="PROTOBUF=1"
1011
export PACKAGES="g++-multilib python3-zmq"
1112
export GOAL="install"
1213
export BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-bip70 --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++"

depends/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ WORK_PATH = $(BASEDIR)/work
55
BASE_CACHE ?= $(BASEDIR)/built
66
SDK_PATH ?= $(BASEDIR)/SDKs
77
NO_QT ?=
8+
PROTOBUF ?=
89
RAPIDCHECK ?=
910
NO_WALLET ?=
1011
NO_ZMQ ?=
@@ -96,13 +97,15 @@ wallet_packages_$(NO_WALLET) = $(wallet_packages)
9697
upnp_packages_$(NO_UPNP) = $(upnp_packages)
9798
zmq_packages_$(NO_ZMQ) = $(zmq_packages)
9899

100+
protobuf_packages_$(PROTOBUF) = $(protobuf_packages)
99101
rapidcheck_packages_$(RAPIDCHECK) = $(rapidcheck_packages)
100102

101103
packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_)
102104
native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages)
103105

104-
ifneq ($(qt_packages_),)
105-
native_packages += $(qt_native_packages)
106+
ifeq ($(protobuf_packages_),)
107+
native_packages += $(protobuf_native_packages)
108+
packages += $(protobuf_packages)
106109
endif
107110

108111
ifneq ($(zmq_packages_),)
@@ -150,6 +153,7 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
150153
-e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \
151154
-e 's|@no_qt@|$(NO_QT)|' \
152155
-e 's|@no_zmq@|$(NO_ZMQ)|' \
156+
-e 's|@enable_bip70@|$(PROTOBUF)|' \
153157
-e 's|@no_wallet@|$(NO_WALLET)|' \
154158
-e 's|@no_upnp@|$(NO_UPNP)|' \
155159
-e 's|@debug@|$(DEBUG)|' \

depends/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ The following can be set when running make: make FOO=bar
7777
NO_UPNP: Don't download/build/cache packages needed for enabling upnp
7878
DEBUG: disable some optimizations and enable more runtime checking
7979
RAPIDCHECK: build rapidcheck (experimental, requires cmake)
80+
PROTOBUF: build protobuf (used for deprecated BIP70 support)
8081
HOST_ID_SALT: Optional salt to use when generating host package ids
8182
BUILD_ID_SALT: Optional salt to use when generating build package ids
8283

depends/config.site.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ if test -z $enable_zmq && test -n "@no_zmq@"; then
3737
enable_zmq=no
3838
fi
3939

40+
if test -n $enable_bip70 && test -n "@enable_bip70@"; then
41+
enable_bip70=yes
42+
fi
43+
4044
if test x@host_os@ = xdarwin; then
4145
BREW=no
4246
PORT=no

depends/packages/packages.mk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
packages:=boost openssl libevent
22

3-
qt_native_packages = native_protobuf
4-
qt_packages = qrencode protobuf zlib
3+
protobuf_native_packages = native_protobuf
4+
protobuf_packages = protobuf
5+
6+
qt_packages = qrencode zlib
57

68
qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig
79

doc/build-unix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Optional dependencies:
4444
miniupnpc | UPnP Support | Firewall-jumping support
4545
libdb4.8 | Berkeley DB | Wallet storage (only needed when wallet enabled)
4646
qt | GUI | GUI toolkit (only needed when GUI enabled)
47-
protobuf | Payments in GUI | Data interchange format used for payment protocol (only needed when GUI enabled)
47+
protobuf | Payments in GUI | Data interchange format used for payment protocol (only needed when BIP70 enabled)
4848
libqrencode | QR codes in GUI | Optional for generating QR codes (only needed when GUI enabled)
4949
univalue | Utility | JSON parsing and encoding (bundled version will be used unless --with-system-univalue passed to configure)
5050
libzmq3 | ZMQ notification | Optional, allows generating ZMQ notifications (requires ZMQ version >= 4.0.0)

doc/dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Some dependencies are not needed in all configurations. The following are some f
3535
#### Options passed to `./configure`
3636
* MiniUPnPc is not needed with `--with-miniupnpc=no`.
3737
* Berkeley DB is not needed with `--disable-wallet`.
38-
* protobuf is not needed with `--disable-bip70`.
38+
* protobuf is only needed with `--enable-bip70`.
3939
* Qt is not needed with `--without-gui`.
4040
* If the qrencode dependency is absent, QR support won't be added. To force an error when that happens, pass `--with-qrencode`.
4141
* ZeroMQ is needed only with the `--with-zmq` option.

0 commit comments

Comments
 (0)