Skip to content

Commit 86f2007

Browse files
committed
Merge #20527: build: Do not ignore Homebrew's SQLite on macOS
c932e0d doc: Update wallet database installation guide for macOS (Hennadii Stepanov) ee7b84e build: Use Homebrew's sqlite package if it is available (Hennadii Stepanov) c96d1f6 build, refactor: Check that Homebrew's qt5 package is actually installed (Hennadii Stepanov) Pull request description: On master (7ae86b3) installed Homebrew `sqlite` package is ignored during build on macOS. This PR fixes this issue and update macOS build docs. Closes #20498. ACKs for top commit: willcl-ark: > > That said, another tACK of [c932e0d](bitcoin/bitcoin@c932e0d) hebasto: > That said, another tACK of [c932e0d](bitcoin/bitcoin@c932e0d) laanwj: Code review ACK c932e0d jonasschnelli: code review re-ACK c932e0d Tree-SHA512: 2563f25534d065556b17ee8c0fca957aea61b5ae288a2aa72743e77607843a45c39f209321e0f05b34283a74d2edcf961cf1dc54a35ed0cc21182304bb961505
2 parents 8e1f9d6 + c932e0d commit 86f2007

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

configure.ac

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -645,16 +645,19 @@ case $host in
645645
dnl It's safe to add these paths even if the functionality is disabled by
646646
dnl the user (--without-wallet or --without-gui for example).
647647

648-
qt5_prefix=$($BREW --prefix qt5 2>/dev/null)
649-
if $BREW list --versions berkeley-db4 >/dev/null && test "x$BDB_CFLAGS" = "x" && test "x$BDB_LIBS" = "x" && test "$use_bdb" != "no"; then
648+
if test "x$use_bdb" != xno && $BREW list --versions berkeley-db4 >/dev/null && test "x$BDB_CFLAGS" = "x" && test "x$BDB_LIBS" = "x"; then
650649
bdb_prefix=$($BREW --prefix berkeley-db4 2>/dev/null)
651650
dnl This must precede the call to BITCOIN_FIND_BDB48 below.
652651
BDB_CFLAGS="-I$bdb_prefix/include"
653652
BDB_LIBS="-L$bdb_prefix/lib -ldb_cxx-4.8"
654653
fi
655-
if test x$qt5_prefix != x; then
656-
PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
657-
export PKG_CONFIG_PATH
654+
655+
if test "x$use_sqlite" != xno && $BREW list --versions sqlite3 >/dev/null; then
656+
export PKG_CONFIG_PATH="$($BREW --prefix sqlite3 2>/dev/null)/lib/pkgconfig:$PKG_CONFIG_PATH"
657+
fi
658+
659+
if $BREW list --versions qt5 >/dev/null; then
660+
export PKG_CONFIG_PATH="$($BREW --prefix qt5 2>/dev/null)/lib/pkgconfig:$PKG_CONFIG_PATH"
658661
fi
659662
fi
660663
else

doc/build-osx.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Then install [Homebrew](https://brew.sh).
1919

2020
## Dependencies
2121
```shell
22-
brew install automake berkeley-db4 libtool boost miniupnpc pkg-config python qt libevent qrencode sqlite
22+
brew install automake libtool boost miniupnpc pkg-config python qt libevent qrencode
2323
```
2424

2525
If you run into issues, check [Homebrew's troubleshooting page](https://docs.brew.sh/Troubleshooting).
@@ -30,7 +30,22 @@ If you want to build the disk image with `make deploy` (.dmg / optional), you ne
3030
brew install librsvg
3131
```
3232

33-
## Berkeley DB
33+
The wallet support requires one or both of the dependencies ([*SQLite*](#sqlite) and [*Berkeley DB*](#berkeley-db)) in the sections below.
34+
To build Bitcoin Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode).
35+
36+
#### SQLite
37+
38+
Usually, macOS installation already has a suitable SQLite installation.
39+
Also, the Homebrew package could be installed:
40+
41+
```shell
42+
brew install sqlite
43+
```
44+
45+
In that case the Homebrew package will prevail.
46+
47+
#### Berkeley DB
48+
3449
It is recommended to use Berkeley DB 4.8. If you have to build it yourself,
3550
you can use [this](/contrib/install_db4.sh) script to install it
3651
like so:
@@ -41,7 +56,11 @@ like so:
4156

4257
from the root of the repository.
4358

44-
**Note**: You only need Berkeley DB if the wallet is enabled (see [*Disable-wallet mode*](/doc/build-osx.md#disable-wallet-mode)).
59+
Also, the Homebrew package could be installed:
60+
61+
```shell
62+
brew install berkeley-db4
63+
```
4564

4665
## Build Bitcoin Core
4766

@@ -72,14 +91,14 @@ from the root of the repository.
7291
make deploy
7392
```
7493

75-
## `disable-wallet` mode
94+
## Disable-wallet mode
7695
When the intention is to run only a P2P node without a wallet, Bitcoin Core may be
77-
compiled in `disable-wallet` mode with:
96+
compiled in disable-wallet mode with:
7897
```shell
7998
./configure --disable-wallet
8099
```
81100

82-
In this case there is no dependency on Berkeley DB 4.8 and SQLite.
101+
In this case there is no dependency on [*Berkeley DB*](#berkeley-db) and [*SQLite*](#sqlite).
83102

84103
Mining is also possible in disable-wallet mode using the `getblocktemplate` RPC call.
85104

0 commit comments

Comments
 (0)