Commit c1f3fa64a9

c1f3fa64a9829a6cbbea06711fbc48002c3c7db9

parent: b351239335

Unsigned

Jakub Panek <me@panekj.dev> · 2025-09-16 07:57 UTC

docs: update README to include dev/release builds instructions

Layout: unified · split

Makefile +17 −7
@@ -2,18 +2,28 @@
2XDG_DATA_HOME ?= $(HOME)/.local/share 2XDG_DATA_HOME ?= $(HOME)/.local/share
3WEECHAT_DATA_DIR ?= $(XDG_DATA_HOME)/weechat 3WEECHAT_DATA_DIR ?= $(XDG_DATA_HOME)/weechat
4 4
5SOURCES := $(wildcard src/*.rs src/commands/*.rs Cargo.lock) 5SOURCES := $(wildcard src/*.rs src/bar_items/*.rs src/commands/*.rs src/room/*.rs Cargo.lock)
6 6
7.PHONY: install install-dir lint 7PROFILE ?= release
8 8
9target/debug/libmatrix.so: $(SOURCES) 9.PHONY: install install-dir lint all help
10
11all: help
12
13help: ## Print this help message
14 @grep -E '^[a-zA-Z._-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
15
16target/debug/libmatrix.so: $(SOURCES) ## Build plugin in dev profile
10 cargo build 17 cargo build
11 18
12install: install-dir target/debug/libmatrix.so 19target/release/libmatrix.so: $(SOURCES) ## Build plugin release profile
13 install -m644 target/debug/libmatrix.so $(DESTDIR)$(WEECHAT_DATA_DIR)/plugins/matrix.so 20 cargo build --release
21
22install: install-dir target/$(PROFILE)/libmatrix.so ## Install plugin to weechat dir
23 install -m644 target/$(PROFILE)/libmatrix.so $(DESTDIR)$(WEECHAT_DATA_DIR)/plugins/matrix.so
14 24
15install-dir: 25install-dir: ## Create plugins directory
16 install -d $(DESTDIR)$(WEECHAT_DATA_DIR)/plugins 26 install -d $(DESTDIR)$(WEECHAT_DATA_DIR)/plugins
17 27
18lint: 28lint: ## Lint issues with clippy
19 cargo clippy 29 cargo clippy
README.md +6 −2
@@ -24,14 +24,18 @@ If you are interested in helping out take a look at the issue tracker.
24 24
25After Rust is installed the plugin can be compiled with: 25After Rust is installed the plugin can be compiled with:
26 26
27 cargo build --release
28
29If you are developing on weechat-matrix-rs, use debug builds which are faster at the expense of plugin performance:
30
27 cargo build 31 cargo build
28 32
29On Linux this creates a `libmatrix.so` file in the `target/debug/` folder, this 33On Linux this creates a `libmatrix.so` file in the `target/release/` (`target/debug` for dev builds) folder, this
30file needs to be renamed to `matrix.so` and copied to your Weechat plugin 34file needs to be renamed to `matrix.so` and copied to your Weechat plugin
31directory. A plugin directory can be created in your `$WEECHAT_HOME` folder, by 35directory. A plugin directory can be created in your `$WEECHAT_HOME` folder, by
32default `.weechat/plugins/`. 36default `.weechat/plugins/`.
33 37
34Alternatively, `make install` will build and install the plugin in your 38Alternatively, `make install` (`make install PROFILE=debug` for dev build) will build and install the plugin in your
35`$WEECHAT_HOME` as well. 39`$WEECHAT_HOME` as well.
36 40
37# Configuration 41# Configuration