@@ -11,61 +11,55 @@ export ARCH="$(uname -m)"
1111export APPIMAGE_EXTRACT_AND_RUN=1
1212REPO=" https://github.com/mpv-player/mpv-build.git"
1313URUNTIME=" https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-$ARCH "
14- UPINFO=" gh-releases-zsync|$GITHUB_REPOSITORY_OWNER |mpv-AppImage |latest|*$ARCH .AppImage.zsync"
14+ UPINFO=" gh-releases-zsync|$( echo " $GITHUB_REPOSITORY " | tr ' / ' ' | ' ) |latest|*$ARCH .AppImage.zsync"
1515LIB4BN=" https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
16- mkdir -p ./mpv/AppDir
17- cd ./mpv/AppDir
1816
1917# Build mpv
20- CURRENTDIR=" $( readlink -f " $( dirname " $0 " ) " ) "
21- git clone " $REPO " ./mpv-build
22- cd ./mpv-build
23- sed -i " s#meson setup build#meson setup build -Dprefix=$CURRENTDIR /shared#g" \
24- ./scripts/mpv-config
25- ./rebuild -j$( nproc)
26- ./install
27- cd ..
18+ git clone " $REPO " ./mpv-build && (
19+ cd ./mpv-build
20+ printf " %s\n" " --enable-libdav1d" >> ffmpeg_options
21+ ./rebuild -j$( nproc)
22+ sudo ./install
23+ )
2824rm -rf ./mpv-build
29- ln -s ./shared ./usr
3025
3126# bundle libs
27+ mkdir -p ./AppDir
28+ cd ./AppDir
29+
3230wget " $LIB4BN " -O ./lib4bin
3331chmod +x ./lib4bin
34- ./lib4bin -p -w -v -s ./shared/bin/mpv
35- VERSION=$( ./bin/mpv --version 2> /dev/null | awk ' FNR==1 {print $2; exit}' )
32+ ./lib4bin -p -v -s -k " $( command -v mpv) "
33+
34+ VERSION=$( ./bin/mpv --version | awk ' FNR==1 {print $2; exit}' )
3635if [ -z " $VERSION " ]; then
3736 echo " ERROR: Could not get version from mpv"
3837 exit 1
3938fi
40- export VERSION
4139echo " $VERSION " > ~ /version
40+
4241# HACK
4342sed -i ' s|/usr|/KEK|g' ./shared/lib/ld-linux-x86-64.so.2
4443
4544# prepare AppDir
46- cp . /usr/share/applications/* .desktop ./
47- cp . /usr/share/icons/hicolor/128x128/apps/mpv.png ./
45+ cp /usr/local/ share/applications/mpv .desktop ./
46+ cp /usr/local /share/icons/hicolor/128x128/apps/mpv.png ./
4847ln -s ./mpv.png ./.DirIcon
48+
4949cat >> ./AppRun << 'EOF '
5050#!/bin/sh
5151CURRENTDIR="$(dirname "$(readlink -f "$0")")"
52- export XDG_DATA_DIRS="$CURRENTDIR/usr/share:$XDG_DATA_DIRS"
53- export PATH="$CURRENTDIR/bin:$PATH"
5452CACHEDIR="${XDG_CACHE_HOME:-$HOME/.cache}"
5553export PATH="$PATH:$CACHEDIR/mpv-appimage_yt-dlp"
56- export XDG_DATA_DIRS="$CURRENTDIR/usr/share:$XDG_DATA_DIRS"
5754
5855# Download yt-dlp if needed
5956if echo "$@" | grep -q "http" && ! command -v yt-dlp >/dev/null 2>&1; then
6057 echo "Video link detected but yt-dlp is not installed, installing..."
6158 mkdir -p "$CACHEDIR"/mpv-appimage_yt-dlp
59+ YT="https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux"
6260 if command -v wget >/dev/null 2>&1; then
63- YT="$(wget -q https://api.github.com/repos/yt-dlp/yt-dlp/releases -O - \
64- | sed 's/[()",{} ]/\n/g' | grep -oi -m1 'https.*yt.*linux$')"
6561 wget -q "$YT" -O "$CACHEDIR"/mpv-appimage_yt-dlp/yt-dlp
6662 elif command -v curl >/dev/null 2>&1; then
67- YT="$(curl -Ls https://api.github.com/repos/yt-dlp/yt-dlp/releases \
68- | sed 's/[()",{} ]/\n/g' | grep -oi -m1 'https.*yt.*linux$')"
6963 curl -Ls "$YT" -o "$CACHEDIR"/mpv-appimage_yt-dlp/yt-dlp
7064 else
7165 echo "ERROR: You need wget or curl in order to download yt-dlp"
@@ -97,8 +91,9 @@ echo "Generating AppImage..."
9791 --header uruntime \
9892 -i ./AppDir -o ./mpv-" $VERSION " -anylinux-" $ARCH " .AppImage
9993
100- wget -qO ./pelf " https://github.com/xplshn/pelf/releases/latest/download/pelf_$ARCH "
94+ wget -qO ./pelf " https://github.com/xplshn/pelf/releases/latest/download/pelf_$ARCH "
10195chmod +x ./pelf
96+
10297echo " Generating [dwfs]AppBundle...(Go runtime)"
10398./pelf --add-appdir ./AppDir \
10499 --appbundle-id=" mpv-$VERSION " \
@@ -109,7 +104,4 @@ echo "Generating zsync file..."
109104zsyncmake * .AppImage -u * .AppImage
110105zsyncmake * .AppBundle -u * .AppBundle
111106
112- mv ./* .AppImage* ../
113- mv ./* .AppBundle* ../
114- cd ..
115107echo " All done!"
0 commit comments