diff --git a/docpages/building/archlinux.md b/docpages/building/archlinux.md new file mode 100644 index 0000000000..c26292b242 --- /dev/null +++ b/docpages/building/archlinux.md @@ -0,0 +1,53 @@ +\page build-archlinux Building on Arch Linux + +\note You might not have to build library from source on arch, you can install directly from AUR repo, See the guide [here](/install-arch-aur.html). + +## 1. Copy Source code +```bash +git clone https://github.com/brainboxdotcc/DPP +cd DPP/ +``` + +```bash +cmake -B ./build -DCMAKE_INSTALL_PREFIX=/usr/ +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 to /usr/include and /usr/lib + +```bash +cd build +sudo make install +``` + +## 3. 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`: + +```bash +cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install +``` + +Then once the build is complete, run `make install` to install to the location you specified. + +\note If you have installed `g++` and not made any changes in enviorment variable related to the path of system headers then you should install in `/usr/` because it is the default system header location on arch. + +## 4. Using the Library + +Once installed to the `/usr/` directory, you can make use of the library in standalone programs simply by including it and linking to it: + +```bash +g++ mydppbot.cpp -o dppbot -ldpp +``` + +The important flags in this command-line are: + +* `-ldpp` - Link to libdpp.so +* `mydppbot.cpp` - Your source code +* `dppbot` - The name of the executable to make + +\include{doc} install_prebuilt_footer.dox + +**Have fun!** diff --git a/docpages/example_programs/the_basics/firstbot.md b/docpages/example_programs/the_basics/firstbot.md index c0b4296a49..bcf52c79c0 100644 --- a/docpages/example_programs/the_basics/firstbot.md +++ b/docpages/example_programs/the_basics/firstbot.md @@ -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. diff --git a/docpages/install/install-arch-aur.md b/docpages/install/install-arch-aur.md index 2e76432ae0..d74e36c051 100644 --- a/docpages/install/install-arch-aur.md +++ b/docpages/install/install-arch-aur.md @@ -15,6 +15,8 @@ or use your favourite package manager: yay -Sy dpp ``` +\note If the package is outdated try installing `dpp-git` or build it from [source](/buildarchlinux.html). + This will do the following three things: - Clone the D++ AUR repository to a directory called `dpp`