Skip to content

Commit b312950

Browse files
committed
Add hook for libgirepository (lib4bin)
Add GI_TYPELIB_PATH env var (sharun) Update README
1 parent b37d9f8 commit b312950

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sharun"
3-
version = "0.5.4"
3+
version = "0.5.5"
44
readme = "README.md"
55
license = "MIT"
66
repository = "https://github.com/VHSgunzo/sharun"

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ cp ./target/$(uname -m)-unknown-linux-musl/release/sharun .
8282
It can also be set at runtime (env: STARTPE_CLEANUP=0)
8383
-y, --with-python Pack python using uv from PATH or env or download
8484
(env: WITH_PYTHON=1, UV=/path|URL, UV_URL=URL)
85-
-pp, --python-pkg 'pkg' Specify the python package for packing (env: PYTHON_PKG='pkg')
85+
-pp, --python-pkg 'pkg' Specify the python package or '/path/requirements.txt' (env: PYTHON_PKG='pkg')
8686
-pv, --python-ver 3.12 Specify the python version for packing (env: PYTHON_VER=3.12)
8787
-pi, --python-pip Leave pip after install python package (env: PYTHON_LEAVE_PIP=1)
8888
-pw, --python-wheel Leave wheel after install python package (env: PYTHON_LEAVE_WHEEL=1)
@@ -181,6 +181,7 @@ This can be useful, for example, to use [ld-preload-open](https://github.com/fri
181181
|`LIBGL_DRIVERS_PATH` | `${SHARUN_DIR}/shared/$LIB/dri`|
182182
|`SPA_PLUGIN_DIR` | `${SHARUN_DIR}/shared/$LIB/spa-*`|
183183
|`PIPEWIRE_MODULE_DIR` | `${SHARUN_DIR}/shared/$LIB/pipewire-*`|
184+
|`GI_TYPELIB_PATH` | `${SHARUN_DIR}/shared/$LIB/girepository-*`|
184185
|||
185186
|---|---|
186187
|`XDG_DATA_DIRS` | `${SHARUN_DIR}/share`|

lib4bin

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ usage() {
7575
It can also be set at runtime (env: STARTPE_CLEANUP=0)
7676
-y, --with-python Pack python using uv from PATH or env or download
7777
(env: WITH_PYTHON=1, UV=/path|URL, UV_URL=URL)
78-
-pp, --python-pkg 'pkg' Specify the python package for packing (env: PYTHON_PKG='pkg')
78+
-pp, --python-pkg 'pkg' Specify the python package or '/path/requirements.txt' (env: PYTHON_PKG='pkg')
7979
-pv, --python-ver 3.12 Specify the python version for packing (env: PYTHON_VER=3.12)
8080
-pi, --python-pip Leave pip after install python package (env: PYTHON_LEAVE_PIP=1)
8181
-pw, --python-wheel Leave wheel after install python package (env: PYTHON_LEAVE_WHEEL=1)
@@ -1002,6 +1002,16 @@ if [[ ! -d "$WRAPPE_DIR" || "$WITH_PYTHON" == 1 ]]
10021002
break
10031003
fi
10041004
done ;;
1005+
*/libgirepository-*.so*)
1006+
girepository="$(grep -o 'girepository-.*\.so'<<<"$lib_src_name"|sed "s|\.so$||")"
1007+
sys_girepository="$(dirname "$lib_src_pth")/$girepository"
1008+
dst_girepository="$lib_dst_dir_pth/$girepository"
1009+
if [[ -d "$sys_girepository" && ! -d "$dst_girepository" ]]
1010+
then
1011+
hook_msg "copy girepository..."
1012+
try_mkdir "$dst_girepository"
1013+
try_cp -T "$sys_girepository" "$dst_girepository"
1014+
fi ;;
10051015
esac
10061016
fi
10071017
LIBRARIES["$lib_dst_pth"]=1

src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,9 @@ fn main() {
668668
if dir.starts_with("gegl-") {
669669
env::set_var("GEGL_PATH", dir_path)
670670
}
671+
if dir.starts_with("girepository-") {
672+
env::set_var("GI_TYPELIB_PATH", dir_path)
673+
}
671674
if dir == "libdecor" {
672675
let plugins = &format!("{dir_path}/plugins-1");
673676
if Path::new(plugins).exists() {

0 commit comments

Comments
 (0)