From d398b1de40830a6968f250f60a6b063d61bf2656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=8D=9A=E4=BB=81=28Buo-ren=20Lin=29?= Date: Thu, 14 Mar 2019 04:52:35 +0800 Subject: [PATCH] snap: Use SNAPCRAFT_ARCH_TRIPLET for pulseaudio library workaround (#188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ๆž—ๅšไป(Buo-ren Lin) --- snap/local/launchers/gallery-dl-launch | 8 --- .../workaround-snap-arch-triplet-launch | 55 ------------------- snap/snapcraft.yaml | 5 +- 3 files changed, 4 insertions(+), 64 deletions(-) delete mode 100755 snap/local/launchers/workaround-snap-arch-triplet-launch diff --git a/snap/local/launchers/gallery-dl-launch b/snap/local/launchers/gallery-dl-launch index 319287b3..951f5296 100755 --- a/snap/local/launchers/gallery-dl-launch +++ b/snap/local/launchers/gallery-dl-launch @@ -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="$( diff --git a/snap/local/launchers/workaround-snap-arch-triplet-launch b/snap/local/launchers/workaround-snap-arch-triplet-launch deleted file mode 100755 index ec4aeb7a..00000000 --- a/snap/local/launchers/workaround-snap-arch-triplet-launch +++ /dev/null @@ -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 "${@}" diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index fb900713..a780f151 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -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