Skip to content

Commit

Permalink
docs: corrected freebsd and openbsd pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaskowicz1 committed Oct 3, 2023
1 parent 1d9e94e commit 8672cc4
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 36 deletions.
58 changes: 41 additions & 17 deletions docpages/building/freebsd.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,70 @@
\page buildfreebsd Building on FreeBSD

\note This page assumes you are the root user. If you are not, start the package install commands with `sudo`, along with `make install`. You will need `sudo` installed if you are not the root user.

## 1. Toolchain
This project uses CMake. Install it with `pkg install cmake`
Since the project uses `CMake`, you'll need to install it! If you don't have it, you can do the following:

```bash
pkg install cmake
```

## 2. Install Voice Dependencies (Optional)
If you wish to use voice support, you'll need to install opus and libsodium:

## 2. Install External Dependencies
Your FreeBSD base system should have all the required dependencies installed by default.
First, you need to install opus.
```bash
cd /usr/ports/audio/opus
make && make install
```

For voice support, additional dependencies are required
Then, you need to install libsodium.

pkg install libsodium opus pkgconf
```bash
cd /usr/ports/security/libsodium
make && make install
```

## 3. Build Source Code

cmake -B ./build
cmake --build ./build -j8
```bash
cmake -B ./build
cmake --build ./build -j8
```

Replace the number after `-j` with a number suitable for your setup, usually the same as the number of cores on your machine. `cmake` will fetch any dependencies that are required for you and ensure they are compiled alongside the library.

## 4. Install globally

cd build; make install

## 5. Installation to a different directory
```bash
cd build
make install
```

## 5. Installation to a different directory (Optional)
If you want to install the library, its dependencies and header files to a different directory, specify this directory when running `cmake`:

cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install
```bash
cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install
```

Then once the build is complete, run `make install` to install to the location you specified.
Then once the build is complete, run `sudo make install` to install to the location you specified.

## 6. Using the library

Once installed, you can make use of the library in standalone programs simply by including it and linking to it:

clang++ -std=c++17 -ldpp mydppbot.cpp -o dppbot
```bash
clang++ -std=c++17 -L/usr/local/lib -I/usr/local/include -ldpp bot.cpp -o dppbot
```

The important flags in this command-line are:

* `-std=c++17` - Required to compile the headers
* `-ldpp` - Link to libdpp.dylib
* `mydppbot.cpp` - Your source code
* `dppbot` - The name of the executable to make
* `-L/usr/local/lib` - Required to tell the linker where libdpp is located.
* `-I/usr/local/include` - Required to tell the linker where dpp headers are located.
* `-ldpp` - Link to `libdpp.so`.
* `bot.cpp` - Your source code.
* `-o dppbot` - The name of the executable to make.

\include{doc} install_prebuilt_footer.dox

Expand Down
26 changes: 7 additions & 19 deletions docpages/building/openbsd.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
\page buildopenbsd Building on OpenBSD

\note This page assumes you are the root user. If you are not, start the package install commands with `doas`, along with `make install`.

## 1. Toolchain
Since the project uses `CMake`, you'll need to install it! If you don't have it, you can do the following:

Expand All @@ -23,13 +25,13 @@ cmake --build ./build -j8

Replace the number after `-j` with a number suitable for your setup, usually the same as the number of cores on your machine. `cmake` will fetch any dependencies that are required for you and ensure they are compiled alongside the library.

## 2. Install globally
## 4. Install globally

```bash
cd build; sudo make install
cd build; make install
```

## 3. Installation to a different directory
## 5. Installation to a different directory

If you want to install the library, its dependencies and header files to a different directory, specify this directory when running `cmake`:

Expand All @@ -39,21 +41,7 @@ cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install

Then once the build is complete, run `make install` to install to the location you specified.

## 4. Using the library

Once installed to the `/usr/local` directory, you can make use of the library in standalone programs simply by including it and linking to it:

```bash
clang++ -std=c++17 mydppbot.cpp -o dppbot -ldpp
```

The important flags in this command-line are:

* `-std=c++17` - Required to compile the headers
* `-ldpp` - Link to libdpp.dylib
* `mydppbot.cpp` - Your source code
* `dppbot` - The name of the executable to make

\include{doc} install_prebuilt_footer.dox
## 6. Using the library
Once installed to the `/usr/local` directory, you can make use of the library in CMake, without linking to a folder! You can't use this with `clang++`, nor `g++`, as OpenBSD seems to be broken on this end, so your only option from here is to use CMake. This isn't a bad thing, as we recommend people to use CMake anyways!

**Have fun!**

0 comments on commit 8672cc4

Please sign in to comment.