Skip to content

Commit 2cad501

Browse files
authored
handle drirc.d and x11 locale. (#82)
* deploy x11 locale and dri config * set `XLOCALEDIR` when `/usr/share/x11/locale` is missing * set `DRIRC_CONFIGDIR` only if `/usr/share/drirc.d` is missing * document
1 parent bc1e68c commit 2cad501

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ This can be useful, for example, to use [pathmap](https://github.com/VHSgunzo/pa
197197
|`XDG_DATA_DIRS` | `${SHARUN_DIR}/share`|
198198
|`VK_DRIVER_FILES` | `${SHARUN_DIR}/share/vulkan/icd.d`|
199199
|`__EGL_VENDOR_LIBRARY_DIRS` | `${SHARUN_DIR}/share/glvnd/egl_vendor.d`|
200+
|`DRIRC_CONFIGDIR` (if no /usr/share/drirc.d) | `${SHARUN_DIR}/share/drirc.d`|
200201
|`XKB_CONFIG_ROOT` (if no /usr/share/X11/xkb) | `${SHARUN_DIR}/share/X11/xkb`|
202+
|`XLOCALEDIR` (if no /usr/share/X11/locale) | `${SHARUN_DIR}/share/X11/locale`|
201203
|`GSETTINGS_SCHEMA_DIR` | `${SHARUN_DIR}/share/glib-2.0/schemas`|
202204
|`TERMINFO` | `${SHARUN_DIR}/share/terminfo`|
203205
|`MAGIC` | `${SHARUN_DIR}/share/file/misc/magic.mgc`|

lib4bin

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,14 @@ if [[ ! -d "$WRAPPE_DIR" || "$WITH_PYTHON" == 1 ]]
10241024
hook_msg "copy X11 xkb..."
10251025
try_mkdir "$dst_xcb_dir"
10261026
try_cp -T "$sys_xcb_dir" "$dst_xcb_dir"
1027+
fi
1028+
sys_xlocale_dir="$(readlink -f /usr/share/X11/locale)"
1029+
dst_xlocale_dir="$dst_dir/share/X11/locale"
1030+
if [[ -d "$sys_xlocale_dir" && ! -d "$dst_xlocale_dir" ]]
1031+
then
1032+
hook_msg "copy X11 locale..."
1033+
try_mkdir "$dst_xlocale_dir"
1034+
try_cp -T "$sys_xlocale_dir" "$dst_xlocale_dir"
10271035
fi ;;
10281036
*/libgbm.so*)
10291037
sys_gbm_dir="$(dirname "$lib_src_pth")/gbm"
@@ -1041,7 +1049,15 @@ if [[ ! -d "$WRAPPE_DIR" || "$WITH_PYTHON" == 1 ]]
10411049
hook_msg "copy EGL vendors..."
10421050
try_mkdir "$dst_glvnd_dir"
10431051
try_cp -T "$sys_glvnd_dir" "$dst_glvnd_dir"
1044-
fi ;;
1052+
fi
1053+
sys_drirc_dir='/usr/share/drirc.d'
1054+
dst_drirc_dir="$dst_dir/share/drirc.d"
1055+
if [[ -d "$sys_drirc_dir" && ! -d "$dst_drirc_dir" ]]
1056+
then
1057+
hook_msg "copy dri config dir..."
1058+
try_mkdir "$dst_drirc_dir"
1059+
try_cp -T "$sys_drirc_dir" "$dst_drirc_dir"
1060+
fi;;
10451061
*/libvulkan.so*)
10461062
sys_vk_icd_dir='/usr/share/vulkan/icd.d'
10471063
dst_vk_icd_dir="$dst_dir/share/vulkan/icd.d"

src/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,11 +869,21 @@ fn main() {
869869
}
870870
}
871871
}
872+
"drirc.d" => {
873+
let sys_drirc_dir = Path::new("/usr/share/drirc.d");
874+
if !sys_drirc_dir.exists() {
875+
env::set_var("DRIRC_CONFIGDIR", entry_path);
876+
}
877+
}
872878
"X11" => {
873879
let xkb = &entry_path.join("xkb");
874880
if !Path::new("/usr/share/X11/xkb").exists() && xkb.exists() {
875881
env::set_var("XKB_CONFIG_ROOT", xkb)
876882
}
883+
let xlocale = &entry_path.join("locale");
884+
if !Path::new("/usr/share/X11/locale").exists() && xlocale.exists() {
885+
env::set_var("XLOCALEDIR", xlocale)
886+
}
877887
}
878888
"libthai" => {
879889
if entry_path.join("thbrk.tri").exists() {

0 commit comments

Comments
 (0)