-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
spotify
48 lines (41 loc) · 1.88 KB
/
spotify
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
APP=spotify
# CREATE A TEMPORARY DIRECTORY
mkdir -p tmp
cd ./tmp
# DOWNLOADING THE DEPENDENCIES
wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool
chmod a+x ./appimagetool
# DOWNLOAD ALL THE NEEDED PACKAGE AND COMPILE THE APPDIR
VERSION=$(curl -Ls http://repository.spotify.com/pool/non-free/s/spotify-client/ | grep spotify-client_ | grep amd64.deb | grep -o -P '(?<=").*(?=")' | tail -1)
if ! test -f ./$APP*.deb; then
wget http://repository.spotify.com/pool/non-free/s/spotify-client/$VERSION
ar -x *.deb
tar xf data.tar.gz
mkdir -p $APP.AppDir
mv ./usr/share ./$APP.AppDir/opt
cp ./$APP.AppDir/opt/spotify/*.desktop ./$APP.AppDir
cp ./$APP.AppDir/opt/spotify/icons/spotify-linux-512.png ./$APP.AppDir/spotify-client.png
fi
# DOWNLOAD GNUTLS
if ! test -f ./libcurl-gnutls.tar.zst; then
wget https://archlinux.org/packages/core/x86_64/libcurl-gnutls/download/ -O libcurl-gnutls.tar.zst
tar fx ./libcurl-gnutls.tar.zst
mkdir -p ./$APP.AppDir/usr
mv ./usr/lib ./$APP.AppDir/usr/lib
fi
# CUSTOMIZE THE APPRUN
rm -f ./$APP.AppDir/AppRun
echo '#!/bin/sh
HERE="$(dirname "$(readlink -f "${0}")")"
export PATH="${HERE}/opt/spotify/:${HERE}/opt/spotify/Apps/:${PATH:+:$PATH}"
export LD_LIBRARY_PATH=/lib/:/lib64/:/lib/x86_64-linux-gnu/:/usr/lib/:"${HERE}/opt/spotify/:${HERE}/opt/spotify/swiftshader/:${HERE}/usr/lib/:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export XDG_DATA_DIRS="${HERE}/opt/spotify/${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
export GSETTINGS_SCHEMA_DIR="${HERE}/opt/spotify/swiftshader/${GSETTINGS_SCHEMA_DIR:+:$GSETTINGS_SCHEMA_DIR}"
EXEC="${HERE}/opt/spotify/spotify"
exec "${EXEC}"' >> ./$APP.AppDir/AppRun
chmod a+x ./$APP.AppDir/AppRun
# EXPORT THE APP TO AN APPIMAGE
ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 ./$APP.AppDir
cd ..
mv ./tmp/Spotify*AppImage ./