Skip to content

Commit

Permalink
docs: corrected freebsd.md and openbsd.md (#914)
Browse files Browse the repository at this point in the history
Co-authored-by: Jakub 'Eremiell' Marek <[email protected]>
  • Loading branch information
Jaskowicz1 and Eremiell authored Oct 3, 2023
1 parent f0eff6c commit 409c2c3
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 36 deletions.
64 changes: 46 additions & 18 deletions docpages/building/freebsd.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,74 @@
\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`

## 2. Install External Dependencies
Your FreeBSD base system should have all the required dependencies installed by default.
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:

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
## 4. Install Globally

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

## 5. Installation to a different directory
## 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
## 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
* `-std=c++17` - Required to compile the headers
* `-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
27 changes: 9 additions & 18 deletions docpages/building/openbsd.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
\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:

```bash
pkg_add cmake
```

## 2. Install Voice Dependencies (Optional)

If you wish to use voice support, you'll need to do the following:

```bash
Expand All @@ -23,13 +27,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 +43,8 @@ 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
## 6. Using the Library

\include{doc} install_prebuilt_footer.dox
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 409c2c3

Please sign in to comment.