snap: Use SNAPCRAFT_ARCH_TRIPLET for pulseaudio library workaround (#188)
Signed-off-by: 林博仁(Buo-ren Lin) <Buo.Ren.Lin@gmail.com>master
parent
6dae6bee37
commit
d398b1de40
|
@ -7,14 +7,6 @@ set \
|
|||
-o nounset \
|
||||
-o pipefail
|
||||
|
||||
if ! test -v SNAP_ARCH_TRIPLET; then
|
||||
printf 'Error: SNAP_ARCH_TRIPLET not set, this launcher requires workaround-snap-arch-triplet-launch launcher to work.\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Satisfy FFmpeg's usr/lib/ARCH/pulseaudio/libpulsecommon-11.1.so dependency
|
||||
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"$SNAP"/usr/lib/"${SNAP_ARCH_TRIPLET}"/pulseaudio
|
||||
|
||||
# Use user's real home directory for canonical configuration path access
|
||||
# FIXME: Waiting for Snap Store assertion
|
||||
declare REALHOME="$(
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# This launcher sets the Debian-specific multiarch tuples as the SNAP_ARCH_TRIPLET environmental variable for other launchers' ease
|
||||
|
||||
set \
|
||||
-o errexit \
|
||||
-o errtrace \
|
||||
-o nounset \
|
||||
-o pipefail
|
||||
|
||||
if ! test -v SNAP_ARCH; then
|
||||
printf -- \
|
||||
'%s: Error: This launcher requires SNAP_ARCH environmental variable to be set and exported.\n' \
|
||||
"$(basename "${BASH_SOURCE[0]}")"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
declare \
|
||||
SNAP_ARCH_TRIPLET
|
||||
|
||||
# Refer:
|
||||
#
|
||||
# * Environmental variables - doc - snapcraft.io
|
||||
# https://forum.snapcraft.io/t/environmental-variables/7983
|
||||
# * Multiarch/Tuples - Debian Wiki
|
||||
# https://wiki.debian.org/Multiarch/Tuples
|
||||
# NOTE: Only consider Linux archs with the `released` status in Debian for now
|
||||
case "${SNAP_ARCH}" in
|
||||
# These are the special cases
|
||||
amd64)
|
||||
SNAP_ARCH_TRIPLET=x86_64-linux-gnu
|
||||
;;
|
||||
armel)
|
||||
SNAP_ARCH_TRIPLET=arm-linux-gnueabi
|
||||
;;
|
||||
armhf)
|
||||
SNAP_ARCH_TRIPLET=arm-linux-gnueabihf
|
||||
;;
|
||||
arm64)
|
||||
SNAP_ARCH_TRIPLET=aarch64-linux-gnu
|
||||
;;
|
||||
ppc64el)
|
||||
SNAP_ARCH_TRIPLET=powerpc64le-linux-gnu
|
||||
;;
|
||||
# Consider rest of them not exceptions
|
||||
s390x \
|
||||
|*)
|
||||
SNAP_ARCH_TRIPLET="${SNAP_ARCH}"-linux-gnu
|
||||
;;
|
||||
esac
|
||||
|
||||
export \
|
||||
SNAP_ARCH_TRIPLET
|
||||
|
||||
# Finally run the launching command
|
||||
exec "${@}"
|
|
@ -83,10 +83,13 @@ apps:
|
|||
gallery-dl:
|
||||
adapter: full
|
||||
command-chain:
|
||||
- bin/workaround-snap-arch-triplet-launch
|
||||
- bin/gallery-dl-launch
|
||||
command: bin/gallery-dl
|
||||
environment:
|
||||
LANG: C.UTF-8
|
||||
LC_ALL: C.UTF-8
|
||||
|
||||
# Satisfy FFmpeg's libpulsecommon dependency
|
||||
LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio
|
||||
|
||||
HOME: $SNAP_USER_COMMON
|
||||
|
|
Loading…
Reference in New Issue