Skip to content

Commit

Permalink
docs: changes to buildlinux, firstbot, and install-arch-aur. (#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishank authored Nov 26, 2023
1 parent b25ba69 commit 9c7acbc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
24 changes: 20 additions & 4 deletions docpages/building/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

\note You might not need to build a copy of the library for Linux - precompiled deb files for 64 bit and 32 bit Debian and Ubuntu are provided in the GitHub version releases. Unless you are on a different Linux distribution which does not support the installation of deb files, or wish to submit fixes and enhancements to the library itself you should have an easier time installing the precompiled version instead.

## 1. Build Source Code

## 1. Copy & Build Source code
```bash
git clone https://github.com/brainboxdotcc/DPP
cd DPP/
cmake -B ./build
cmake --build ./build -j8
```
Expand All @@ -23,7 +24,7 @@ sudo make install
If you want to install the library, its dependencies, and header files to a different directory, specify this directory when running `cmake`:

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

Then once the build is complete, run `make install` to install to the location you specified.
Expand All @@ -36,12 +37,27 @@ Once installed to the `/usr/local` directory, you can make use of the library in
g++ -std=c++17 mydppbot.cpp -o dppbot -ldpp
```

If you are on **Arch Linux**, you will need to add `/usr/local` to your environment variables:

```bash
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export CPLUS_INCLUDE_PATH=/usr/local/include:$CPLUS_INCLUDE_PATH
```

However, if you don't want to change your environment settings, you can use these flags to compile:

```bash
g++ -std=c++17 -L/usr/local/lib -I/usr/local/include 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.so
* `-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.
* `mydppbot.cpp` - Your source code
* `dppbot` - The name of the executable to make
* `-ldpp` - Link to libdpp.so

\include{doc} install_prebuilt_footer.dox

Expand Down
2 changes: 1 addition & 1 deletion docpages/example_programs/the_basics/firstbot.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ The `event.reply` function (dpp::slashcommand_t::reply) replies to a slash comma
To make the bot start, we must call the dpp::cluster::start method, e.g. in our program by using `bot.start(dpp::st_wait)`.
We also add a line to tell the library to output all its log information to the console, `bot.on_log(dpp::utility::cout_logger());` - if you wanted to do something more advanced, you can replace this parameter with a lambda just like all other events.
We also add a line to tell the library to output all its log information to the console, use `bot.on_log(dpp::utility::cout_logger());` (dpp::utility::cout_logger) - if you wanted to do something more advanced, you can replace this parameter with a lambda just like all other events.
The parameter which we set to false indicates if the function should return once all shards are created. Passing dpp::st_wait here tells the program you do not need to do anything once `bot.start` is called.
Expand Down
4 changes: 3 additions & 1 deletion docpages/install/install-arch-aur.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ or use your favourite package manager:

```bash
# example with `yay` (without root)
yay -Sy dpp
yay -Syu dpp
```

\note The package is currently outdated. We are looking for a new maintainer. For now, please use `dpp-git` or build it from \ref buildlinux "source".

This will do the following three things:

- Clone the D++ AUR repository to a directory called `dpp`
Expand Down

0 comments on commit 9c7acbc

Please sign in to comment.