├── .github ├── FUNDING.yml └── workflows │ ├── blank.yml │ └── cronjob.yml ├── README.md ├── fallback ├── mpv-bookworm ├── mpv-bullseye └── mpv-buster ├── latest-release.txt ├── legacy └── mpv-ppa.sh └── mpv-junest.sh /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [ivan-hc] 4 | custom: ["paypal.me/IvanAlexHC"] 5 | ko_fi: IvanAlexHC 6 | -------------------------------------------------------------------------------- /.github/workflows/blank.yml: -------------------------------------------------------------------------------- 1 | name: Release MPV Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | schedule: 8 | - cron: "0 12 1/2 * *" 9 | workflow_dispatch: 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v3 16 | 17 | - name: build 18 | if: always() 19 | run: | 20 | sudo apt update && sudo apt install desktop-file-utils 21 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 22 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 23 | chmod a+x ./mpv-junest.sh 24 | ./mpv-junest.sh 25 | mkdir dist 26 | mv *AppImage* dist/ 27 | 28 | - name: Upload artifact 29 | uses: actions/upload-artifact@v4.4.0 30 | with: 31 | name: MPV-Media-Player-x86_64.AppImage 32 | path: 'dist' 33 | 34 | release: 35 | needs: [build] 36 | permissions: write-all 37 | runs-on: ubuntu-latest 38 | 39 | steps: 40 | - uses: actions/download-artifact@v4.1.8 41 | with: 42 | name: MPV-Media-Player-x86_64.AppImage 43 | 44 | - name: release 45 | uses: marvinpinto/action-automatic-releases@latest 46 | with: 47 | title: Continuous build 48 | automatic_release_tag: continuous 49 | prerelease: false 50 | draft: false 51 | files: | 52 | *.AppImage* 53 | repo_token: ${{ secrets.GITHUB_TOKEN }} 54 | -------------------------------------------------------------------------------- /.github/workflows/cronjob.yml: -------------------------------------------------------------------------------- 1 | name: Github Action with a cronjob trigger 2 | on: 3 | schedule: 4 | - cron: "0 0 * * *" 5 | 6 | workflow_dispatch: 7 | 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.ref }} 10 | cancel-in-progress: true 11 | 12 | permissions: 13 | contents: write 14 | 15 | jobs: 16 | sync-files: 17 | name: "Run sync" 18 | runs-on: ubuntu-latest 19 | steps: 20 | - name: "Checkout source repository" 21 | uses: actions/checkout@v4 22 | 23 | - name: "List releases" 24 | run: | 25 | curl -Ls https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" > latest-release.txt 26 | 27 | - name: "Push to Source" 28 | run: | 29 | git config --global user.name "ivan-hc" 30 | git config --global user.email "noreply@github.com" 31 | git add latest-release.txt 32 | if git diff-index --quiet HEAD; then 33 | echo "No changes to commit." >> $GITHUB_STEP_SUMMARY 34 | else 35 | git commit -m "Sync files from source repository" 36 | git push && echo "Sync to Source succeeded" >> $GITHUB_STEP_SUMMARY 37 | fi 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository creates and distributes the unofficial Appimage of MPV Media Player built on top of JuNest (the lightweight Arch Linux based distro that runs, without root privileges, on top of any other Linux distro) and stable releases built from multiple development brances of Debian. 2 | 3 | ## Credits 4 | - JuNest https://github.com/fsquillace/junest 5 | - ArchImage https://github.com/ivan-hc/ArchImage 6 | 7 | ------------------------------------------------------------------------ 8 | 9 | ## Install and update it with ease 10 | 11 | ### *"*AM*" Application Manager* 12 | #### *Package manager, database & solutions for all AppImages and portable apps for GNU/Linux!* 13 | 14 | [![Istantanea_2024-06-26_17-00-46 png](https://github.com/ivan-hc/AM/assets/88724353/671f5eb0-6fb6-4392-b45e-af0ea9271d9b)](https://github.com/ivan-hc/AM) 15 | 16 | [![Readme](https://img.shields.io/github/stars/ivan-hc/AM?label=%E2%AD%90&style=for-the-badge)](https://github.com/ivan-hc/AM/stargazers) [![Readme](https://img.shields.io/github/license/ivan-hc/AM?label=&style=for-the-badge)](https://github.com/ivan-hc/AM/blob/main/LICENSE) 17 | 18 | *"AM"/"AppMan" is a set of scripts and modules for installing, updating, and managing AppImage packages and other portable formats, in the same way that APT manages DEBs packages, DNF the RPMs, and so on... using a large database of Shell scripts inspired by the Arch User Repository, each dedicated to an app or set of applications.* 19 | 20 | *The engine of "AM"/"AppMan" is the "APP-MANAGER" script which, depending on how you install or rename it, allows you to install apps system-wide (for a single system administrator) or locally (for each user).* 21 | 22 | *"AM"/"AppMan" aims to be the default package manager for all AppImage packages, giving them a home to stay.* 23 | 24 | *You can consult the entire **list of managed apps** at [**portable-linux-apps.github.io/apps**](https://portable-linux-apps.github.io/apps).* 25 | 26 | ## *Go to *https://github.com/ivan-hc/AM* for more!* 27 | 28 | ------------------------------------------------------------------------ 29 | 30 | | [***Install "AM"***](https://github.com/ivan-hc/AM) | [***See all available apps***](https://portable-linux-apps.github.io) | [***Support me on ko-fi.com***](https://ko-fi.com/IvanAlexHC) | [***Support me on PayPal.me***](https://paypal.me/IvanAlexHC) | 31 | | - | - | - | - | 32 | 33 | ------------------------------------------------------------------------ 34 | -------------------------------------------------------------------------------- /fallback/mpv-bookworm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | APP=mpv 4 | DEBRELEASE=bookworm 5 | GLIBC=$(wget -q https://packages.debian.org/$DEBRELEASE/libc6 -O - | grep "Package: libc6" | cut -c 20-) 6 | ARCH=x86-64 7 | 8 | mkdir tmp-$DEBRELEASE; 9 | cd tmp-$DEBRELEASE; 10 | 11 | # DOWNLOADING THE DEPENDENCIES 12 | wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(uname -m).AppImage -O appimagetool 13 | wget https://raw.githubusercontent.com/ivan-hc/AM-application-manager/main/tools/pkg2appimage 14 | chmod a+x ./appimagetool ./pkg2appimage 15 | 16 | # CREATING THE APPIMAGE: APPDIR FROM A RECIPE... 17 | DEBRELEASE=bookworm 18 | echo "app: mpv 19 | binpatch: true 20 | 21 | ingredients: 22 | dist: $DEBRELEASE 23 | package: mpv 24 | sources: 25 | - deb http://ftp.debian.org/debian/ $DEBRELEASE main contrib non-free non-free-firmware 26 | - deb http://security.debian.org/debian-security/ $DEBRELEASE-security main contrib non-free non-free-firmware 27 | - deb http://ftp.debian.org/debian/ $DEBRELEASE-updates main contrib non-free non-free-firmware 28 | packages: 29 | - mpv 30 | - libplacebo208 31 | - libshaderc1" >> recipe.yml; 32 | 33 | ./pkg2appimage ./recipe.yml; 34 | 35 | # ...DOWNLOADING LIBUNIONPRELOAD... 36 | wget https://github.com/project-portable/libunionpreload/releases/download/amd64/libunionpreload.so 37 | chmod a+x libunionpreload.so 38 | mv ./libunionpreload.so ./$APP/$APP.AppDir/ 39 | 40 | # ...REPLACING THE EXISTING APPRUN WITH A CUSTOM ONE... 41 | rm -R -f ./$APP/$APP.AppDir/AppRun 42 | cat >> ./$APP/$APP.AppDir/AppRun << 'EOF' 43 | #!/bin/sh 44 | HERE="$(dirname "$(readlink -f "${0}")")" 45 | export UNION_PRELOAD="${HERE}" 46 | export LD_PRELOAD="${HERE}/libunionpreload.so" 47 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${PATH}" 48 | export LD_LIBRARY_PATH=/lib/:/lib64/:/usr/lib/:/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/lib/:"${HERE}"/lib/x86_64-linux-gnu/:"${LD_LIBRARY_PATH}" 49 | export PYTHONPATH="${HERE}"/usr/share/python3/:"${PYTHONPATH}" 50 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 51 | export MPV_CONFIG_PATH=$HERE/etc/mpv/:$MPV_CONFIG_PATH 52 | exec ${HERE}/usr/bin/mpv "$@" 53 | EOF 54 | chmod a+x ./$APP/$APP.AppDir/AppRun 55 | 56 | # ...IMPORT THE LAUNCHER AND THE ICON TO THE APPDIR (uncomment if not available)... 57 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/22x22/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 58 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/24x24/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 59 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/32x32/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 60 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/48x48/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 61 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/64x64/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 62 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/128x128/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 63 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/256x256/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 64 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/512x512/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 65 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/scalable/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 66 | cp ./$APP/$APP.AppDir/usr/share/applications/$APP* ./$APP/$APP.AppDir/ 2>/dev/null 67 | 68 | # ...EXPORT THE APPDIR TO AN APPIMAGE! 69 | ARCH=x86_64 ./appimagetool -n ./$APP/$APP.AppDir 70 | cd ..; 71 | mv ./tmp-$DEBRELEASE/*AppImage MPV-Media-Player_0.35_GLIBC$GLIBC"_"$ARCH.AppImage 72 | -------------------------------------------------------------------------------- /fallback/mpv-bullseye: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | APP=mpv 4 | DEBRELEASE=bullseye 5 | GLIBC=$(wget -q https://packages.debian.org/$DEBRELEASE/libc6 -O - | grep "Package: libc6" | cut -c 20-) 6 | ARCH=x86-64 7 | 8 | mkdir tmp-$DEBRELEASE; 9 | cd tmp-$DEBRELEASE; 10 | 11 | # DOWNLOADING THE DEPENDENCIES 12 | wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(uname -m).AppImage -O appimagetool 13 | wget https://raw.githubusercontent.com/ivan-hc/AM-application-manager/main/tools/pkg2appimage 14 | chmod a+x ./appimagetool ./pkg2appimage 15 | 16 | # CREATING THE APPIMAGE: APPDIR FROM A RECIPE... 17 | DEBRELEASE=bookworm 18 | echo "app: mpv 19 | binpatch: true 20 | 21 | ingredients: 22 | dist: $DEBRELEASE 23 | package: mpv 24 | sources: 25 | - deb http://ftp.debian.org/debian/ $DEBRELEASE main contrib non-free non-free-firmware 26 | - deb http://security.debian.org/debian-security/ $DEBRELEASE-security main contrib non-free non-free-firmware 27 | - deb http://ftp.debian.org/debian/ $DEBRELEASE-updates main contrib non-free non-free-firmware 28 | packages: 29 | - mpv 30 | - libplacebo72" >> recipe.yml; 31 | 32 | ./pkg2appimage ./recipe.yml; 33 | 34 | # ...DOWNLOADING LIBUNIONPRELOAD... 35 | wget https://github.com/project-portable/libunionpreload/releases/download/amd64/libunionpreload.so 36 | chmod a+x libunionpreload.so 37 | mv ./libunionpreload.so ./$APP/$APP.AppDir/ 38 | 39 | # ...REPLACING THE EXISTING APPRUN WITH A CUSTOM ONE... 40 | rm -R -f ./$APP/$APP.AppDir/AppRun 41 | cat >> ./$APP/$APP.AppDir/AppRun << 'EOF' 42 | #!/bin/sh 43 | HERE="$(dirname "$(readlink -f "${0}")")" 44 | export UNION_PRELOAD="${HERE}" 45 | export LD_PRELOAD="${HERE}/libunionpreload.so" 46 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${PATH}" 47 | export LD_LIBRARY_PATH=/lib/:/lib64/:/usr/lib/:/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/lib/:"${HERE}"/lib/x86_64-linux-gnu/:"${LD_LIBRARY_PATH}" 48 | export PYTHONPATH="${HERE}"/usr/share/python3/:"${PYTHONPATH}" 49 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 50 | export MPV_CONFIG_PATH=$HERE/etc/mpv/:$MPV_CONFIG_PATH 51 | exec ${HERE}/usr/bin/mpv "$@" 52 | EOF 53 | chmod a+x ./$APP/$APP.AppDir/AppRun 54 | 55 | # ...IMPORT THE LAUNCHER AND THE ICON TO THE APPDIR (uncomment if not available)... 56 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/22x22/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 57 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/24x24/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 58 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/32x32/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 59 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/48x48/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 60 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/64x64/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 61 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/128x128/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 62 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/256x256/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 63 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/512x512/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 64 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/scalable/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 65 | cp ./$APP/$APP.AppDir/usr/share/applications/$APP* ./$APP/$APP.AppDir/ 2>/dev/null 66 | 67 | # ...EXPORT THE APPDIR TO AN APPIMAGE! 68 | ARCH=x86_64 ./appimagetool -n ./$APP/$APP.AppDir 69 | cd ..; 70 | mv ./tmp-$DEBRELEASE/*AppImage MPV-Media-Player_0.32.0-3_GLIBC$GLIBC"_"$ARCH.AppImage 71 | -------------------------------------------------------------------------------- /fallback/mpv-buster: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | APP=mpv 4 | DEBRELEASE=buster 5 | GLIBC=$(wget -q https://packages.debian.org/$DEBRELEASE/libc6 -O - | grep "Package: libc6" | cut -c 20-) 6 | ARCH=x86-64 7 | 8 | mkdir tmp-$DEBRELEASE; 9 | cd tmp-$DEBRELEASE; 10 | 11 | # DOWNLOADING THE DEPENDENCIES 12 | wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(uname -m).AppImage -O appimagetool 13 | wget https://raw.githubusercontent.com/ivan-hc/AM-application-manager/main/tools/pkg2appimage 14 | chmod a+x ./appimagetool ./pkg2appimage 15 | 16 | # CREATING THE APPIMAGE: APPDIR FROM A RECIPE... 17 | DEBRELEASE=bookworm 18 | echo "app: mpv 19 | binpatch: true 20 | 21 | ingredients: 22 | dist: $DEBRELEASE 23 | package: mpv 24 | sources: 25 | - deb http://ftp.debian.org/debian/ $DEBRELEASE main contrib non-free non-free-firmware 26 | - deb http://security.debian.org/debian-security/ $DEBRELEASE-security main contrib non-free non-free-firmware 27 | - deb http://ftp.debian.org/debian/ $DEBRELEASE-updates main contrib non-free non-free-firmware 28 | packages: 29 | - mpv 30 | - libplacebo7" >> recipe.yml; 31 | 32 | ./pkg2appimage ./recipe.yml; 33 | 34 | # ...DOWNLOADING LIBUNIONPRELOAD... 35 | wget https://github.com/project-portable/libunionpreload/releases/download/amd64/libunionpreload.so 36 | chmod a+x libunionpreload.so 37 | mv ./libunionpreload.so ./$APP/$APP.AppDir/ 38 | 39 | # ...REPLACING THE EXISTING APPRUN WITH A CUSTOM ONE... 40 | rm -R -f ./$APP/$APP.AppDir/AppRun 41 | cat >> ./$APP/$APP.AppDir/AppRun << 'EOF' 42 | #!/bin/sh 43 | HERE="$(dirname "$(readlink -f "${0}")")" 44 | export UNION_PRELOAD="${HERE}" 45 | export LD_PRELOAD="${HERE}/libunionpreload.so" 46 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${PATH}" 47 | export LD_LIBRARY_PATH=/lib/:/lib64/:/usr/lib/:/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/lib/:"${HERE}"/lib/x86_64-linux-gnu/:"${LD_LIBRARY_PATH}" 48 | export PYTHONPATH="${HERE}"/usr/share/python3/:"${PYTHONPATH}" 49 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 50 | export MPV_CONFIG_PATH=$HERE/etc/mpv/:$MPV_CONFIG_PATH 51 | exec ${HERE}/usr/bin/mpv "$@" 52 | EOF 53 | chmod a+x ./$APP/$APP.AppDir/AppRun 54 | 55 | # ...IMPORT THE LAUNCHER AND THE ICON TO THE APPDIR (uncomment if not available)... 56 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/22x22/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 57 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/24x24/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 58 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/32x32/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 59 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/48x48/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 60 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/64x64/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 61 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/128x128/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 62 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/256x256/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 63 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/512x512/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 64 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/scalable/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 65 | cp ./$APP/$APP.AppDir/usr/share/applications/$APP* ./$APP/$APP.AppDir/ 2>/dev/null 66 | 67 | # ...EXPORT THE APPDIR TO AN APPIMAGE! 68 | ARCH=x86_64 ./appimagetool -n ./$APP/$APP.AppDir 69 | cd ..; 70 | mv ./tmp-$DEBRELEASE/*AppImage MPV-Media-Player_0.29.1-1_GLIBC$GLIBC"_"$ARCH.AppImage 71 | -------------------------------------------------------------------------------- /latest-release.txt: -------------------------------------------------------------------------------- 1 | https://github.com/ivan-hc/MPV-appimage/releases/download/continuous/mpv-Media-Player_0.40.0-3-archimage4.3-x86_64.AppImage 2 | -------------------------------------------------------------------------------- /legacy/mpv-ppa.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | APP=mpv 4 | 5 | mkdir tmp; 6 | cd tmp; 7 | 8 | # DOWNLOADING THE DEPENDENCIES 9 | wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(uname -m).AppImage -O appimagetool 10 | wget https://raw.githubusercontent.com/ivan-hc/AM-application-manager/main/tools/pkg2appimage 11 | chmod a+x ./appimagetool ./pkg2appimage 12 | 13 | # CREATING THE APPIMAGE: APPDIR FROM A RECIPE... 14 | PREVIOUSLTS=$(wget -q https://releases.ubuntu.com/ -O - | grep class | grep LTS | grep -m2 href | tail -n1 | sed -n 's/.*href="\([^"]*\).*/\1/p' | rev| cut -c 2- | rev) 15 | LIBPLACEBO=$(wget -q https://deb-multimedia.org/dists/unstable/main/binary-amd64/ -O - | grep libplacebo | tail -1 | grep -o -P '(?<=package">).*(?=)') 16 | LIBPLACEBOLATEST=$(wget -q https://deb-multimedia.org/pool/main/libp/libplacebo-dmo/ -O - | grep $LIBPLACEBO | grep amd64 | grep -o -P '(?<=deb">).*(?=)') 17 | LIBSHADERC=$(wget -q http://ftp.de.debian.org/debian/pool/main/s/shaderc/ -O - | grep libshaderc1_ | grep amd64 | grep -o -P '(?<=deb">).*(?=)') 18 | LIBSHADERCDEV=$(wget -q http://ftp.de.debian.org/debian/pool/main/s/shaderc/ -O - | grep libshaderc-dev | grep amd64 | grep -o -P '(?<=deb">).*(?=)') 19 | LIBILBC=$(wget -q https://www.deb-multimedia.org/pool/main/libi/libilbc-dmo/ -O - | grep libilbc | grep amd64 | tail -1 | grep -o -P '(?<=deb">).*(?=)') 20 | LIBVMAF=$(wget -q https://www.deb-multimedia.org/pool/main/v/vmaf-dmo/ -O - | grep libvmaf | grep amd64 | tail -1 | grep -o -P '(?<=deb">).*(?=)') 21 | 22 | libvmaf 23 | echo "app: mpv 24 | binpatch: true 25 | 26 | ingredients: 27 | dist: $PREVIOUSLTS 28 | package: mpv 29 | sources: 30 | - deb http://archive.ubuntu.com/ubuntu $PREVIOUSLTS main universe 31 | - deb http://security.ubuntu.com/ubuntu $PREVIOUSLTS-security main universe 32 | ppas: 33 | - savoury1/ffmpeg6 34 | - savoury1/mpv 35 | - savoury1/build-tools 36 | - savoury1/backports 37 | - savoury1/graphics 38 | - savoury1/backports 39 | - savoury1/python 40 | - savoury1/fonts 41 | script: 42 | - wget https://deb-multimedia.org/pool/main/libp/libplacebo-dmo/$LIBPLACEBOLATEST 43 | - wget http://ftp.de.debian.org/debian/pool/main/s/shaderc/$LIBSHADERC 44 | - wget http://ftp.de.debian.org/debian/pool/main/s/shaderc/$LIBSHADERCDEV 45 | - wget https://www.deb-multimedia.org/pool/main/libi/libilbc-dmo/$LIBILBC 46 | - wget https://deb-multimedia.org/pool/main/v/vmaf-dmo/$LIBVMAF 47 | packages: 48 | - mpv 49 | - libstdc++6 50 | - $LIBPLACEBO 51 | - libretro-snes9x 52 | - libshaderc1 53 | - libshaderc-dev" >> recipe.yml; 54 | 55 | ./pkg2appimage ./recipe.yml; 56 | 57 | # ...DOWNLOADING LIBUNIONPRELOAD... 58 | wget https://github.com/project-portable/libunionpreload/releases/download/amd64/libunionpreload.so 59 | chmod a+x libunionpreload.so 60 | mv ./libunionpreload.so ./$APP/$APP.AppDir/ 61 | 62 | # ...REPLACING THE EXISTING APPRUN WITH A CUSTOM ONE... 63 | rm -R -f ./$APP/$APP.AppDir/AppRun 64 | cat >> ./$APP/$APP.AppDir/AppRun << 'EOF' 65 | #!/bin/sh 66 | HERE="$(dirname "$(readlink -f "${0}")")" 67 | export UNION_PRELOAD="${HERE}" 68 | export LD_PRELOAD="${HERE}/libunionpreload.so" 69 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${PATH}" 70 | export LD_LIBRARY_PATH=/lib/:/lib64/:/usr/lib/:/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/lib/:"${HERE}"/lib/x86_64-linux-gnu/:"${LD_LIBRARY_PATH}" 71 | export PYTHONPATH="${HERE}"/usr/share/python3/:"${PYTHONPATH}" 72 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 73 | export MPV_CONFIG_PATH=$HERE/etc/mpv/:$MPV_CONFIG_PATH 74 | exec ${HERE}/usr/bin/mpv "$@" 75 | EOF 76 | chmod a+x ./$APP/$APP.AppDir/AppRun 77 | mv ./AppRun ./$APP/$APP.AppDir 78 | 79 | # ...IMPORT THE LAUNCHER AND THE ICON TO THE APPDIR (uncomment if not available)... 80 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/22x22/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 81 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/24x24/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 82 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/32x32/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 83 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/48x48/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 84 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/64x64/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 85 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/128x128/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 86 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/256x256/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 87 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/512x512/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 88 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/scalable/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 89 | cp ./$APP/$APP.AppDir/usr/share/applications/$APP* ./$APP/$APP.AppDir/ 2>/dev/null 90 | 91 | # ...EXPORT THE APPDIR TO AN APPIMAGE! 92 | ARCH=x86_64 ./appimagetool -n ./$APP/$APP.AppDir 93 | cd ..; 94 | mv ./tmp/*.AppImage . 95 | -------------------------------------------------------------------------------- /mpv-junest.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | APP=mpv 4 | BIN="$APP" #CHANGE THIS IF THE NAME OF THE BINARY IS DIFFERENT FROM "$APP" (for example, the binary of "obs-studio" is "obs") 5 | DEPENDENCES="ytfzf yt-dlp nss-mdns" #SYNTAX: "APP1 APP2 APP3 APP4...", LEAVE BLANK IF NO OTHER DEPENDENCIES ARE NEEDED 6 | #BASICSTUFF="binutils debugedit gzip" 7 | #COMPILERS="base-devel" 8 | 9 | ############################################################################# 10 | # KEYWORDS TO FIND AND SAVE WHEN COMPILING THE APPIMAGE 11 | ############################################################################# 12 | 13 | BINSAVED="SAVEBINSPLEASE" 14 | SHARESAVED="SAVESHAREPLEASE" 15 | lib_audio_keywords="alsa jack pipewire pulse" 16 | lib_browser_launcher="gio-launch-desktop libasound.so libatk-bridge libatspi libcloudproviders libdb- libdl.so libedit libepoxy libgtk-3.so.0 libjson-glib libnssutil libpthread.so librt.so libtinysparql libwayland-cursor libX11-xcb.so libxapp-gtk3-module.so libXcursor libXdamage libXi.so libxkbfile.so libXrandr p11 pk" 17 | LIBSAVED="libglslang-default-resource-limits libsoxr.so libsodium.so libFLAC.so libSDL $lib_audio_keywords $lib_browser_launcher" 18 | 19 | [ -n "$lib_browser_launcher" ] && DEPENDENCES="$DEPENDENCES xapp hicolor-icon-theme" 20 | 21 | ############################################################################# 22 | # SETUP THE ENVIRONMENT 23 | ############################################################################# 24 | 25 | # Download appimagetool 26 | if [ ! -f ./appimagetool ]; then 27 | echo "-----------------------------------------------------------------------------" 28 | echo "◆ Downloading \"appimagetool\" from https://github.com/AppImage/appimagetool" 29 | echo "-----------------------------------------------------------------------------" 30 | curl -#Lo appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage && chmod a+x appimagetool 31 | fi 32 | 33 | # Create and enter the AppDir 34 | mkdir -p "$APP".AppDir archlinux && cd archlinux || exit 1 35 | 36 | # Set archlinux as a temporary $HOME directory 37 | HOME="$(dirname "$(readlink -f "$0")")" 38 | 39 | ############################################################################# 40 | # DOWNLOAD, INSTALL AND CONFIGURE JUNEST 41 | ############################################################################# 42 | 43 | _enable_multilib() { 44 | printf "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> ./.junest/etc/pacman.conf 45 | } 46 | 47 | _enable_chaoticaur() { 48 | # This function is ment to be used during the installation of JuNest, see "_pacman_patches" 49 | ./.local/share/junest/bin/junest -- sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com 50 | ./.local/share/junest/bin/junest -- sudo pacman-key --lsign-key 3056513887B78AEB 51 | ./.local/share/junest/bin/junest -- sudo pacman-key --populate chaotic 52 | ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' 53 | printf "\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist" >> ./.junest/etc/pacman.conf 54 | } 55 | 56 | _custom_mirrorlist() { 57 | COUNTRY=$(curl -i ipinfo.io 2>/dev/null | grep country | cut -c 15- | cut -c -2) 58 | if [ -n "$GITHUB_REPOSITORY_OWNER" ] || ! curl --output /dev/null --silent --head --fail "https://archlinux.org/mirrorlist/?country=$COUNTRY" 1>/dev/null; then 59 | curl -Ls https://archlinux.org/mirrorlist/all | awk NR==2 RS= | sed 's/#Server/Server/g' > ./.junest/etc/pacman.d/mirrorlist 60 | else 61 | curl -Ls "https://archlinux.org/mirrorlist/?country=$COUNTRY" | sed 's/#Server/Server/g' > ./.junest/etc/pacman.d/mirrorlist 62 | fi 63 | } 64 | 65 | _bypass_signature_check_level() { 66 | sed -i 's/#SigLevel/SigLevel/g; s/Required DatabaseOptional/Never/g' ./.junest/etc/pacman.conf 67 | } 68 | 69 | _install_junest() { 70 | echo "-----------------------------------------------------------------------------" 71 | echo "◆ Clone JuNest from https://github.com/fsquillace/junest" 72 | echo "-----------------------------------------------------------------------------" 73 | git clone https://github.com/fsquillace/junest.git ./.local/share/junest 74 | echo "-----------------------------------------------------------------------------" 75 | echo "◆ Downloading JuNest archive from https://github.com/ivan-hc/junest" 76 | echo "-----------------------------------------------------------------------------" 77 | curl -#Lo junest-x86_64.tar.gz https://github.com/ivan-hc/junest/releases/download/continuous/junest-x86_64.tar.gz 78 | ./.local/share/junest/bin/junest setup -i junest-x86_64.tar.gz 79 | rm -f junest-x86_64.tar.gz 80 | echo " Apply patches to PacMan..." 81 | #_enable_multilib 82 | #_enable_chaoticaur 83 | _custom_mirrorlist 84 | _bypass_signature_check_level 85 | 86 | # Update arch linux in junest 87 | ./.local/share/junest/bin/junest -- sudo pacman -Syy 88 | ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -Syu 89 | } 90 | 91 | if ! test -d "$HOME/.local/share/junest"; then 92 | echo "-----------------------------------------------------------------------------" 93 | echo " DOWNLOAD, INSTALL AND CONFIGURE JUNEST" 94 | echo "-----------------------------------------------------------------------------" 95 | _install_junest 96 | else 97 | echo "-----------------------------------------------------------------------------" 98 | echo " RESTART JUNEST" 99 | echo "-----------------------------------------------------------------------------" 100 | fi 101 | 102 | ############################################################################# 103 | # INSTALL PROGRAMS USING YAY 104 | ############################################################################# 105 | 106 | ./.local/share/junest/bin/junest -- yay -Syy 107 | #./.local/share/junest/bin/junest -- gpg --keyserver keyserver.ubuntu.com --recv-key C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF # UNCOMMENT IF YOU USE THE AUR 108 | if [ -n "$BASICSTUFF" ]; then 109 | ./.local/share/junest/bin/junest -- yay --noconfirm -S "$BASICSTUFF" 110 | fi 111 | if [ -n "$COMPILERS" ]; then 112 | ./.local/share/junest/bin/junest -- yay --noconfirm -S "$COMPILERS" 113 | fi 114 | if [ -n "$DEPENDENCES" ]; then 115 | ./.local/share/junest/bin/junest -- yay --noconfirm -S "$DEPENDENCES" 116 | fi 117 | if [ -n "$APP" ]; then 118 | ./.local/share/junest/bin/junest -- yay --noconfirm -S alsa-lib gtk3 xapp 119 | ./.local/share/junest/bin/junest -- yay --noconfirm -S "$APP" 120 | ./.local/share/junest/bin/junest -- glib-compile-schemas /usr/share/glib-2.0/schemas/ 121 | else 122 | echo "No app found, exiting"; exit 1 123 | fi 124 | 125 | cd .. 126 | 127 | echo "" 128 | echo "-----------------------------------------------------------------------------" 129 | echo " CREATING THE APPDIR" 130 | echo "-----------------------------------------------------------------------------" 131 | echo "" 132 | 133 | # Set locale 134 | rm -f archlinux/.junest/etc/locale.conf 135 | sed -i 's/LANG=${LANG:-C}/LANG=$LANG/g' archlinux/.junest/etc/profile.d/locale.sh 136 | 137 | # Add launcher and icon 138 | rm -f ./*.desktop 139 | LAUNCHER=$(grep -iRl "$BIN" archlinux/.junest/usr/share/applications/* | grep ".desktop" | head -1) 140 | cp -r "$LAUNCHER" "$APP".AppDir/ 141 | ICON=$(cat "$LAUNCHER" | grep "Icon=" | cut -c 6-) 142 | [ -z "$ICON" ] && ICON="$BIN" 143 | cp -r archlinux/.junest/usr/share/icons/*"$ICON"* "$APP".AppDir/ 2>/dev/null 144 | cp -r archlinux/.junest/usr/share/icons/hicolor/22x22/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 145 | cp -r archlinux/.junest/usr/share/icons/hicolor/24x24/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 146 | cp -r archlinux/.junest/usr/share/icons/hicolor/32x32/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 147 | cp -r archlinux/.junest/usr/share/icons/hicolor/48x48/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 148 | cp -r archlinux/.junest/usr/share/icons/hicolor/64x64/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 149 | cp -r archlinux/.junest/usr/share/icons/hicolor/128x128/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 150 | cp -r archlinux/.junest/usr/share/icons/hicolor/192x192/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 151 | cp -r archlinux/.junest/usr/share/icons/hicolor/256x256/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 152 | cp -r archlinux/.junest/usr/share/icons/hicolor/512x512/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 153 | cp -r archlinux/.junest/usr/share/icons/hicolor/scalable/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 154 | cp -r archlinux/.junest/usr/share/pixmaps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 155 | 156 | # Test if the desktop file and the icon are in the root of the future appimage (./*appdir/*) 157 | if test -f "$APP".AppDir/*.desktop; then 158 | echo "◆ The .desktop file is available in $APP.AppDir/" 159 | elif test -f archlinux/.junest/usr/bin/"$BIN"; then 160 | echo "◆ No .desktop file available for $APP, creating a new one" 161 | cat <<-HEREDOC >> "$APP".AppDir/"$APP".desktop 162 | [Desktop Entry] 163 | Version=1.0 164 | Type=Application 165 | Name=$(echo "$APP" | tr '[:lower:]' '[:upper:]') 166 | Comment= 167 | Exec=$BIN 168 | Icon=tux 169 | Categories=Utility; 170 | Terminal=true 171 | StartupNotify=true 172 | HEREDOC 173 | curl -Lo "$APP".AppDir/tux.png https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/favicon.ico 2>/dev/null 174 | else 175 | echo "No binary in path... aborting all the processes." 176 | exit 0 177 | fi 178 | 179 | if [ ! -d "$APP".AppDir/.local ]; then 180 | mkdir -p "$APP".AppDir/.local 181 | rsync -av archlinux/.local/ "$APP".AppDir/.local/ | echo "◆ Rsync .local directory to the AppDir" 182 | # Made JuNest a portable app and remove "read-only file system" errors 183 | sed -i 's#${JUNEST_HOME}/usr/bin/junest_wrapper#${HOME}/.cache/junest_wrapper.old#g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 184 | sed -i 's/rm -f "${JUNEST_HOME}${bin_path}_wrappers/#rm -f "${JUNEST_HOME}${bin_path}_wrappers/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 185 | sed -i 's/ln/#ln/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 186 | sed -i 's/rm -f "$file"/test -f "$file"/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 187 | sed -i 's#--bind "$HOME" "$HOME"#--bind-try /home /home --bind-try /run/user /run/user#g' "$APP".AppDir/.local/share/junest/lib/core/namespace.sh 188 | fi 189 | 190 | echo "◆ Rsync .junest directories structure to the AppDir" 191 | rm -Rf "$APP".AppDir/.junest/* 192 | archdirs=$(find archlinux/.junest -type d | sed 's/^archlinux\///g') 193 | for d in $archdirs; do 194 | mkdir -p "$APP".AppDir/"$d" 195 | done 196 | symlink_dirs=" bin sbin lib lib64 usr/sbin usr/lib64" 197 | for l in $symlink_dirs; do 198 | cp -r archlinux/.junest/"$l" "$APP".AppDir/.junest/"$l" 199 | done 200 | 201 | rsync -av archlinux/.junest/usr/bin_wrappers/ "$APP".AppDir/.junest/usr/bin_wrappers/ | echo "◆ Rsync bin_wrappers to the AppDir" 202 | rsync -av archlinux/.junest/etc/* "$APP".AppDir/.junest/etc/ | echo "◆ Rsync /etc" 203 | 204 | ############################################################################# 205 | # APPRUN 206 | ############################################################################# 207 | 208 | rm -f "$APP".AppDir/AppRun 209 | cat <<-'HEREDOC' >> "$APP".AppDir/AppRun 210 | #!/bin/sh 211 | HERE="$(dirname "$(readlink -f "$0")")" 212 | export UNION_PRELOAD="$HERE" 213 | export JUNEST_HOME="$HERE"/.junest 214 | 215 | if command -v unshare >/dev/null 2>&1 && ! unshare --user -p /bin/true >/dev/null 2>&1; then 216 | PROOT_ON=1 217 | export PATH="$HERE"/.local/share/junest/bin/:"$PATH" 218 | mkdir -p "$HOME"/.cache 219 | else 220 | export PATH="$PATH":"$HERE"/.local/share/junest/bin 221 | fi 222 | 223 | [ -z "$NVIDIA_ON" ] && NVIDIA_ON=1 224 | if [ "$NVIDIA_ON" = 1 ]; then 225 | DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}" 226 | CONTY_DIR="${DATADIR}/Conty/overlayfs_shared" 227 | [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)" 228 | if [ -n "$nvidia_driver_version" ]; then 229 | mkdir -p "${CONTY_DIR}"/nvidia "${CONTY_DIR}"/up/usr/lib "${CONTY_DIR}"/up/usr/share 230 | nvidia_data_dirs="egl glvnd nvidia vulkan" 231 | for d in $nvidia_data_dirs; do [ ! -d "${CONTY_DIR}"/up/usr/share/"$d" ] && ln -s /usr/share/"$d" "${CONTY_DIR}"/up/usr/share/ 2>/dev/null; done 232 | [ ! -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 233 | [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty=$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version) 234 | if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then 235 | rm -f "${CONTY_DIR}"/up/usr/lib/*; echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 236 | fi 237 | /sbin/ldconfig -p > "${CONTY_DIR}"/nvidia/host_libs 238 | grep -i "nvidia\|libcuda" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2 > "${CONTY_DIR}"/nvidia/host_nvidia_libs 239 | libnv_paths=$(grep "libnv" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2) 240 | for f in $libnv_paths; do strings "${f}" | grep -qi -m 1 "nvidia" && echo "${f}" >> "${CONTY_DIR}"/nvidia/host_nvidia_libs; done 241 | nvidia_libs=$(cat "${CONTY_DIR}"/nvidia/host_nvidia_libs) 242 | for n in $nvidia_libs; do libname=$(echo "$n" | sed 's:.*/::') && [ ! -f "${CONTY_DIR}"/up/usr/lib/"$libname" ] && cp "$n" "${CONTY_DIR}"/up/usr/lib/; done 243 | libvdpau_nvidia="${CONTY_DIR}/up/usr/lib/libvdpau_nvidia.so" 244 | if ! test -f "${libvdpau_nvidia}*"; then cp "$(find /usr/lib -type f -name 'libvdpau_nvidia.so*' -print -quit 2>/dev/null | head -1)" "${CONTY_DIR}"/up/usr/lib/; fi 245 | [ -f "${libvdpau_nvidia}"."${nvidia_driver_version}" ] && [ ! -f "${libvdpau_nvidia}" ] && ln -s "${libvdpau_nvidia}"."${nvidia_driver_version}" "${libvdpau_nvidia}" 246 | [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}" 247 | [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}" 248 | fi 249 | fi 250 | 251 | PROOT_BINDINGS="" 252 | BWRAP_BINDINGS="" 253 | 254 | bind_files="/etc/resolv.conf /etc/hosts /etc/nsswitch.conf /etc/passwd /etc/group /etc/machine-id /etc/asound.conf /etc/localtime " 255 | for f in $bind_files; do [ -f "$f" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$f" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --ro-bind-try $f $f"; done 256 | 257 | bind_dirs=" /media /mnt /opt /run/media /usr/lib/locale /usr/share/fonts /usr/share/themes /var" 258 | for d in $bind_dirs; do [ -d "$d" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$d" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --bind-try $d $d"; done 259 | 260 | PROOT_BINDS=" --bind=/dev --bind=/sys --bind=/tmp --bind=/proc $PROOT_BINDINGS --bind=/home --bind=/home/$USER " 261 | BWRAP_BINDS=" --dev-bind /dev /dev --ro-bind /sys /sys --bind-try /tmp /tmp --proc /proc $BWRAP_BINDINGS " 262 | 263 | _JUNEST_CMD() { 264 | if [ "$PROOT_ON" = 1 ]; then 265 | "$HERE"/.local/share/junest/bin/junest proot -n -b "$PROOT_BINDS" "$@" 266 | else 267 | "$HERE"/.local/share/junest/bin/junest -n -b "$BWRAP_BINDS" "$@" 268 | fi 269 | } 270 | 271 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 272 | 273 | case "$1" in 274 | '') _JUNEST_CMD -- /usr/bin/$EXEC "$@";; 275 | *) _JUNEST_CMD -- /usr/bin/mpv "$@";; 276 | esac 277 | 278 | HEREDOC 279 | chmod a+x "$APP".AppDir/AppRun 280 | 281 | ############################################################################# 282 | # EXTRACT PACKAGES 283 | ############################################################################# 284 | 285 | [ -z "$extraction_count" ] && extraction_count=0 286 | [ ! -f ./autodeps ] && echo "$extraction_count" > ./autodeps 287 | [ -f ./autodeps ] && autodeps=$(cat ./autodeps) 288 | [ "$autodeps" != "$extraction_count" ] && rm -Rf ./deps ./packages && echo "$extraction_count" > ./autodeps 289 | 290 | [ ! -f ./userdeps ] && echo "$DEPENDENCES" > ./userdeps 291 | [ -f ./userdeps ] && userdeps=$(cat ./userdeps) 292 | [ "$userdeps" != "$DEPENDENCES" ] && rm -Rf ./deps ./packages && echo "$DEPENDENCES" > ./userdeps 293 | 294 | _extract_main_package() { 295 | mkdir -p base 296 | rm -Rf ./base/* 297 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 298 | if [ "$(echo "$pkg_full_path" | wc -l)" = 1 ]; then 299 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 300 | else 301 | for p in $pkg_full_path; do 302 | if tar fx "$p" .PKGINFO -O | grep -q "pkgname = $APP$"; then 303 | pkg_full_path="$p" 304 | fi 305 | done 306 | fi 307 | [ -z "$pkg_full_path" ] && echo "💀 ERROR: no package found for \"$APP\", operation aborted!" && exit 0 308 | tar fx "$pkg_full_path" -C ./base/ 309 | VERSION=$(cat ./base/.PKGINFO | grep pkgver | cut -c 10- | sed 's@.*:@@') 310 | mkdir -p deps 311 | } 312 | 313 | _download_missing_packages() { 314 | localpackage=$(find ./archlinux -name "$arg-[0-9]*zst") 315 | if ! test -f "$localpackage"; then 316 | ./archlinux/.local/share/junest/bin/junest -- yay --noconfirm -Sw "$arg" 317 | fi 318 | } 319 | 320 | _extract_package() { 321 | _download_missing_packages &> /dev/null 322 | pkg_full_path=$(find ./archlinux -name "$arg-[0-9]*zst") 323 | pkgname=$(echo "$pkg_full_path" | sed 's:.*/::') 324 | [ ! -f ./packages ] && rm -Rf ./deps/* && touch ./packages 325 | if [ -z "$( ls -A './deps' )" ]; then 326 | rm -f ./packages 327 | echo "" 328 | echo "-----------------------------------------------------------------------------" 329 | echo " EXTRACTING PACKAGES" 330 | echo "-----------------------------------------------------------------------------" 331 | echo "" 332 | fi 333 | if test -f "$pkg_full_path"; then 334 | if ! grep -q "$pkgname" ./packages 2>/dev/null;then 335 | echo "◆ Extracting $pkgname" 336 | tar fx "$pkg_full_path" -C ./deps/ --warning=no-unknown-keyword 337 | echo "$pkgname" >> ./packages 338 | fi 339 | [ -n "$lib_browser_launcher" ] && [[ "$arg" =~ (hicolor-icon-theme|xapp) ]] && tar fx "$pkg_full_path" -C ./base/ --warning=no-unknown-keyword --exclude='.PKGINFO' 340 | fi 341 | } 342 | 343 | _determine_packages_and_libraries() { 344 | if echo "$arg" | grep -q "\.so"; then 345 | LIBSAVED="$LIBSAVED $arg" 346 | elif [ "$arg" != autoconf ] && [ "$arg" != autoconf ] && [ "$arg" != automake ] && [ "$arg" != bison ] && [ "$arg" != debugedit ] && [ "$arg" != dkms ] && [ "$arg" != fakeroot ] && [ "$arg" != flatpak ] && [ "$arg" != linux ] && [ "$arg" != gcc ] && [ "$arg" != make ] && [ "$arg" != pacman ] && [ "$arg" != patch ] && [ "$arg" != systemd ]; then 347 | _extract_package 348 | cat ./deps/.PKGINFO 2>/dev/null | grep "^depend = " | cut -c 10- | sed 's/=.*//' >> depdeps 349 | rm -f ./deps/.* 350 | fi 351 | } 352 | 353 | _extract_deps() { 354 | DEPS=$(sort -u ./depdeps) 355 | for arg in $DEPS; do 356 | _determine_packages_and_libraries 357 | done 358 | } 359 | 360 | _extract_all_dependences() { 361 | rm -f ./depdeps 362 | 363 | OPTDEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^optdepend = " | sed 's/optdepend = //g' | sed 's/=.*//' | sed 's/:.*//') 364 | for arg in $OPTDEPS; do 365 | _determine_packages_and_libraries 366 | done 367 | [ -f ./depdeps ] && _extract_deps 368 | rm -f ./depdeps 369 | 370 | ARGS=$(echo "$DEPENDENCES" | tr " " "\n") 371 | for arg in $ARGS; do 372 | _determine_packages_and_libraries 373 | done 374 | 375 | DEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^depend = " | sed 's/depend = //g' | sed 's/=.*//') 376 | for arg in $DEPS; do 377 | _determine_packages_and_libraries 378 | done 379 | 380 | # Set the level of sub-dependencies extraction, the higher the number, the bigger the AppImage will be 381 | if [ "$extraction_count" != 0 ]; then 382 | for e in $(seq "$extraction_count"); do _extract_deps; done 383 | fi 384 | } 385 | 386 | _extract_main_package 387 | _extract_all_dependences 388 | 389 | echo "" 390 | echo "-----------------------------------------------------------------------------" 391 | echo " IMPLEMENTING NECESSARY LIBRARIES (MAY TAKE SEVERAL MINUTES)" 392 | echo "-----------------------------------------------------------------------------" 393 | echo "" 394 | 395 | # Save files in /usr/bin 396 | _savebins() { 397 | echo "◆ Saving files in /usr/bin" 398 | cp -r ./archlinux/.junest/usr/bin/bwrap ./"$APP".AppDir/.junest/usr/bin/ 399 | cp -r ./archlinux/.junest/usr/bin/proot* ./"$APP".AppDir/.junest/usr/bin/ 400 | cp -r ./archlinux/.junest/usr/bin/*$BIN* ./"$APP".AppDir/.junest/usr/bin/ 401 | coreutils="[ basename cat chmod chown cp cut dir dirname du echo env expand expr fold head id ln ls mkdir mv readlink realpath rm rmdir seq sleep sort stty sum sync tac tail tee test timeout touch tr true tty uname uniq wc who whoami yes" 402 | utils_bin="awk bash $coreutils gawk gio grep ld ldd sed sh strings xdg-open" 403 | for b in $utils_bin; do 404 | cp -r ./archlinux/.junest/usr/bin/"$b" ./"$APP".AppDir/.junest/usr/bin/ 405 | done 406 | for arg in $BINSAVED; do 407 | cp -r ./archlinux/.junest/usr/bin/*"$arg"* ./"$APP".AppDir/.junest/usr/bin/ 408 | done 409 | } 410 | 411 | # Save files in /usr/lib 412 | _savelibs() { 413 | echo "◆ Detect libraries related to /usr/bin files" 414 | libs4bin=$(readelf -d ./"$APP".AppDir/.junest/usr/bin/* 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so") 415 | 416 | echo "◆ Saving JuNest core libraries" 417 | cp -r ./archlinux/.junest/usr/lib/ld-linux-x86-64.so* ./"$APP".AppDir/.junest/usr/lib/ 418 | lib_preset="$APP $BIN gconv libdw libelf libresolv.so libtinfo.so $libs4bin" 419 | LIBSAVED="$lib_preset $LIBSAVED $SHARESAVED" 420 | for arg in $LIBSAVED; do 421 | LIBPATHS="$LIBPATHS $(find ./archlinux/.junest/usr/lib -maxdepth 20 -wholename "*$arg*" | sed 's/\.\/archlinux\///g')" 422 | done 423 | for arg in $LIBPATHS; do 424 | [ ! -d "$APP".AppDir/"$arg" ] && cp -r ./archlinux/"$arg" "$APP".AppDir/"$arg" & 425 | done 426 | wait 427 | core_libs=$(find ./"$APP".AppDir -type f) 428 | lib_core=$(for c in $core_libs; do readelf -d "$c" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 429 | 430 | echo "◆ Detect libraries of the main package" 431 | base_libs=$(find ./base -type f | uniq) 432 | lib_base_0=$(for b in $base_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 433 | 434 | echo "◆ Detect libraries of the dependencies" 435 | dep_libs=$(find ./deps -executable -name "*.so*") 436 | lib_deps=$(for d in $dep_libs; do readelf -d "$d" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 437 | 438 | echo "◆ Detect and copy base libs" 439 | basebin_libs=$(find ./base -executable -name "*.so*") 440 | lib_base_1=$(for b in $basebin_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 441 | lib_base_1=$(echo "$lib_base_1" | tr ' ' '\n' | sort -u | xargs) 442 | lib_base_2=$(for b in $lib_base_1; do readelf -d ./archlinux/.junest/usr/lib/"$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 443 | lib_base_2=$(echo "$lib_base_2" | tr ' ' '\n' | sort -u | xargs) 444 | lib_base_3=$(for b in $lib_base_2; do readelf -d ./archlinux/.junest/usr/lib/"$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 445 | lib_base_3=$(echo "$lib_base_3" | tr ' ' '\n' | sort -u | xargs) 446 | lib_base_4=$(for b in $lib_base_3; do readelf -d ./archlinux/.junest/usr/lib/"$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 447 | lib_base_4=$(echo "$lib_base_4" | tr ' ' '\n' | sort -u | xargs) 448 | lib_base_5=$(for b in $lib_base_4; do readelf -d ./archlinux/.junest/usr/lib/"$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 449 | lib_base_5=$(echo "$lib_base_5" | tr ' ' '\n' | sort -u | xargs) 450 | lib_base_6=$(for b in $lib_base_5; do readelf -d ./archlinux/.junest/usr/lib/"$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 451 | lib_base_6=$(echo "$lib_base_6" | tr ' ' '\n' | sort -u | xargs) 452 | lib_base_7=$(for b in $lib_base_6; do readelf -d ./archlinux/.junest/usr/lib/"$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 453 | lib_base_7=$(echo "$lib_base_7" | tr ' ' '\n' | sort -u | xargs) 454 | lib_base_8=$(for b in $lib_base_7; do readelf -d ./archlinux/.junest/usr/lib/"$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 455 | lib_base_8=$(echo "$lib_base_8" | tr ' ' '\n' | sort -u | xargs) 456 | lib_base_9=$(for b in $lib_base_8; do readelf -d ./archlinux/.junest/usr/lib/"$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 457 | lib_base_9=$(echo "$lib_base_9" | tr ' ' '\n' | sort -u | xargs) 458 | lib_base_libs="$lib_core $lib_base_0 $lib_base_1 $lib_base_2 $lib_base_3 $lib_base_4 $lib_base_5 $lib_base_6 $lib_base_7 $lib_base_8 $lib_base_9 $lib_deps" 459 | lib_base_libs=$(echo "$lib_base_libs" | tr ' ' '\n' | sort -u | sed 's/.so.*/.so/' | xargs) 460 | for l in $lib_base_libs; do 461 | rsync -av ./archlinux/.junest/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 462 | done 463 | wait 464 | for l in $lib_base_libs; do 465 | rsync -av ./deps/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 466 | done 467 | wait 468 | } 469 | 470 | # Save files in /usr/share 471 | _saveshare() { 472 | echo "◆ Saving directories in /usr/share" 473 | SHARESAVED="$SHARESAVED $APP $BIN fontconfig glib- locale mime wayland X11" 474 | for arg in $SHARESAVED; do 475 | cp -r ./archlinux/.junest/usr/share/*"$arg"* ./"$APP".AppDir/.junest/usr/share/ 476 | done 477 | } 478 | 479 | _savebins 2>/dev/null 480 | _savelibs 2>/dev/null 481 | _saveshare 2>/dev/null 482 | 483 | echo "" 484 | echo "-----------------------------------------------------------------------------" 485 | echo " ASSEMBLING THE APPIMAGE" 486 | echo "-----------------------------------------------------------------------------" 487 | echo "" 488 | 489 | _rsync_main_package() { 490 | rm -Rf ./base/.* 491 | rsync -av ./base/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync the content of the \"$APP\" package" 492 | } 493 | 494 | _rsync_dependences() { 495 | rm -Rf ./deps/.* 496 | chmod -R 777 ./deps/* 497 | rsync -av ./deps/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync all dependencies, please wait" 498 | } 499 | 500 | _rsync_main_package 501 | _rsync_dependences 502 | 503 | ############################################################################# 504 | # REMOVE BLOATWARES, ENABLE MOUNTPOINTS 505 | ############################################################################# 506 | 507 | _remove_more_bloatwares() { 508 | etc_remove="makepkg.conf pacman" 509 | for r in $etc_remove; do 510 | rm -Rf ./"$APP".AppDir/.junest/etc/"$r"* 511 | done 512 | bin_remove="gcc" 513 | for r in $bin_remove; do 514 | rm -Rf ./"$APP".AppDir/.junest/usr/bin/"$r"* 515 | done 516 | lib_remove="d3d gcc libgphobos" 517 | for r in $lib_remove; do 518 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/"$r"* 519 | done 520 | share_remove="gcc gir i18n terminfo z" 521 | for r in $share_remove; do 522 | rm -Rf ./"$APP".AppDir/.junest/usr/share/"$r"* 523 | done 524 | echo Y | rm -Rf ./"$APP".AppDir/.cache/yay/* 525 | find ./"$APP".AppDir/.junest/usr/share/doc/* -not -iname "*$BIN*" -a -not -name "." -delete 2> /dev/null #REMOVE ALL DOCUMENTATION NOT RELATED TO THE APP 526 | find ./"$APP".AppDir/.junest/usr/share/locale/*/*/* -not -iname "*$BIN*" -a -not -name "." -delete 2> /dev/null #REMOVE ALL ADDITIONAL LOCALE FILES 527 | rm -Rf ./"$APP".AppDir/.junest/home # remove the inbuilt home 528 | rm -Rf ./"$APP".AppDir/.junest/usr/include # files related to the compiler 529 | rm -Rf ./"$APP".AppDir/.junest/usr/share/man # AppImages are not ment to have man command 530 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/python*/__pycache__/* # if python is installed, removing this directory can save several megabytes 531 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgallium* 532 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgo.so* 533 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/libLLVM* # included in the compilation phase, can sometimes be excluded for daily use 534 | rm -Rf ./"$APP".AppDir/.junest/var/* # remove all packages downloaded with the package manager 535 | } 536 | 537 | _enable_mountpoints_for_the_inbuilt_bubblewrap() { 538 | mkdir -p ./"$APP".AppDir/.junest/home 539 | mkdir -p ./"$APP".AppDir/.junest/media 540 | mkdir -p ./"$APP".AppDir/.junest/usr/lib/locale 541 | mkdir -p ./"$APP".AppDir/.junest/usr/share/fonts 542 | mkdir -p ./"$APP".AppDir/.junest/usr/share/themes 543 | mkdir -p ./"$APP".AppDir/.junest/run/media 544 | mkdir -p ./"$APP".AppDir/.junest/run/user 545 | rm -f ./"$APP".AppDir/.junest/etc/localtime && touch ./"$APP".AppDir/.junest/etc/localtime 546 | [ ! -f ./"$APP".AppDir/.junest/etc/asound.conf ] && touch ./"$APP".AppDir/.junest/etc/asound.conf 547 | } 548 | 549 | _remove_more_bloatwares 550 | find ./"$APP".AppDir/.junest/usr/lib ./"$APP".AppDir/.junest/usr/lib32 -type f -regex '.*\.a' -exec rm -f {} \; 2>/dev/null 551 | find ./"$APP".AppDir/.junest/usr -type f -regex '.*\.so.*' -exec strip --strip-debug {} \; 552 | find ./"$APP".AppDir/.junest/usr/bin -type f ! -regex '.*\.so.*' -exec strip --strip-unneeded {} \; 553 | find ./"$APP".AppDir/.junest/usr -type d -empty -delete 554 | _enable_mountpoints_for_the_inbuilt_bubblewrap 555 | 556 | ############################################################################# 557 | # CREATE THE APPIMAGE 558 | ############################################################################# 559 | 560 | if test -f ./*.AppImage; then rm -Rf ./*archimage*.AppImage; fi 561 | 562 | APPNAME=$(cat ./"$APP".AppDir/*.desktop | grep 'Name=' | head -1 | cut -c 6- | sed 's/ /-/g') 563 | REPO="MPV-appimage" 564 | TAG="continuous" 565 | VERSION="$VERSION" 566 | UPINFO="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|$REPO|$TAG|*x86_64.AppImage.zsync" 567 | 568 | ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ 569 | -u "$UPINFO" \ 570 | ./"$APP".AppDir "$APPNAME"_"$VERSION"-archimage4.3-x86_64.AppImage 571 | --------------------------------------------------------------------------------