forked from 1b-agent/opencadstudio-upstream
fix(snap): handle desktop runtime paths
Strict confinement uses a private runtime directory while the Wayland socket remains in the host directory. Resolve the accessible socket path, provide bundled XKB data, and fall back to X11 only when needed.
This commit is contained in:
1 parent
ca959a31e0
commit
6df23ad8c2
2 files changed
+24
No files matched your search
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
export XKB_CONFIG_ROOT="$SNAP/usr/share/X11/xkb"
|
||||
|
||||
if [ -n "${WAYLAND_DISPLAY:-}" ]; then
|
||||
case "$WAYLAND_DISPLAY" in
|
||||
/*) wayland_socket="$WAYLAND_DISPLAY" ;;
|
||||
*)
|
||||
wayland_socket="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY"
|
||||
host_socket="${XDG_RUNTIME_DIR%/*}/$WAYLAND_DISPLAY"
|
||||
if [ ! -S "$wayland_socket" ] && [ -S "$host_socket" ]; then
|
||||
WAYLAND_DISPLAY="$host_socket"
|
||||
export WAYLAND_DISPLAY
|
||||
wayland_socket="$host_socket"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
[ -S "$wayland_socket" ] || unset WAYLAND_DISPLAY
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
@@ -54,6 +54,7 @@ layout:
|
||||
apps:
|
||||
open-cad-studio:
|
||||
command-chain:
|
||||
- bin/open-cad-studio-wrapper
|
||||
- bin/graphics-core22-wrapper
|
||||
command: usr/bin/OpenCADStudio
|
||||
desktop: usr/share/applications/io.github.HakanSeven12.OpenCadStudio.desktop
|
||||
@@ -74,6 +75,8 @@ parts:
|
||||
override-build: |
|
||||
mkdir -p "${CRAFT_PART_INSTALL}"
|
||||
tar -xzf "${CRAFT_PROJECT_DIR}/linux-payload.tar.gz" -C "${CRAFT_PART_INSTALL}"
|
||||
install -Dm755 "${CRAFT_PROJECT_DIR}/snap/local/open-cad-studio-wrapper" \
|
||||
"${CRAFT_PART_INSTALL}/bin/open-cad-studio-wrapper"
|
||||
stage-packages:
|
||||
- libxcursor1
|
||||
- libxi6
|
||||
|
||||
Reference in new issue
Block a user