|
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 |
4 | 2 |
|
5 | | -This guide describes how to build dashd and command-line utilities on NetBSD. |
| 3 | +Updated for NetBSD [9.2](https://netbsd.org/releases/formal-9/NetBSD-9.2.html). |
6 | 4 |
|
7 | | -This guide does not contain instructions for building the GUI. |
| 5 | +This guide describes how to build dashd, command-line utilities, and GUI on NetBSD. |
8 | 6 |
|
9 | 7 | **This guide has not been tested for building Dash Core and is expected to fail due to missing `bls_dash` and `backtrace`. Please report your results; contributions welcome.** |
10 | 8 |
|
11 | | -Preparation |
12 | | -------------- |
| 9 | +## Preparation |
13 | 10 |
|
14 | | -You will need the following modules, which can be installed via pkgsrc or pkgin: |
| 11 | +### 1. Install Required Dependencies |
| 12 | + |
| 13 | +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). |
| 14 | +The example commands below use `pkgin`. |
| 15 | + |
| 16 | +```bash |
| 17 | +pkgin install autoconf automake libtool pkg-config git gmake boost libevent gmp |
15 | 18 |
|
16 | 19 | ``` |
17 | | -autoconf |
18 | | -automake |
19 | | -boost |
20 | | -git |
21 | | -gmake |
22 | | -gmp |
23 | | -libevent |
24 | | -libtool |
25 | | -pkg-config |
26 | | -python37 |
27 | 20 |
|
28 | | -git clone https://github.com/dashpay/dash.git |
| 21 | +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. |
| 22 | + |
| 23 | +For example, grab `gcc9`: |
| 24 | +``` |
| 25 | +pkgin install gcc9 |
| 26 | +``` |
| 27 | + |
| 28 | +Then, when configuring, pass the following: |
| 29 | +```bash |
| 30 | +./configure |
| 31 | + ... |
| 32 | + CC="/usr/pkg/gcc9/bin/gcc" \ |
| 33 | + CXX="/usr/pkg/gcc9/bin/g++" \ |
| 34 | + ... |
29 | 35 | ``` |
30 | 36 |
|
31 | 37 | See [dependencies.md](dependencies.md) for a complete overview. |
32 | 38 |
|
33 | | -### Building Dash Core |
| 39 | +### 2. Clone Dash Core Repo |
34 | 40 |
|
35 | | -**Important**: Use `gmake` (the non-GNU `make` will exit with an error). |
| 41 | +Clone the Dash Core repository to a directory. All build scripts and commands will run from this directory. |
36 | 42 |
|
37 | | -#### With descriptor wallet: |
| 43 | +```bash |
| 44 | +git clone https://github.com/dashpay/dash.git |
| 45 | +``` |
| 46 | + |
| 47 | +### 3. Install Optional Dependencies |
| 48 | + |
| 49 | +#### Wallet Dependencies |
| 50 | + |
| 51 | +It is not necessary to build wallet functionality to run dashd or the GUI. |
| 52 | + |
| 53 | +###### Descriptor Wallet Support |
| 54 | + |
| 55 | +`sqlite3` is required to enable support for [descriptor wallets](https://github.com/dashpay/dash/blob/master/doc/descriptors.md). |
38 | 56 |
|
39 | | -The descriptor wallet uses `sqlite3`. You can install it using: |
40 | 57 | ```bash |
41 | 58 | pkgin install sqlite3 |
42 | 59 | ``` |
43 | 60 |
|
| 61 | +###### Legacy Wallet Support |
| 62 | + |
| 63 | +`db4` is required to enable support for legacy wallets. |
| 64 | + |
44 | 65 | ```bash |
45 | | -./autogen.sh |
46 | | -./configure --with-gui=no --without-bdb \ |
47 | | - CPPFLAGS="-I/usr/pkg/include" \ |
48 | | - LDFLAGS="-L/usr/pkg/lib" \ |
49 | | - BOOST_CPPFLAGS="-I/usr/pkg/include" \ |
50 | | - MAKE=gmake |
| 66 | +pkgin install db4 |
51 | 67 | ``` |
52 | 68 |
|
53 | | -#### With legacy wallet: |
54 | | - |
55 | | -BerkeleyDB is use for legacy wallet functionality. |
| 69 | +#### GUI Dependencies |
56 | 70 |
|
57 | | -It is recommended to use Berkeley DB 4.8. You cannot use the BerkeleyDB library |
58 | | -from ports. |
59 | | -You can use [the installation script included in contrib/](/contrib/install_db4.sh) like so: |
| 71 | +Dash Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install `qt5`. |
60 | 72 |
|
61 | 73 | ```bash |
62 | | -./contrib/install_db4.sh `pwd` |
| 74 | +pkgin install qt5 |
63 | 75 | ``` |
64 | 76 |
|
65 | | -from the root of the repository. Then set `BDB_PREFIX` for the next section: |
| 77 | +The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install `qrencode`. |
66 | 78 |
|
67 | 79 | ```bash |
68 | | -export BDB_PREFIX="$PWD/db4" |
| 80 | +pkgin install qrencode |
69 | 81 | ``` |
70 | 82 |
|
| 83 | +#### Test Suite Dependencies |
| 84 | + |
| 85 | +There is an included test suite that is useful for testing code changes when developing. |
| 86 | +To run the test suite (recommended), you will need to have Python 3 installed: |
| 87 | + |
71 | 88 | ```bash |
72 | | -./autogen.sh |
73 | | -./configure --with-gui=no CPPFLAGS="-I/usr/pkg/include" \ |
74 | | - LDFLAGS="-L/usr/pkg/lib" \ |
75 | | - BOOST_CPPFLAGS="-I/usr/pkg/include" \ |
76 | | - BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" \ |
77 | | - BDB_CFLAGS="-I${BDB_PREFIX}/include" \ |
78 | | - MAKE=gmake |
| 89 | +pkgin install python37 |
79 | 90 | ``` |
80 | 91 |
|
81 | | -#### Without wallet: |
| 92 | +### Building Dash Core |
| 93 | + |
| 94 | +**Note**: Use `gmake` (the non-GNU `make` will exit with an error). |
| 95 | + |
| 96 | + |
| 97 | +### 1. Configuration |
| 98 | + |
| 99 | +There are many ways to configure Dash Core. Here is an example that |
| 100 | +explicitly disables the wallet and GUI: |
| 101 | + |
82 | 102 | ```bash |
83 | 103 | ./autogen.sh |
84 | | -./configure --with-gui=no --disable-wallet \ |
| 104 | +./configure --without-wallet --with-gui=no \ |
85 | 105 | CPPFLAGS="-I/usr/pkg/include" \ |
86 | | - LDFLAGS="-L/usr/pkg/lib" \ |
87 | | - BOOST_CPPFLAGS="-I/usr/pkg/include" \ |
88 | 106 | MAKE=gmake |
89 | 107 | ``` |
90 | 108 |
|
| 109 | +For a full list of configuration options, see the output of `./configure --help` |
| 110 | + |
| 111 | +### 2. Compile |
| 112 | + |
91 | 113 | Build and run the tests: |
| 114 | + |
92 | 115 | ```bash |
93 | 116 | gmake # use "-j N" here for N parallel jobs |
94 | | -gmake check |
| 117 | +gmake check # Run tests if Python 3 is available |
95 | 118 | ``` |
0 commit comments