Commit 35e12f8bfa
Unsigned
Layout: unified · split
README.md +41 −8
| @@ -22,21 +22,54 @@ If you are interested in helping out take a look at the issue tracker. | ||
| 22 | 22 | |
| 23 | 23 | # Build |
| 24 | 24 | |
| 25 | After Rust is installed the plugin can be compiled with: | |
| 25 | Install Rust and the native build dependencies first. On Debian or Ubuntu a | |
| 26 | typical build environment needs: | |
| 27 | ||
| 28 | sudo apt install build-essential clang libclang-dev libsqlite3-dev pkg-config | |
| 29 | ||
| 30 | Other distributions use different package names, but the important native | |
| 31 | pieces are a C/C++ compiler, `clang`/`libclang`, and SQLite development headers. | |
| 32 | The `weechat-sys` dependency has a bundled WeeChat plugin header | |
| 33 | (`weechat-plugin.h`) fallback. If you want to build against the exact WeeChat | |
| 34 | API installed on your system, install the matching development package | |
| 35 | (`weechat-dev` on Debian/Ubuntu) or point `WEECHAT_PLUGIN_FILE` at the full | |
| 36 | path to that header: | |
| 37 | ||
| 38 | export WEECHAT_PLUGIN_FILE=/usr/include/weechat/weechat-plugin.h | |
| 39 | ||
| 40 | After the dependencies are installed the plugin can be compiled with: | |
| 26 | 41 | |
| 27 | 42 | cargo build --release |
| 28 | 43 | |
| 29 | If you are developing on weechat-matrix-rs, use debug builds which are faster at the expense of plugin performance: | |
| 44 | If you are developing on weechat-matrix-rs, use debug builds which are faster at | |
| 45 | the expense of plugin performance: | |
| 30 | 46 | |
| 31 | 47 | cargo build |
| 32 | 48 | |
| 33 | On Linux this creates a `libmatrix.so` file in the `target/release/` (`target/debug` for dev builds) folder, this | |
| 34 | file needs to be renamed to `matrix.so` and copied to your Weechat plugin | |
| 35 | directory. A plugin directory can be created in your `$WEECHAT_HOME` folder, by | |
| 36 | default `.weechat/plugins/`. | |
| 49 | On Linux this creates a `libmatrix.so` file in the `target/release/` | |
| 50 | (`target/debug` for dev builds) folder. Rename it to `matrix.so` and copy it to | |
| 51 | your WeeChat plugin directory. | |
| 52 | ||
| 53 | `make install` uses WeeChat's XDG data directory by default: | |
| 54 | ||
| 55 | make install | |
| 56 | ||
| 57 | This installs the release build to: | |
| 58 | ||
| 59 | ${XDG_DATA_HOME:-$HOME/.local/share}/weechat/plugins/matrix.so | |
| 60 | ||
| 61 | Use `PROFILE=debug` for a debug build: | |
| 62 | ||
| 63 | make install PROFILE=debug | |
| 64 | ||
| 65 | On older WeeChat setups the plugin directory may instead live under | |
| 66 | `$WEECHAT_HOME/plugins`, commonly `~/.weechat/plugins/`. Create the directory if | |
| 67 | needed and copy the renamed plugin there. | |
| 68 | ||
| 69 | On macOS the built library extension is usually `.dylib`. WeeChat may need this | |
| 70 | extension enabled before it loads the plugin: | |
| 37 | 71 | |
| 38 | Alternatively, `make install` (`make install PROFILE=debug` for dev build) will build and install the plugin in your | |
| 39 | `$WEECHAT_HOME` as well. | |
| 72 | /set weechat.plugin.extension ".so,.dll,.dylib" | |
| 40 | 73 | |
| 41 | 74 | # Configuration |
| 42 | 75 | |