feat: custom lib directories

This commit is contained in:
iff 2024-12-10 02:33:02 +01:00
parent 443460a81e
commit 3c4e2b06bd
4 changed files with 108 additions and 27 deletions

View file

@ -42,3 +42,14 @@ Your module should print:
Expose your module as executable (`chmod u+x`) in `PATH`, and done!
## `LIB` directories
If exposing modules in `PATH` annoys you, you can set the `_PR_LIB` environment variable to specify directories to find the modules, separated by `:` (analogous to `PATH`). The variable can be set either runtime or compile-time.
Example would be:
```shell
export _PR_LIB_DIR="/usr/lib:$HOME/.local/bin"
```
This is not the default as there is no general standard about where the `lib` directories are located and depends on distribution (`/usr/lib`, `/usr/libexec`, `/data/data/com.termux/files/usr/libexec`, etc.). Programs usually have a hard-coded path looking for `lib`. If you are a package maintainer for a distribution, setting this value when compiling, so it fits into your distribution standard.
If you installed the module with `cargo install`, the binary will be placed in `~/.cargo/bin` which should be in the `PATH` anyway.