Skip to content

Commit b7101b2

Browse files
committed
doc: rewrite OpenBSD build guide for CMake and Qt6
- Replace legacy build instructions with the modern CMake workflow. - Add specific `pkg_add` dependency lists for both Headless and GUI builds. - specific instructions for enabling Qt6 and XFCE integration. - Include necessary system configuration steps (doas/sudo, wheel group, and messagebus).
1 parent 39ca18a commit b7101b2

File tree

2 files changed

+70
-66
lines changed

2 files changed

+70
-66
lines changed

doc/build-openbsd.md

Lines changed: 69 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,103 @@
11
# OpenBSD build guide
22

3-
The guide below was for autotools and is outdated and deprecated. Folks using OpenBSD may be able to use this and adapt the cmake build procedure in the main build doc, [build.md](build.md) for the Linux Native build target. The Gridcoin Team encourages anyone getting a modern OpenBSD (7.8, for example) to work with Gridcoin to submit an issue on Github documenting what you did to get it to work, or if you are familiar with pull request creation, a PR with changes to this file with the correct procedure that works.
3+
This guide details how to build Gridcoin on OpenBSD. While this is not checked in CI/CD, it has been verified to work as of the 5.5.0.0 release.
44

5-
===================
5+
## 1. Install Dependencies
66

7-
## Deprecated Guide
7+
Run the following commands as root (or using `doas`) to install the necessary build tools and libraries.
88

9-
(updated for OpenBSD 7.0)
9+
```ksh
10+
# Basic build requirements and libraries
11+
pkg_add git cmake boost curl libzip miniupnpc
1012

11-
This guide describes how to build gridcoinresearchd, command-line utilities, and GUI on OpenBSD.
13+
# If you prefer sudo over the native doas (optional)
14+
pkg_add sudo
15+
````
1216

13-
Preparation
14-
-----------
17+
### Note on Sudo vs. Doas
1518

16-
Run the following as root to install the base dependencies for building:
19+
OpenBSD uses `doas` by default. If you prefer `sudo`:
1720

18-
```bash
19-
pkg_add cmake vim
20-
# or
21-
pkg_add autoconf automake gmake libtool python
21+
1. Ensure your user is in the `wheel` group:
22+
```ksh
23+
# Replace 'jco' with your username
24+
usermod -G wheel jco
25+
```
26+
2. Edit the sudoers file using `visudo` and find the line:
27+
`## Uncomment to allow members of group wheel to execute any command`
2228

23-
pkg_add boost curl libzip leveldb pkgconf
24-
pkg_add qt5 libqrencode # optional for the GUI
25-
```
29+
Uncomment the following line, which should be similar to
30+
`%wheel ALL=(ALL) ALL`
2631

27-
Resource limits
28-
---------------
32+
and save the file with `:wq!`
2933

30-
If the build runs into out-of-memory errors, the instructions in this section
31-
might help.
34+
## 2\. Clone the Repository
3235

33-
The standard ulimit restrictions in OpenBSD are very strict:
36+
```ksh
37+
git clone [https://github.com/gridcoin-community/Gridcoin-Research.git](https://github.com/gridcoin-community/Gridcoin-Research.git)
38+
cd Gridcoin-Research
39+
git checkout master
40+
```
3441

35-
data(kbytes) 1572864
42+
-----
3643

37-
This is, unfortunately, in some cases not enough to compile some `.cpp` files in the project,
38-
(see [Bitcoin#6658](https://github.com/bitcoin/bitcoin/issues/6658)).
39-
If your user is in the `staff` group the limit can be raised with:
44+
## 3\. Build Configuration
4045

41-
ulimit -d 3000000
46+
Choose **Option A** (Headless/Daemon) or **Option B** (GUI Wallet).
4247

43-
The change will only affect the current shell and processes spawned by it. To
44-
make the change system-wide, change `datasize-cur` and `datasize-max` in
45-
`/etc/login.conf`, and reboot.
48+
### Option A: Headless (Daemon only)
4649

47-
### Building Gridcoin
50+
Use this configuration for servers or command-line only environments.
4851

49-
**Important**: use `gmake`, not `make`. The non-GNU `make` will exit with a horrible error.
52+
```ksh
53+
# Configure
54+
cmake -B build -DENABLE_GUI=off -DENABLE_TESTS=on -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_PIE=on -DENABLE_UPNP=on
5055
51-
To configure with gridcoinresearchd:
56+
# Build
57+
# Replace <# of cpus> with your core count, e.g., -j4
58+
cmake --build build -j <# of cpus>
5259
53-
* With CMake:
60+
# Install (Optional)
61+
doas cmake --install build
62+
```
5463

55-
```bash
56-
mkdir build && cd build
57-
cmake ..
58-
```
64+
### Option B: GUI Wallet (Qt6)
5965

60-
* With Autotools:
66+
Use this configuration for a desktop environment.
6167

62-
```bash
63-
./autogen.sh
64-
./configure --with-gui=no \
65-
MAKE=gmake
66-
```
68+
**Additional GUI Dependencies:**
6769

68-
To configure with GUI:
70+
```ksh
71+
# Qt6 framework
72+
pkg_add qt6
6973
70-
* With CMake:
74+
# Desktop Environment extras (Optional - for a full XFCE experience)
75+
pkg_add xfce xfce-extras
7176
72-
```bash
73-
mkdir build && cd build
74-
cmake -DENABLE_GUI=ON
75-
```
77+
# VMware helper (Optional - install only if running OpenBSD in a VMware VM)
78+
pkg_add vmwh
79+
```
7680

77-
* With Autotools:
81+
**System Services:**
82+
Qt6 and modern GUI applications require the message bus (dbus) to be running.
7883

79-
```bash
80-
./autogen.sh
81-
./configure --with-gui=yes \
82-
MAKE=gmake
83-
```
84+
```ksh
85+
rcctl enable messagebus
86+
rcctl start messagebus
87+
```
8488

85-
Build and run the tests:
89+
**Build & Install:**
8690

87-
* With CMake:
91+
```ksh
92+
# Configure
93+
# Note: Remove -DENABLE_QRENCODE=on if you do not have qrencode installed
94+
cmake -B build -DENABLE_GUI=on -DENABLE_TESTS=on -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_QT6=on -DENABLE_PIE=on -DENABLE_QRENCODE=on -DENABLE_UPNP=on
8895
89-
```bash
90-
cmake --build . # use "-j N" here for N parallel jobs
91-
ctest .
92-
```
96+
# Build
97+
cmake --build build -j <# of cpus>
9398
94-
* With Autotools:
99+
# Install (Optional)
100+
# This will install binaries and assets (icons, desktop files)
101+
doas cmake --install build
102+
```
95103

96-
```bash
97-
gmake # use "-j N" here for N parallel jobs
98-
gmake check
99-
```

doc/build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ for various build targets:
1414
| **macOS** | CMake | **Stable** | [build-macos.md](build-macos.md) |
1515
| **MSYS2** | CMake | *Deprecated* | [build-msys2.md](build-msys2.md) |
1616
| **FreeBSD** | CMake | *Experimental* | [build-freebsd.md](build-freebsd.md) |
17-
| **OpenBSD** | CMake | *Experimental* | [build-openbsd.md](build-openbsd.md) |
17+
| **OpenBSD** | CMake | **Stable but not checked in CI/CD** | [build-openbsd.md](build-openbsd.md) |
1818

1919
This document covers these build targets:
2020

0 commit comments

Comments
 (0)