Skip to content

Commit c175690

Browse files
jarolrodvasild
andcommitted
doc: Update for FreeBSD 12.2, add GUI Build Instructions
The current FreeBSD Build documentation is a little outdated and underwhelming. This PR updates the doc to be more informative. It also adds new instructions for building the GUI and adding support for descriptor wallets. on vasild's recommendation: it is ok to point the user to download db5 which has an active port package instead of building db4 from the provided script. Co-authored-by: Vasil Dimov <[email protected]>
1 parent 1a9fa4c commit c175690

File tree

1 file changed

+90
-22
lines changed

1 file changed

+90
-22
lines changed

doc/build-freebsd.md

+90-22
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,127 @@
1-
FreeBSD build guide
2-
======================
3-
(updated for FreeBSD 12.0)
1+
# FreeBSD Build Guide
42

5-
This guide describes how to build bitcoind and command-line utilities on FreeBSD.
3+
**Updated for FreeBSD [12.2](https://www.freebsd.org/releases/12.2R/announce.html)**
64

7-
This guide does not contain instructions for building the GUI.
5+
This guide describes how to build bitcoind, command-line utilities, and GUI on FreeBSD.
6+
7+
## Dependencies
8+
9+
The following dependencies are **required**:
10+
11+
Library | Purpose | Description
12+
----------------------------------------------------------------------|------------|----------------------
13+
[autoconf](https://svnweb.freebsd.org/ports/head/devel/autoconf/) | Build | Automatically configure software source code
14+
[automake](https://svnweb.freebsd.org/ports/head/devel/automake/) | Build | Generate makefile (requires autoconf)
15+
[libtool](https://svnweb.freebsd.org/ports/head/devel/libtool/) | Build | Shared library support
16+
[pkgconf](https://svnweb.freebsd.org/ports/head/devel/pkgconf/) | Build | Configure compiler and linker flags
17+
[git](https://svnweb.freebsd.org/ports/head/devel/git/) | Clone | Version control system
18+
[gmake](https://svnweb.freebsd.org/ports/head/devel/gmake/) | Compile | Generate executables
19+
[boost-libs](https://svnweb.freebsd.org/ports/head/devel/boost-libs/) | Utility | Library for threading, data structures, etc
20+
[libevent](https://svnweb.freebsd.org/ports/head/devel/libevent/) | Networking | OS independent asynchronous networking
21+
22+
23+
The following dependencies are **optional**:
24+
25+
Library | Purpose | Description
26+
---------------------------------------------------------------------------|------------------|----------------------
27+
[db5](https://svnweb.freebsd.org/ports/head/databases/db5/) | Berkeley DB | Wallet storage (only needed when wallet enabled)
28+
[qt5](https://svnweb.freebsd.org/ports/head/devel/qt5/) | GUI | GUI toolkit (only needed when GUI enabled)
29+
[libqrencode](https://svnweb.freebsd.org/ports/head/graphics/libqrencode/) | QR codes in GUI | Generating QR codes (only needed when GUI enabled)
30+
[libzmq4](https://svnweb.freebsd.org/ports/head/net/libzmq4/) | ZMQ notification | Allows generating ZMQ notifications (requires ZMQ version >= 4.0.0)
31+
[sqlite3](https://svnweb.freebsd.org/ports/head/databases/sqlite3/) | SQLite DB | Wallet storage (only needed when wallet enabled)
32+
[python3](https://svnweb.freebsd.org/ports/head/lang/python3/) | Testing | Python Interpreter (only needed when running the test suite)
33+
34+
See [dependencies.md](dependencies.md) for a complete overview.
835

936
## Preparation
1037

11-
You will need the following dependencies, which can be installed as root via pkg:
38+
### 1. Install Required Dependencies
39+
Install the required dependencies the usual way you [install software on FreeBSD](https://www.freebsd.org/doc/en/books/handbook/ports.html) - either with `pkg` or via the Ports collection. The example commands below use `pkg` which is usually run as `root` or via `sudo`. If you want to use `sudo`, and you haven't set it up: [use this guide](http://www.freebsdwiki.net/index.php/Sudo%2C_configuring) to setup `sudo` access on FreeBSD.
1240

1341
```bash
1442
pkg install autoconf automake boost-libs git gmake libevent libtool pkgconf
1543

44+
```
45+
46+
### 2. Clone Bitcoin Repo
47+
Now that `git` and all the required dependencies are installed, let's clone the Bitcoin Core repository to a directory. All build scripts and commands will run from this directory.
48+
``` bash
1649
git clone https://github.com/bitcoin/bitcoin.git
1750
```
1851

19-
In order to run the test suite (recommended), you will need to have Python 3 installed:
52+
### 3. Install Optional Dependencies
53+
54+
#### Wallet Dependencies
55+
It is not necessary to build wallet functionality to run bitcoind or the GUI. To enable legacy wallets, you must install `db5`. To enable [descriptor wallets](https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md), `sqlite3` is required. Skip `db5` if you intend to *exclusively* use descriptor wallets
56+
57+
###### Legacy Wallet Support
58+
`db5` is required to enable support for legacy wallets. Skip if you don't intend to use legacy wallets
2059

2160
```bash
22-
pkg install python3
61+
pkg install db5
2362
```
2463

25-
See [dependencies.md](dependencies.md) for a complete overview.
64+
###### Descriptor Wallet Support
2665

27-
### Building BerkeleyDB
66+
`sqlite3` is required to enable support for descriptor wallets. Skip if you don't intend to use descriptor wallets.
67+
``` bash
68+
pkg install sqlite3
69+
```
70+
---
2871

29-
BerkeleyDB is only necessary for the wallet functionality. To skip this, pass
30-
`--disable-wallet` to `./configure` and skip to the next section.
72+
#### GUI Dependencies
73+
###### Qt5
3174

75+
Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install `qt5`. Skip if you don't intend to use the GUI.
3276
```bash
33-
./contrib/install_db4.sh `pwd`
34-
export BDB_PREFIX="$PWD/db4"
77+
pkg install qt5
3578
```
79+
###### libqrencode
80+
81+
The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install `libqrencode`. Skip if not using the GUI or don't want QR code functionality.
82+
```bash
83+
pkg install libqrencode
84+
```
85+
---
86+
87+
#### Test Suite Dependencies
88+
There is an included test suite that is useful for testing code changes when developing.
89+
To run the test suite (recommended), you will need to have Python 3 installed:
90+
91+
```bash
92+
pkg install python3
93+
```
94+
---
3695

3796
## Building Bitcoin Core
3897

39-
**Important**: Use `gmake` (the non-GNU `make` will exit with an error).
98+
### 1. Configuration
4099

41-
With wallet:
100+
There are many ways to configure Bitcoin Core, here are a few common examples:
101+
##### Wallet (BDB + SQlite) Support, No GUI:
102+
This explicitly enables legacy wallet support and disables the GUI. If `sqlite3` is installed, then descriptor wallet support will be built.
42103
```bash
43104
./autogen.sh
44-
./configure --with-gui=no \
45-
BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" \
46-
BDB_CFLAGS="-I${BDB_PREFIX}/include" \
105+
./configure --with-gui=no --with-incompatible-bdb \
106+
BDB_LIBS="-ldb_cxx-5" \
107+
BDB_CFLAGS="-I/usr/local/include/db5" \
47108
MAKE=gmake
48109
```
49110

50-
Without wallet:
111+
##### Wallet (only SQlite) and GUI Support:
112+
This explicitly enables the GUI and disables legacy wallet support. If `qt5` is not installed, this will throw an error. If `sqlite3` is installed then descriptor wallet functionality will be built. If `sqlite3` is not installed, then wallet functionality will be disabled.
51113
```bash
52114
./autogen.sh
53-
./configure --with-gui=no --disable-wallet MAKE=gmake
115+
./configure --without-bdb --with-gui=yes MAKE=gmake
116+
```
117+
##### No Wallet or GUI
118+
``` bash
119+
./autogen.sh
120+
./configure --without-wallet --with-gui=no MAKE=gmake
54121
```
55122

56-
followed by:
123+
### 2. Compile
124+
**Important**: Use `gmake` (the non-GNU `make` will exit with an error).
57125

58126
```bash
59127
gmake # use -jX here for parallelism

0 commit comments

Comments
 (0)