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 Jul 29, 2024
1 parent a3df144 commit 831333e
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 @@ -129,15 +129,19 @@ append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/libunity"
append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/pulseaudio"

# 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 831333e

Please sign in to comment.