Skip to content

Commit d3e9a1c

Browse files
committed
doc: update for NetBSD 9.2, add GUI Build Instructions
NetBSD doc has not seen any meaningful contribution since 2018. This PR intends to update the docs so that one can successfully build on the latest NetBSD release. It also adds dependency information and instructions to build the GUI.
1 parent 195e07f commit d3e9a1c

File tree

1 file changed

+73
-49
lines changed

1 file changed

+73
-49
lines changed

doc/build-netbsd.md

+73-49
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,116 @@
1-
NetBSD Build Guide
2-
======================
3-
**Updated for NetBSD [8.0](https://www.netbsd.org/releases/formal-8/NetBSD-8.0.html)**
1+
# NetBSD Build Guide
42

5-
This guide describes how to build bitcoind and command-line utilities on NetBSD.
3+
Updated for NetBSD [9.2](https://netbsd.org/releases/formal-9/NetBSD-9.2.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 NetBSD.
86

9-
Preparation
10-
-------------
7+
## Preparation
118

12-
You will need the following modules, which can be installed via pkgsrc or pkgin:
9+
### 1. Install Required Dependencies
10+
11+
Install the required dependencies the usual way you [install software on NetBSD](https://www.netbsd.org/docs/guide/en/chap-boot.html#chap-boot-pkgsrc).
12+
The example commands below use `pkgin`.
13+
14+
```bash
15+
pkgin install autoconf automake libtool pkg-config git gmake boost libevent
1316

1417
```
15-
autoconf
16-
automake
17-
boost
18-
git
19-
gmake
20-
libevent
21-
libtool
22-
pkg-config
23-
python37
2418

25-
git clone https://github.com/bitcoin/bitcoin.git
19+
NetBSD currently ships with an older version of `gcc` than is needed to build. You should upgrade your `gcc` and then pass this new version to the configure script.
20+
21+
For example, grab `gcc9`:
22+
```
23+
pkgin install gcc9
24+
```
25+
26+
Then, when configuring, pass the following:
27+
```bash
28+
./configure
29+
...
30+
CC="/usr/pkg/gcc9/bin/gcc" \
31+
CXX="/usr/pkg/gcc9/bin/g++" \
32+
...
2633
```
2734

2835
See [dependencies.md](dependencies.md) for a complete overview.
2936

30-
### Building Bitcoin Core
37+
### 2. Clone Bitcoin Repo
3138

32-
**Important**: Use `gmake` (the non-GNU `make` will exit with an error).
39+
Clone the Bitcoin Core repository to a directory. All build scripts and commands will run from this directory.
3340

34-
#### With descriptor wallet:
41+
```bash
42+
git clone https://github.com/bitcoin/bitcoin.git
43+
```
44+
45+
### 3. Install Optional Dependencies
46+
47+
#### Wallet Dependencies
48+
49+
It is not necessary to build wallet functionality to run bitcoind or the GUI.
50+
51+
###### Descriptor Wallet Support
52+
53+
`sqlite3` is required to enable support for [descriptor wallets](https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md).
3554

36-
The descriptor wallet uses `sqlite3`. You can install it using:
3755
```bash
3856
pkgin install sqlite3
3957
```
4058

59+
###### Legacy Wallet Support
60+
61+
`db4` is required to enable support for legacy wallets.
62+
4163
```bash
42-
./autogen.sh
43-
./configure --with-gui=no --without-bdb \
44-
CPPFLAGS="-I/usr/pkg/include" \
45-
LDFLAGS="-L/usr/pkg/lib" \
46-
BOOST_CPPFLAGS="-I/usr/pkg/include" \
47-
MAKE=gmake
64+
pkgin install db4
4865
```
4966

50-
#### With legacy wallet:
51-
52-
BerkeleyDB is use for legacy wallet functionality.
67+
#### GUI Dependencies
5368

54-
It is recommended to use Berkeley DB 4.8. You cannot use the BerkeleyDB library
55-
from ports.
56-
You can use [the installation script included in contrib/](/contrib/install_db4.sh) like so:
69+
Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install `qt5`.
5770

5871
```bash
59-
./contrib/install_db4.sh `pwd`
72+
pkgin install qt5
6073
```
6174

62-
from the root of the repository. Then set `BDB_PREFIX` for the next section:
75+
The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install `qrencode`.
6376

6477
```bash
65-
export BDB_PREFIX="$PWD/db4"
78+
pkgin install qrencode
6679
```
6780

81+
#### Test Suite Dependencies
82+
83+
There is an included test suite that is useful for testing code changes when developing.
84+
To run the test suite (recommended), you will need to have Python 3 installed:
85+
6886
```bash
69-
./autogen.sh
70-
./configure --with-gui=no CPPFLAGS="-I/usr/pkg/include" \
71-
LDFLAGS="-L/usr/pkg/lib" \
72-
BOOST_CPPFLAGS="-I/usr/pkg/include" \
73-
BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" \
74-
BDB_CFLAGS="-I${BDB_PREFIX}/include" \
75-
MAKE=gmake
87+
pkgin install python37
7688
```
7789

78-
#### Without wallet:
90+
### Building Bitcoin Core
91+
92+
**Note**: Use `gmake` (the non-GNU `make` will exit with an error).
93+
94+
95+
### 1. Configuration
96+
97+
There are many ways to configure Bitcoin Core. Here is an example that
98+
explicitly disables the wallet and GUI:
99+
79100
```bash
80101
./autogen.sh
81-
./configure --with-gui=no --disable-wallet \
102+
./configure --without-wallet --with-gui=no \
82103
CPPFLAGS="-I/usr/pkg/include" \
83-
LDFLAGS="-L/usr/pkg/lib" \
84-
BOOST_CPPFLAGS="-I/usr/pkg/include" \
85104
MAKE=gmake
86105
```
87106

107+
For a full list of configuration options, see the output of `./configure --help`
108+
109+
### 2. Compile
110+
88111
Build and run the tests:
112+
89113
```bash
90114
gmake # use "-j N" here for N parallel jobs
91-
gmake check
115+
gmake check # Run tests if Python 3 is available
92116
```

0 commit comments

Comments
 (0)