Skip to content

Commit

Permalink
feat: check for gstreamer or pipewire libraries before setting them
Browse files Browse the repository at this point in the history
This PR allows snaps to use their own set of pipewire or gstreamer libraries.
  • Loading branch information
soumyaDghosh committed Feb 28, 2024
1 parent 29db6a3 commit 9a45a96
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions common/desktop-exports
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,19 @@ prepend_dir __EGL_VENDOR_LIBRARY_DIRS "/var/lib/snapd/lib/glvnd/egl_vendor.d"
append_dir __EGL_VENDOR_LIBRARY_DIRS "$SNAP_DESKTOP_RUNTIME/usr/share/glvnd/egl_vendor.d"

# Tell Pipewire where to find its configuration and plugins
export PIPEWIRE_CONFIG_DIR="$SNAP_DESKTOP_RUNTIME/usr/share/pipewire"
export PIPEWIRE_MODULE_DIR="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/pipewire-0.3"
export SPA_PLUGIN_DIR="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/spa-0.2"
if [[ -z ${PIPEWIRE_CONFIG_DIR} || -z ${PIPEWIRE_MODULE_DIR} || -z ${SPA_PLUGIN_DIR} ]]; then
export PIPEWIRE_CONFIG_DIR="$SNAP_DESKTOP_RUNTIME/usr/share/pipewire"
export PIPEWIRE_MODULE_DIR="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/pipewire-0.3"
export SPA_PLUGIN_DIR="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/spa-0.2"
fi

# Tell GStreamer where to find its plugins
export GST_PLUGIN_PATH="$SNAP/usr/lib/$ARCH/gstreamer-1.0"
export GST_PLUGIN_SYSTEM_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gstreamer-1.0"
# gst plugin scanner doesn't install in the correct path: https://github.com/ubuntu/snapcraft-desktop-helpers/issues/43
export GST_PLUGIN_SCANNER="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
if [[ -z ${GST_PLUGIN_SYSTEM_PATH} || -z ${GST_PLUGIN_PATH} || -z ${GST_PLUGIN_SCANNER} ]]; then
export GST_PLUGIN_PATH="$SNAP/usr/lib/$ARCH/gstreamer-1.0"
export GST_PLUGIN_SYSTEM_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gstreamer-1.0"
# gst plugin scanner doesn't install in the correct path: https://github.com/ubuntu/snapcraft-desktop-helpers/issues/43
export GST_PLUGIN_SCANNER="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
fi

# XDG Config
prepend_dir XDG_CONFIG_DIRS "$SNAP_DESKTOP_RUNTIME/etc/xdg"
Expand Down

0 comments on commit 9a45a96

Please sign in to comment.