├── .github ├── FUNDING.yml └── workflows │ ├── asunder.yml │ ├── audacious.yml │ ├── baobab3.yml │ ├── billard-gl.yml │ ├── capbattleship.yml │ ├── chromium-bsu.yml │ ├── cronjob.yml │ ├── extremetuxracer.yml │ ├── falkon.yml │ ├── gearlever.yml │ ├── gnome-system-monitor3.yml │ ├── kwave.yml │ ├── lxtask.yml │ ├── mate-system-monitor.yml │ ├── poedit.yml │ ├── quickemu.yml │ ├── simple-scan3.yml │ ├── simplescreenrecorder.yml │ ├── sunvox.yml │ └── webcamoid.yml ├── README.md ├── asunder-junest.sh ├── audacious-junest.sh ├── baobab3 ├── billard-gl ├── capbattleship ├── chromium-bsu-junest.sh ├── extremetuxracer ├── falkon-junest.sh ├── gearlever-junest.sh ├── gnome-system-monitor3 ├── kwave-junest.sh ├── latest-release.txt ├── lxtask ├── mate-system-monitor ├── poedit-junest.sh ├── quickemu-junest.sh ├── simple-scan3 ├── simplescreenrecorder ├── sunvox-junest.sh └── webcamoid-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/asunder.yml: -------------------------------------------------------------------------------- 1 | name: asunder Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | schedule: 8 | - cron: "0 1 * * 1" 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 ./asunder-junest.sh 24 | ./asunder-junest.sh 25 | mkdir dist 26 | mv *AppImage* dist/ 27 | - name: Upload artifact 28 | uses: actions/upload-artifact@v4.4.0 29 | with: 30 | name: asunder-x86_64.AppImage 31 | path: 'dist' 32 | 33 | release: 34 | needs: [build] 35 | runs-on: ubuntu-latest 36 | 37 | steps: 38 | - uses: actions/download-artifact@v4.1.8 39 | with: 40 | name: asunder-x86_64.AppImage 41 | 42 | - name: release 43 | uses: marvinpinto/action-automatic-releases@latest 44 | with: 45 | title: asunder 46 | automatic_release_tag: asunder 47 | prerelease: false 48 | draft: false 49 | files: | 50 | *.AppImage* 51 | repo_token: ${{ secrets.GITHUB_TOKEN }} 52 | -------------------------------------------------------------------------------- /.github/workflows/audacious.yml: -------------------------------------------------------------------------------- 1 | name: audacious Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | schedule: 8 | - cron: "0 6 * * 1" 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 ./audacious-junest.sh 24 | ./audacious-junest.sh 25 | mkdir dist 26 | mv *AppImage* dist/ 27 | - name: Upload artifact 28 | uses: actions/upload-artifact@v4.4.0 29 | with: 30 | name: audacious-x86_64.AppImage 31 | path: 'dist' 32 | 33 | release: 34 | needs: [build] 35 | runs-on: ubuntu-latest 36 | 37 | steps: 38 | - uses: actions/download-artifact@v4.1.8 39 | with: 40 | name: audacious-x86_64.AppImage 41 | 42 | - name: release 43 | uses: marvinpinto/action-automatic-releases@latest 44 | with: 45 | title: audacious 46 | automatic_release_tag: audacious 47 | prerelease: false 48 | draft: false 49 | files: | 50 | *.AppImage* 51 | repo_token: ${{ secrets.GITHUB_TOKEN }} 52 | -------------------------------------------------------------------------------- /.github/workflows/baobab3.yml: -------------------------------------------------------------------------------- 1 | name: baobab3 Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - name: build 16 | if: always() 17 | run: | 18 | sudo apt update && sudo apt install desktop-file-utils 19 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 20 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 21 | chmod a+x ./baobab3 22 | ./baobab3 23 | mkdir dist 24 | mv *AppImage dist/ 25 | - name: Upload artifact 26 | uses: actions/upload-artifact@v4.4.0 27 | with: 28 | name: baobab3-x86_64.AppImage 29 | path: 'dist' 30 | 31 | release: 32 | needs: [build] 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - uses: actions/download-artifact@v4.1.8 37 | with: 38 | name: baobab3-x86_64.AppImage 39 | 40 | - name: release 41 | uses: marvinpinto/action-automatic-releases@latest 42 | with: 43 | title: baobab3 44 | automatic_release_tag: baobab3 45 | prerelease: false 46 | draft: false 47 | files: | 48 | *.AppImage 49 | repo_token: ${{ secrets.GITHUB_TOKEN }} 50 | -------------------------------------------------------------------------------- /.github/workflows/billard-gl.yml: -------------------------------------------------------------------------------- 1 | name: billard-gl Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - name: build 16 | if: always() 17 | run: | 18 | sudo apt update && sudo apt install desktop-file-utils 19 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 20 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 21 | chmod a+x ./billard-gl 22 | ./billard-gl 23 | mkdir dist 24 | mv *AppImage dist/ 25 | - name: Upload artifact 26 | uses: actions/upload-artifact@v4.4.0 27 | with: 28 | name: billard-gl-x86_64.AppImage 29 | path: 'dist' 30 | 31 | release: 32 | needs: [build] 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - uses: actions/download-artifact@v4.1.8 37 | with: 38 | name: billard-gl-x86_64.AppImage 39 | 40 | - name: release 41 | uses: marvinpinto/action-automatic-releases@latest 42 | with: 43 | title: billard-gl 44 | automatic_release_tag: billard-gl 45 | prerelease: false 46 | draft: false 47 | files: | 48 | *.AppImage 49 | repo_token: ${{ secrets.GITHUB_TOKEN }} 50 | -------------------------------------------------------------------------------- /.github/workflows/capbattleship.yml: -------------------------------------------------------------------------------- 1 | name: capbattleship Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - name: build 16 | if: always() 17 | run: | 18 | sudo apt update && sudo apt install desktop-file-utils 19 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 20 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 21 | chmod a+x ./capbattleship 22 | ./capbattleship 23 | mkdir dist 24 | mv *AppImage dist/CAP_Pirate_Battleship-x86_64.AppImage 25 | - name: Upload artifact 26 | uses: actions/upload-artifact@v4.4.0 27 | with: 28 | name: capbattleship-x86_64.AppImage 29 | path: 'dist' 30 | 31 | release: 32 | needs: [build] 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - uses: actions/download-artifact@v4.1.8 37 | with: 38 | name: capbattleship-x86_64.AppImage 39 | 40 | - name: release 41 | uses: marvinpinto/action-automatic-releases@latest 42 | with: 43 | title: capbattleship 44 | automatic_release_tag: capbattleship 45 | prerelease: false 46 | draft: false 47 | files: | 48 | *.AppImage 49 | repo_token: ${{ secrets.GITHUB_TOKEN }} 50 | -------------------------------------------------------------------------------- /.github/workflows/chromium-bsu.yml: -------------------------------------------------------------------------------- 1 | name: chromium-bsu Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | schedule: 8 | - cron: "0 7 * * 1" 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 ./chromium-bsu-junest.sh 24 | ./chromium-bsu-junest.sh 25 | mkdir dist 26 | mv *AppImage* dist/ 27 | - name: Upload artifact 28 | uses: actions/upload-artifact@v4.4.0 29 | with: 30 | name: chromium-bsu-x86_64.AppImage 31 | path: 'dist' 32 | 33 | release: 34 | needs: [build] 35 | runs-on: ubuntu-latest 36 | 37 | steps: 38 | - uses: actions/download-artifact@v4.1.8 39 | with: 40 | name: chromium-bsu-x86_64.AppImage 41 | 42 | - name: release 43 | uses: marvinpinto/action-automatic-releases@latest 44 | with: 45 | title: chromium-bsu 46 | automatic_release_tag: chromium-bsu 47 | prerelease: false 48 | draft: false 49 | files: | 50 | *.AppImage* 51 | repo_token: ${{ secrets.GITHUB_TOKEN }} 52 | -------------------------------------------------------------------------------- /.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 | 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 | -------------------------------------------------------------------------------- /.github/workflows/extremetuxracer.yml: -------------------------------------------------------------------------------- 1 | name: extremetuxracer Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - name: build 16 | if: always() 17 | run: | 18 | sudo apt update && sudo apt install desktop-file-utils 19 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 20 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 21 | chmod a+x ./extremetuxracer 22 | ./extremetuxracer 23 | mkdir dist 24 | mv *AppImage dist/ 25 | - name: Upload artifact 26 | uses: actions/upload-artifact@v4.4.0 27 | with: 28 | name: extremetuxracer-x86_64.AppImage 29 | path: 'dist' 30 | 31 | release: 32 | needs: [build] 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - uses: actions/download-artifact@v4.1.8 37 | with: 38 | name: extremetuxracer-x86_64.AppImage 39 | 40 | - name: release 41 | uses: marvinpinto/action-automatic-releases@latest 42 | with: 43 | title: extremetuxracer 44 | automatic_release_tag: extremetuxracer 45 | prerelease: false 46 | draft: false 47 | files: | 48 | *.AppImage 49 | repo_token: ${{ secrets.GITHUB_TOKEN }} 50 | -------------------------------------------------------------------------------- /.github/workflows/falkon.yml: -------------------------------------------------------------------------------- 1 | name: falkon Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | schedule: 8 | - cron: "0 8 * * 1" 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 ./falkon-junest.sh 24 | ./falkon-junest.sh 25 | mkdir dist 26 | mv *AppImage* dist/ 27 | - name: Upload artifact 28 | uses: actions/upload-artifact@v4.4.0 29 | with: 30 | name: falkon-x86_64.AppImage 31 | path: 'dist' 32 | 33 | release: 34 | needs: [build] 35 | runs-on: ubuntu-latest 36 | 37 | steps: 38 | - uses: actions/download-artifact@v4.1.8 39 | with: 40 | name: falkon-x86_64.AppImage 41 | 42 | - name: release 43 | uses: marvinpinto/action-automatic-releases@latest 44 | with: 45 | title: falkon 46 | automatic_release_tag: falkon 47 | prerelease: false 48 | draft: false 49 | files: | 50 | *.AppImage* 51 | repo_token: ${{ secrets.GITHUB_TOKEN }} 52 | -------------------------------------------------------------------------------- /.github/workflows/gearlever.yml: -------------------------------------------------------------------------------- 1 | name: gearlever Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | schedule: 8 | - cron: "0 3 * * 1" 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 ./gearlever-junest.sh 24 | ./gearlever-junest.sh 25 | mkdir dist 26 | mv *AppImage* dist/ 27 | - name: Upload artifact 28 | uses: actions/upload-artifact@v4.4.0 29 | with: 30 | name: gearlever-x86_64.AppImage 31 | path: 'dist' 32 | 33 | release: 34 | needs: [build] 35 | runs-on: ubuntu-latest 36 | 37 | steps: 38 | - uses: actions/download-artifact@v4.1.8 39 | with: 40 | name: gearlever-x86_64.AppImage 41 | 42 | - name: release 43 | uses: marvinpinto/action-automatic-releases@latest 44 | with: 45 | title: gearlever 46 | automatic_release_tag: gearlever 47 | prerelease: false 48 | draft: false 49 | files: | 50 | *.AppImage* 51 | repo_token: ${{ secrets.GITHUB_TOKEN }} 52 | -------------------------------------------------------------------------------- /.github/workflows/gnome-system-monitor3.yml: -------------------------------------------------------------------------------- 1 | name: gnome-system-monitor3 Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - name: build 16 | if: always() 17 | run: | 18 | sudo apt update && sudo apt install desktop-file-utils 19 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 20 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 21 | chmod a+x ./gnome-system-monitor3 22 | ./gnome-system-monitor3 23 | mkdir dist 24 | mv *AppImage dist/ 25 | - name: Upload artifact 26 | uses: actions/upload-artifact@v4.4.0 27 | with: 28 | name: gnome-system-monitor3-x86_64.AppImage 29 | path: 'dist' 30 | 31 | release: 32 | needs: [build] 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - uses: actions/download-artifact@v4.1.8 37 | with: 38 | name: gnome-system-monitor3-x86_64.AppImage 39 | 40 | - name: release 41 | uses: marvinpinto/action-automatic-releases@latest 42 | with: 43 | title: gnome-system-monitor3 44 | automatic_release_tag: gnome-system-monitor3 45 | prerelease: false 46 | draft: false 47 | files: | 48 | *.AppImage 49 | repo_token: ${{ secrets.GITHUB_TOKEN }} 50 | -------------------------------------------------------------------------------- /.github/workflows/kwave.yml: -------------------------------------------------------------------------------- 1 | name: kwave Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | schedule: 8 | - cron: "0 2 * * 1" 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 ./kwave-junest.sh 24 | ./kwave-junest.sh 25 | mkdir dist 26 | mv *AppImage* dist/ 27 | - name: Upload artifact 28 | uses: actions/upload-artifact@v4.4.0 29 | with: 30 | name: kwave-x86_64.AppImage 31 | path: 'dist' 32 | 33 | release: 34 | needs: [build] 35 | runs-on: ubuntu-latest 36 | 37 | steps: 38 | - uses: actions/download-artifact@v4.1.8 39 | with: 40 | name: kwave-x86_64.AppImage 41 | 42 | - name: release 43 | uses: marvinpinto/action-automatic-releases@latest 44 | with: 45 | title: kwave 46 | automatic_release_tag: kwave 47 | prerelease: false 48 | draft: false 49 | files: | 50 | *.AppImage* 51 | repo_token: ${{ secrets.GITHUB_TOKEN }} 52 | -------------------------------------------------------------------------------- /.github/workflows/lxtask.yml: -------------------------------------------------------------------------------- 1 | name: lxtask Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - name: build 16 | if: always() 17 | run: | 18 | sudo apt update && sudo apt install desktop-file-utils 19 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 20 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 21 | chmod a+x ./lxtask 22 | ./lxtask 23 | mkdir dist 24 | mv *AppImage dist/ 25 | - name: Upload artifact 26 | uses: actions/upload-artifact@v4.4.0 27 | with: 28 | name: lxtask-x86_64.AppImage 29 | path: 'dist' 30 | 31 | release: 32 | needs: [build] 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - uses: actions/download-artifact@v4.1.8 37 | with: 38 | name: lxtask-x86_64.AppImage 39 | 40 | - name: release 41 | uses: marvinpinto/action-automatic-releases@latest 42 | with: 43 | title: lxtask 44 | automatic_release_tag: lxtask 45 | prerelease: false 46 | draft: false 47 | files: | 48 | *.AppImage 49 | repo_token: ${{ secrets.GITHUB_TOKEN }} 50 | -------------------------------------------------------------------------------- /.github/workflows/mate-system-monitor.yml: -------------------------------------------------------------------------------- 1 | name: mate-system-monitor Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - name: build 16 | if: always() 17 | run: | 18 | sudo apt update && sudo apt install desktop-file-utils 19 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 20 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 21 | chmod a+x ./mate-system-monitor 22 | ./mate-system-monitor 23 | mkdir dist 24 | mv *AppImage dist/ 25 | - name: Upload artifact 26 | uses: actions/upload-artifact@v4.4.0 27 | with: 28 | name: mate-system-monitor-x86_64.AppImage 29 | path: 'dist' 30 | 31 | release: 32 | needs: [build] 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - uses: actions/download-artifact@v4.1.8 37 | with: 38 | name: mate-system-monitor-x86_64.AppImage 39 | 40 | - name: release 41 | uses: marvinpinto/action-automatic-releases@latest 42 | with: 43 | title: mate-system-monitor 44 | automatic_release_tag: mate-system-monitor 45 | prerelease: false 46 | draft: false 47 | files: | 48 | *.AppImage 49 | repo_token: ${{ secrets.GITHUB_TOKEN }} 50 | -------------------------------------------------------------------------------- /.github/workflows/poedit.yml: -------------------------------------------------------------------------------- 1 | name: poedit Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | schedule: 8 | - cron: "0 10 * * 1" 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 ./poedit-junest.sh 24 | ./poedit-junest.sh 25 | mkdir dist 26 | mv *AppImage* dist/ 27 | - name: Upload artifact 28 | uses: actions/upload-artifact@v4.4.0 29 | with: 30 | name: AppImage 31 | path: 'dist' 32 | 33 | release: 34 | needs: [build] 35 | runs-on: ubuntu-latest 36 | 37 | steps: 38 | - uses: actions/download-artifact@v4.1.8 39 | with: 40 | name: AppImage 41 | 42 | - name: release 43 | uses: marvinpinto/action-automatic-releases@latest 44 | with: 45 | title: poedit 46 | automatic_release_tag: poedit 47 | prerelease: false 48 | draft: false 49 | files: | 50 | *.AppImage* 51 | repo_token: ${{ secrets.GITHUB_TOKEN }} 52 | -------------------------------------------------------------------------------- /.github/workflows/quickemu.yml: -------------------------------------------------------------------------------- 1 | name: QuickEMU Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | schedule: 8 | - cron: "0 5 * * 1" 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 ./quickemu-junest.sh 24 | ./quickemu-junest.sh 25 | mkdir dist 26 | mv *AppImage* dist/ 27 | - name: Upload artifact 28 | uses: actions/upload-artifact@v4.4.0 29 | with: 30 | name: quickemu-x86_64.AppImage 31 | path: 'dist' 32 | 33 | release: 34 | needs: [build] 35 | runs-on: ubuntu-latest 36 | 37 | steps: 38 | - uses: actions/download-artifact@v4.1.8 39 | with: 40 | name: quickemu-x86_64.AppImage 41 | 42 | - name: release 43 | uses: marvinpinto/action-automatic-releases@latest 44 | with: 45 | title: quickemu 46 | automatic_release_tag: quickemu 47 | prerelease: false 48 | draft: false 49 | files: | 50 | *.AppImage* 51 | repo_token: ${{ secrets.GITHUB_TOKEN }} 52 | -------------------------------------------------------------------------------- /.github/workflows/simple-scan3.yml: -------------------------------------------------------------------------------- 1 | name: simple-scan3 Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - name: build 16 | if: always() 17 | run: | 18 | sudo apt update && sudo apt install desktop-file-utils 19 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 20 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 21 | chmod a+x ./simple-scan3 22 | ./simple-scan3 23 | mkdir dist 24 | mv *AppImage dist/ 25 | - name: Upload artifact 26 | uses: actions/upload-artifact@v4.4.0 27 | with: 28 | name: simple-scan3-x86_64.AppImage 29 | path: 'dist' 30 | 31 | release: 32 | needs: [build] 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - uses: actions/download-artifact@v4.1.8 37 | with: 38 | name: simple-scan3-x86_64.AppImage 39 | 40 | - name: release 41 | uses: marvinpinto/action-automatic-releases@latest 42 | with: 43 | title: simple-scan3 44 | automatic_release_tag: simple-scan3 45 | prerelease: false 46 | draft: false 47 | files: | 48 | *.AppImage 49 | repo_token: ${{ secrets.GITHUB_TOKEN }} 50 | -------------------------------------------------------------------------------- /.github/workflows/simplescreenrecorder.yml: -------------------------------------------------------------------------------- 1 | name: simplescreenrecorder Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - name: build 16 | if: always() 17 | run: | 18 | sudo apt update && sudo apt install desktop-file-utils 19 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 20 | sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 21 | chmod a+x ./simplescreenrecorder 22 | ./simplescreenrecorder 23 | mkdir dist 24 | mv *AppImage dist/ 25 | - name: Upload artifact 26 | uses: actions/upload-artifact@v4.4.0 27 | with: 28 | name: simplescreenrecorder-x86_64.AppImage 29 | path: 'dist' 30 | 31 | release: 32 | needs: [build] 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - uses: actions/download-artifact@v4.1.8 37 | with: 38 | name: simplescreenrecorder-x86_64.AppImage 39 | 40 | - name: release 41 | uses: marvinpinto/action-automatic-releases@latest 42 | with: 43 | title: simplescreenrecorder 44 | automatic_release_tag: simplescreenrecorder 45 | prerelease: false 46 | draft: false 47 | files: | 48 | *.AppImage 49 | repo_token: ${{ secrets.GITHUB_TOKEN }} 50 | -------------------------------------------------------------------------------- /.github/workflows/sunvox.yml: -------------------------------------------------------------------------------- 1 | name: sunvox Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | schedule: 8 | - cron: "0 9 * * 1" 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 ./sunvox-junest.sh 24 | ./sunvox-junest.sh 25 | mkdir dist 26 | mv *AppImage* dist/ 27 | - name: Upload artifact 28 | uses: actions/upload-artifact@v4.4.0 29 | with: 30 | name: AppImage 31 | path: 'dist' 32 | 33 | release: 34 | needs: [build] 35 | runs-on: ubuntu-latest 36 | 37 | steps: 38 | - uses: actions/download-artifact@v4.1.8 39 | with: 40 | name: AppImage 41 | 42 | - name: release 43 | uses: marvinpinto/action-automatic-releases@latest 44 | with: 45 | title: sunvox 46 | automatic_release_tag: sunvox 47 | prerelease: false 48 | draft: false 49 | files: | 50 | *.AppImage* 51 | repo_token: ${{ secrets.GITHUB_TOKEN }} 52 | -------------------------------------------------------------------------------- /.github/workflows/webcamoid.yml: -------------------------------------------------------------------------------- 1 | name: webcamoid Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | schedule: 8 | - cron: "0 4 * * 1" 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 ./webcamoid-junest.sh 24 | ./webcamoid-junest.sh 25 | mkdir dist 26 | mv *AppImage* dist/ 27 | - name: Upload artifact 28 | uses: actions/upload-artifact@v4.4.0 29 | with: 30 | name: webcamoid-x86_64.AppImage 31 | path: 'dist' 32 | 33 | release: 34 | needs: [build] 35 | runs-on: ubuntu-latest 36 | 37 | steps: 38 | - uses: actions/download-artifact@v4.1.8 39 | with: 40 | name: webcamoid-x86_64.AppImage 41 | 42 | - name: release 43 | uses: marvinpinto/action-automatic-releases@latest 44 | with: 45 | title: webcamoid 46 | automatic_release_tag: webcamoid 47 | prerelease: false 48 | draft: false 49 | files: | 50 | *.AppImage* 51 | repo_token: ${{ secrets.GITHUB_TOKEN }} 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository is needed to build various AppImage packages from the Debian Stable/Oldstable repository or from some PPAs for Ubuntu. 2 | 3 | ------------------------------------------------------------------------ 4 | 5 | ## Install and update them all with ease 6 | 7 | ### *"*AM*" Application Manager* 8 | #### *Package manager, database & solutions for all AppImages and portable apps for GNU/Linux!* 9 | 10 | [![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) 11 | 12 | [![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) 13 | 14 | *"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.* 15 | 16 | *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).* 17 | 18 | *"AM"/"AppMan" aims to be the default package manager for all AppImage packages, giving them a home to stay.* 19 | 20 | *You can consult the entire **list of managed apps** at [**portable-linux-apps.github.io/apps**](https://portable-linux-apps.github.io/apps).* 21 | 22 | ## *Go to *https://github.com/ivan-hc/AM* for more!* 23 | 24 | ------------------------------------------------------------------------ 25 | 26 | | [***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) | 27 | | - | - | - | - | 28 | 29 | ------------------------------------------------------------------------ 30 | -------------------------------------------------------------------------------- /asunder-junest.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | APP=asunder 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="" #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="gdk-pixbuf librsvg libdav $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 | _enable_archlinuxcn() { 57 | ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -U "https://repo.archlinuxcn.org/x86_64/$(curl -Ls https://repo.archlinuxcn.org/x86_64/ | tr '"' '\n' | grep "^archlinuxcn-keyring.*zst$" | tail -1)" 58 | printf "\n[archlinuxcn]\n#SigLevel = Never\nServer = http://repo.archlinuxcn.org/\$arch" >> ./.junest/etc/pacman.conf 59 | } 60 | 61 | _custom_mirrorlist() { 62 | COUNTRY=$(curl -i ipinfo.io 2>/dev/null | grep country | cut -c 15- | cut -c -2) 63 | if [ -n "$GITHUB_REPOSITORY_OWNER" ] || ! curl --output /dev/null --silent --head --fail "https://archlinux.org/mirrorlist/?country=$COUNTRY" 1>/dev/null; then 64 | curl -Ls https://archlinux.org/mirrorlist/all | awk NR==2 RS= | sed 's/#Server/Server/g' > ./.junest/etc/pacman.d/mirrorlist 65 | else 66 | curl -Ls "https://archlinux.org/mirrorlist/?country=$COUNTRY" | sed 's/#Server/Server/g' > ./.junest/etc/pacman.d/mirrorlist 67 | fi 68 | } 69 | 70 | _bypass_signature_check_level() { 71 | sed -i 's/#SigLevel/SigLevel/g; s/Required DatabaseOptional/Never/g' ./.junest/etc/pacman.conf 72 | } 73 | 74 | _install_junest() { 75 | echo "-----------------------------------------------------------------------------" 76 | echo "◆ Clone JuNest from https://github.com/fsquillace/junest" 77 | echo "-----------------------------------------------------------------------------" 78 | git clone https://github.com/fsquillace/junest.git ./.local/share/junest 79 | echo "-----------------------------------------------------------------------------" 80 | echo "◆ Downloading JuNest archive from https://github.com/ivan-hc/junest" 81 | echo "-----------------------------------------------------------------------------" 82 | curl -#Lo junest-x86_64.tar.gz https://github.com/ivan-hc/junest/releases/download/continuous/junest-x86_64.tar.gz 83 | ./.local/share/junest/bin/junest setup -i junest-x86_64.tar.gz 84 | rm -f junest-x86_64.tar.gz 85 | echo " Apply patches to PacMan..." 86 | #_enable_multilib 87 | _enable_chaoticaur 88 | #_enable_archlinuxcn 89 | _custom_mirrorlist 90 | _bypass_signature_check_level 91 | 92 | # Update arch linux in junest 93 | ./.local/share/junest/bin/junest -- sudo pacman -Syy 94 | ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -Syu 95 | } 96 | 97 | if ! test -d "$HOME/.local/share/junest"; then 98 | echo "-----------------------------------------------------------------------------" 99 | echo " DOWNLOAD, INSTALL AND CONFIGURE JUNEST" 100 | echo "-----------------------------------------------------------------------------" 101 | _install_junest 102 | else 103 | echo "-----------------------------------------------------------------------------" 104 | echo " RESTART JUNEST" 105 | echo "-----------------------------------------------------------------------------" 106 | fi 107 | 108 | ############################################################################# 109 | # INSTALL PROGRAMS USING YAY 110 | ############################################################################# 111 | 112 | ./.local/share/junest/bin/junest -- yay -Syy 113 | ./.local/share/junest/bin/junest -- gpg --keyserver keyserver.ubuntu.com --recv-key C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF # UNCOMMENT IF YOU USE THE AUR 114 | if [ -n "$BASICSTUFF" ]; then 115 | ./.local/share/junest/bin/junest -- yay --noconfirm -S $BASICSTUFF 116 | fi 117 | if [ -n "$COMPILERS" ]; then 118 | ./.local/share/junest/bin/junest -- yay --noconfirm -S $COMPILERS 119 | fi 120 | if [ -n "$DEPENDENCES" ]; then 121 | ./.local/share/junest/bin/junest -- yay --noconfirm -S $DEPENDENCES 122 | fi 123 | if [ -n "$APP" ]; then 124 | ./.local/share/junest/bin/junest -- yay --noconfirm -S alsa-lib gtk3 xapp 125 | ./.local/share/junest/bin/junest -- yay --noconfirm -S "$APP" 126 | ./.local/share/junest/bin/junest -- glib-compile-schemas /usr/share/glib-2.0/schemas/ 127 | else 128 | echo "No app found, exiting"; exit 1 129 | fi 130 | 131 | cd .. 132 | 133 | echo "" 134 | echo "-----------------------------------------------------------------------------" 135 | echo " CREATING THE APPDIR" 136 | echo "-----------------------------------------------------------------------------" 137 | echo "" 138 | 139 | # Set locale 140 | rm -f archlinux/.junest/etc/locale.conf 141 | sed -i 's/LANG=${LANG:-C}/LANG=$LANG/g' archlinux/.junest/etc/profile.d/locale.sh 142 | 143 | # Add launcher and icon 144 | rm -f ./*.desktop 145 | LAUNCHER=$(grep -iRl "$BIN" archlinux/.junest/usr/share/applications/* | grep ".desktop" | head -1) 146 | cp -r "$LAUNCHER" "$APP".AppDir/ 147 | ICON=$(cat "$LAUNCHER" | grep "Icon=" | cut -c 6-) 148 | [ -z "$ICON" ] && ICON="$BIN" 149 | cp -r archlinux/.junest/usr/share/icons/*"$ICON"* "$APP".AppDir/ 2>/dev/null 150 | cp -r archlinux/.junest/usr/share/icons/hicolor/22x22/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 151 | cp -r archlinux/.junest/usr/share/icons/hicolor/24x24/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 152 | cp -r archlinux/.junest/usr/share/icons/hicolor/32x32/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 153 | cp -r archlinux/.junest/usr/share/icons/hicolor/48x48/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 154 | cp -r archlinux/.junest/usr/share/icons/hicolor/64x64/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 155 | cp -r archlinux/.junest/usr/share/icons/hicolor/128x128/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 156 | cp -r archlinux/.junest/usr/share/icons/hicolor/192x192/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 157 | cp -r archlinux/.junest/usr/share/icons/hicolor/256x256/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 158 | cp -r archlinux/.junest/usr/share/icons/hicolor/512x512/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 159 | cp -r archlinux/.junest/usr/share/icons/hicolor/scalable/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 160 | cp -r archlinux/.junest/usr/share/pixmaps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 161 | 162 | # Test if the desktop file and the icon are in the root of the future appimage (./*appdir/*) 163 | if test -f "$APP".AppDir/*.desktop; then 164 | echo "◆ The .desktop file is available in $APP.AppDir/" 165 | elif test -f archlinux/.junest/usr/bin/"$BIN"; then 166 | echo "◆ No .desktop file available for $APP, creating a new one" 167 | cat <<-HEREDOC >> "$APP".AppDir/"$APP".desktop 168 | [Desktop Entry] 169 | Version=1.0 170 | Type=Application 171 | Name=$(echo "$APP" | tr '[:lower:]' '[:upper:]') 172 | Comment= 173 | Exec=$BIN 174 | Icon=tux 175 | Categories=Utility; 176 | Terminal=true 177 | StartupNotify=true 178 | HEREDOC 179 | curl -Lo "$APP".AppDir/tux.png https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/favicon.ico 2>/dev/null 180 | else 181 | echo "No binary in path... aborting all the processes." 182 | exit 0 183 | fi 184 | 185 | if [ ! -d "$APP".AppDir/.local ]; then 186 | mkdir -p "$APP".AppDir/.local 187 | rsync -av archlinux/.local/ "$APP".AppDir/.local/ | echo "◆ Rsync .local directory to the AppDir" 188 | # Made JuNest a portable app and remove "read-only file system" errors 189 | sed -i 's#${JUNEST_HOME}/usr/bin/junest_wrapper#${HOME}/.cache/junest_wrapper.old#g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 190 | 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 191 | sed -i 's/ln/#ln/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 192 | sed -i 's/rm -f "$file"/test -f "$file"/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 193 | 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 194 | fi 195 | 196 | echo "◆ Rsync .junest directories structure to the AppDir" 197 | rm -Rf "$APP".AppDir/.junest/* 198 | archdirs=$(find archlinux/.junest -type d | sed 's/^archlinux\///g') 199 | for d in $archdirs; do 200 | mkdir -p "$APP".AppDir/"$d" 201 | done 202 | symlink_dirs=" bin sbin lib lib64 usr/sbin usr/lib64" 203 | for l in $symlink_dirs; do 204 | cp -r archlinux/.junest/"$l" "$APP".AppDir/.junest/"$l" 205 | done 206 | 207 | rsync -av archlinux/.junest/usr/bin_wrappers/ "$APP".AppDir/.junest/usr/bin_wrappers/ | echo "◆ Rsync bin_wrappers to the AppDir" 208 | rsync -av archlinux/.junest/etc/* "$APP".AppDir/.junest/etc/ | echo "◆ Rsync /etc" 209 | 210 | ############################################################################# 211 | # APPRUN 212 | ############################################################################# 213 | 214 | rm -f "$APP".AppDir/AppRun 215 | cat <<-'HEREDOC' >> "$APP".AppDir/AppRun 216 | #!/bin/sh 217 | HERE="$(dirname "$(readlink -f "$0")")" 218 | export UNION_PRELOAD="$HERE" 219 | export JUNEST_HOME="$HERE"/.junest 220 | 221 | if command -v unshare >/dev/null 2>&1 && ! unshare --user -p /bin/true >/dev/null 2>&1; then 222 | PROOT_ON=1 223 | export PATH="$HERE"/.local/share/junest/bin/:"$PATH" 224 | mkdir -p "$HOME"/.cache 225 | else 226 | export PATH="$PATH":"$HERE"/.local/share/junest/bin 227 | fi 228 | 229 | [ -z "$NVIDIA_ON" ] && NVIDIA_ON=0 230 | if [ "$NVIDIA_ON" = 1 ]; then 231 | DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}" 232 | CONTY_DIR="${DATADIR}/Conty/overlayfs_shared" 233 | [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)" 234 | if [ -n "$nvidia_driver_version" ]; then 235 | mkdir -p "${CONTY_DIR}"/nvidia "${CONTY_DIR}"/up/usr/lib "${CONTY_DIR}"/up/usr/share 236 | nvidia_data_dirs="egl glvnd nvidia vulkan" 237 | 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 238 | [ ! -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 239 | [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty=$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version) 240 | if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then 241 | rm -f "${CONTY_DIR}"/up/usr/lib/*; echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 242 | fi 243 | /sbin/ldconfig -p > "${CONTY_DIR}"/nvidia/host_libs 244 | grep -i "nvidia\|libcuda" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2 > "${CONTY_DIR}"/nvidia/host_nvidia_libs 245 | libnv_paths=$(grep "libnv" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2) 246 | for f in $libnv_paths; do strings "${f}" | grep -qi -m 1 "nvidia" && echo "${f}" >> "${CONTY_DIR}"/nvidia/host_nvidia_libs; done 247 | nvidia_libs=$(cat "${CONTY_DIR}"/nvidia/host_nvidia_libs) 248 | 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 249 | libvdpau_nvidia="${CONTY_DIR}/up/usr/lib/libvdpau_nvidia.so" 250 | 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 251 | [ -f "${libvdpau_nvidia}"."${nvidia_driver_version}" ] && [ ! -f "${libvdpau_nvidia}" ] && ln -s "${libvdpau_nvidia}"."${nvidia_driver_version}" "${libvdpau_nvidia}" 252 | [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}" 253 | [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}" 254 | fi 255 | fi 256 | 257 | PROOT_BINDINGS="" 258 | BWRAP_BINDINGS="" 259 | 260 | bind_files="/etc/resolv.conf /etc/hosts /etc/nsswitch.conf /etc/passwd /etc/group /etc/machine-id /etc/asound.conf /etc/localtime " 261 | for f in $bind_files; do [ -f "$f" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$f" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --ro-bind-try $f $f"; done 262 | 263 | bind_dirs=" /media /mnt /opt /run/media /usr/lib/locale /usr/share/fonts /usr/share/themes /var" 264 | for d in $bind_dirs; do [ -d "$d" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$d" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --bind-try $d $d"; done 265 | 266 | PROOT_BINDS=" --bind=/dev --bind=/sys --bind=/tmp --bind=/proc $PROOT_BINDINGS --bind=/home --bind=/home/$USER " 267 | BWRAP_BINDS=" --dev-bind /dev /dev --ro-bind /sys /sys --bind-try /tmp /tmp --proc /proc $BWRAP_BINDINGS " 268 | 269 | _JUNEST_CMD() { 270 | if [ "$PROOT_ON" = 1 ]; then 271 | "$HERE"/.local/share/junest/bin/junest proot -n -b "$PROOT_BINDS" "$@" 272 | else 273 | "$HERE"/.local/share/junest/bin/junest -n -b "$BWRAP_BINDS" "$@" 274 | fi 275 | } 276 | 277 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 278 | 279 | _JUNEST_CMD -- /usr/bin/$EXEC "$@" 280 | 281 | HEREDOC 282 | chmod a+x "$APP".AppDir/AppRun 283 | 284 | ############################################################################# 285 | # EXTRACT PACKAGES 286 | ############################################################################# 287 | 288 | [ -z "$extraction_count" ] && extraction_count=0 289 | [ ! -f ./autodeps ] && echo "$extraction_count" > ./autodeps 290 | [ -f ./autodeps ] && autodeps=$(cat ./autodeps) 291 | [ "$autodeps" != "$extraction_count" ] && rm -Rf ./deps ./packages && echo "$extraction_count" > ./autodeps 292 | 293 | [ ! -f ./userdeps ] && echo "$DEPENDENCES" > ./userdeps 294 | [ -f ./userdeps ] && userdeps=$(cat ./userdeps) 295 | [ "$userdeps" != "$DEPENDENCES" ] && rm -Rf ./deps ./packages && echo "$DEPENDENCES" > ./userdeps 296 | 297 | _extract_main_package() { 298 | mkdir -p base 299 | rm -Rf ./base/* 300 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 301 | if [ "$(echo "$pkg_full_path" | wc -l)" = 1 ]; then 302 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 303 | else 304 | for p in $pkg_full_path; do 305 | if tar fx "$p" .PKGINFO -O | grep -q "pkgname = $APP$"; then 306 | pkg_full_path="$p" 307 | fi 308 | done 309 | fi 310 | [ -z "$pkg_full_path" ] && echo "💀 ERROR: no package found for \"$APP\", operation aborted!" && exit 0 311 | tar fx "$pkg_full_path" -C ./base/ 312 | VERSION=$(cat ./base/.PKGINFO | grep pkgver | cut -c 10- | sed 's@.*:@@') 313 | mkdir -p deps 314 | } 315 | 316 | _download_missing_packages() { 317 | localpackage=$(find ./archlinux -name "$arg-[0-9]*zst") 318 | if ! test -f "$localpackage"; then 319 | ./archlinux/.local/share/junest/bin/junest -- yay --noconfirm -Sw "$arg" 320 | fi 321 | } 322 | 323 | _extract_package() { 324 | _download_missing_packages &> /dev/null 325 | pkg_full_path=$(find ./archlinux -name "$arg-[0-9]*zst") 326 | pkgname=$(echo "$pkg_full_path" | sed 's:.*/::') 327 | [ ! -f ./packages ] && rm -Rf ./deps/* && touch ./packages 328 | if [ -z "$( ls -A './deps' )" ]; then 329 | rm -f ./packages 330 | echo "" 331 | echo "-----------------------------------------------------------------------------" 332 | echo " EXTRACTING PACKAGES" 333 | echo "-----------------------------------------------------------------------------" 334 | echo "" 335 | fi 336 | if test -f "$pkg_full_path"; then 337 | if ! grep -q "$pkgname" ./packages 2>/dev/null;then 338 | echo "◆ Extracting $pkgname" 339 | tar fx "$pkg_full_path" -C ./deps/ --warning=no-unknown-keyword 340 | echo "$pkgname" >> ./packages 341 | fi 342 | [ -n "$lib_browser_launcher" ] && [[ "$arg" =~ (hicolor-icon-theme|xapp) ]] && tar fx "$pkg_full_path" -C ./base/ --warning=no-unknown-keyword --exclude='.PKGINFO' 343 | fi 344 | } 345 | 346 | _determine_packages_and_libraries() { 347 | if echo "$arg" | grep -q "\.so"; then 348 | LIBSAVED="$LIBSAVED $arg" 349 | 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 350 | _extract_package 351 | cat ./deps/.PKGINFO 2>/dev/null | grep "^depend = " | cut -c 10- | sed 's/=.*//' >> depdeps 352 | rm -f ./deps/.* 353 | fi 354 | } 355 | 356 | _extract_deps() { 357 | DEPS=$(sort -u ./depdeps) 358 | for arg in $DEPS; do 359 | _determine_packages_and_libraries 360 | done 361 | } 362 | 363 | _extract_all_dependences() { 364 | rm -f ./depdeps 365 | 366 | OPTDEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^optdepend = " | sed 's/optdepend = //g' | sed 's/=.*//' | sed 's/:.*//') 367 | for arg in $OPTDEPS; do 368 | _determine_packages_and_libraries 369 | done 370 | [ -f ./depdeps ] && _extract_deps 371 | rm -f ./depdeps 372 | 373 | ARGS=$(echo "$DEPENDENCES" | tr " " "\n") 374 | for arg in $ARGS; do 375 | _determine_packages_and_libraries 376 | done 377 | 378 | DEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^depend = " | sed 's/depend = //g' | sed 's/=.*//') 379 | for arg in $DEPS; do 380 | _determine_packages_and_libraries 381 | done 382 | 383 | # Set the level of sub-dependencies extraction, the higher the number, the bigger the AppImage will be 384 | if [ "$extraction_count" != 0 ]; then 385 | for e in $(seq "$extraction_count"); do _extract_deps; done 386 | fi 387 | } 388 | 389 | _extract_main_package 390 | _extract_all_dependences 391 | 392 | echo "" 393 | echo "-----------------------------------------------------------------------------" 394 | echo " IMPLEMENTING NECESSARY LIBRARIES (MAY TAKE SEVERAL MINUTES)" 395 | echo "-----------------------------------------------------------------------------" 396 | echo "" 397 | 398 | # Save files in /usr/bin 399 | _savebins() { 400 | echo "◆ Saving files in /usr/bin" 401 | cp -r ./archlinux/.junest/usr/bin/bwrap ./"$APP".AppDir/.junest/usr/bin/ 402 | cp -r ./archlinux/.junest/usr/bin/proot* ./"$APP".AppDir/.junest/usr/bin/ 403 | cp -r ./archlinux/.junest/usr/bin/*$BIN* ./"$APP".AppDir/.junest/usr/bin/ 404 | 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" 405 | utils_bin="awk bash $coreutils gawk gio grep ld ldd sed sh strings xdg-open" 406 | for b in $utils_bin; do 407 | cp -r ./archlinux/.junest/usr/bin/"$b" ./"$APP".AppDir/.junest/usr/bin/ 408 | done 409 | for arg in $BINSAVED; do 410 | cp -r ./archlinux/.junest/usr/bin/*"$arg"* ./"$APP".AppDir/.junest/usr/bin/ 411 | done 412 | } 413 | 414 | # Save files in /usr/lib 415 | _savelibs() { 416 | echo "◆ Detect libraries related to /usr/bin files" 417 | libs4bin=$(readelf -d ./"$APP".AppDir/.junest/usr/bin/* 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so") 418 | 419 | echo "◆ Saving JuNest core libraries" 420 | cp -r ./archlinux/.junest/usr/lib/ld-linux-x86-64.so* ./"$APP".AppDir/.junest/usr/lib/ 421 | lib_preset="$APP $BIN gconv libdw libelf libresolv.so libtinfo.so $libs4bin" 422 | LIBSAVED="$lib_preset $LIBSAVED $SHARESAVED" 423 | for arg in $LIBSAVED; do 424 | LIBPATHS="$LIBPATHS $(find ./archlinux/.junest/usr/lib -maxdepth 20 -wholename "*$arg*" | sed 's/\.\/archlinux\///g')" 425 | done 426 | for arg in $LIBPATHS; do 427 | [ ! -d "$APP".AppDir/"$arg" ] && cp -r ./archlinux/"$arg" "$APP".AppDir/"$arg" & 428 | done 429 | wait 430 | core_libs=$(find ./"$APP".AppDir -type f) 431 | lib_core=$(for c in $core_libs; do readelf -d "$c" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 432 | 433 | echo "◆ Detect libraries of the main package" 434 | base_libs=$(find ./base -type f | uniq) 435 | lib_base_0=$(for b in $base_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 436 | 437 | echo "◆ Detect libraries of the dependencies" 438 | dep_libs=$(find ./deps -executable -name "*.so*") 439 | lib_deps=$(for d in $dep_libs; do readelf -d "$d" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 440 | 441 | echo "◆ Detect and copy base libs" 442 | basebin_libs=$(find ./base -executable -name "*.so*") 443 | lib_base_1=$(for b in $basebin_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 444 | lib_base_1=$(echo "$lib_base_1" | tr ' ' '\n' | sort -u | xargs) 445 | 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) 446 | lib_base_2=$(echo "$lib_base_2" | tr ' ' '\n' | sort -u | xargs) 447 | 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) 448 | lib_base_3=$(echo "$lib_base_3" | tr ' ' '\n' | sort -u | xargs) 449 | 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) 450 | lib_base_4=$(echo "$lib_base_4" | tr ' ' '\n' | sort -u | xargs) 451 | 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) 452 | lib_base_5=$(echo "$lib_base_5" | tr ' ' '\n' | sort -u | xargs) 453 | 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) 454 | lib_base_6=$(echo "$lib_base_6" | tr ' ' '\n' | sort -u | xargs) 455 | 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) 456 | lib_base_7=$(echo "$lib_base_7" | tr ' ' '\n' | sort -u | xargs) 457 | 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) 458 | lib_base_8=$(echo "$lib_base_8" | tr ' ' '\n' | sort -u | xargs) 459 | 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) 460 | lib_base_9=$(echo "$lib_base_9" | tr ' ' '\n' | sort -u | xargs) 461 | 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" 462 | lib_base_libs=$(echo "$lib_base_libs" | tr ' ' '\n' | sort -u | sed 's/.so.*/.so/' | xargs) 463 | for l in $lib_base_libs; do 464 | rsync -av ./archlinux/.junest/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 465 | done 466 | wait 467 | for l in $lib_base_libs; do 468 | rsync -av ./deps/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 469 | done 470 | wait 471 | } 472 | 473 | # Save files in /usr/share 474 | _saveshare() { 475 | echo "◆ Saving directories in /usr/share" 476 | SHARESAVED="$SHARESAVED $APP $BIN fontconfig glib- locale mime wayland X11" 477 | for arg in $SHARESAVED; do 478 | cp -r ./archlinux/.junest/usr/share/*"$arg"* ./"$APP".AppDir/.junest/usr/share/ 479 | done 480 | } 481 | 482 | _savebins 2>/dev/null 483 | _savelibs 2>/dev/null 484 | _saveshare 2>/dev/null 485 | 486 | echo "" 487 | echo "-----------------------------------------------------------------------------" 488 | echo " ASSEMBLING THE APPIMAGE" 489 | echo "-----------------------------------------------------------------------------" 490 | echo "" 491 | 492 | _rsync_main_package() { 493 | rm -Rf ./base/.* 494 | rsync -av ./base/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync the content of the \"$APP\" package" 495 | } 496 | 497 | _rsync_dependences() { 498 | rm -Rf ./deps/.* 499 | chmod -R 777 ./deps/* 500 | rsync -av ./deps/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync all dependencies, please wait" 501 | } 502 | 503 | _rsync_main_package 504 | _rsync_dependences 505 | 506 | ############################################################################# 507 | # REMOVE BLOATWARES, ENABLE MOUNTPOINTS 508 | ############################################################################# 509 | 510 | _remove_more_bloatwares() { 511 | etc_remove="makepkg.conf pacman" 512 | for r in $etc_remove; do 513 | rm -Rf ./"$APP".AppDir/.junest/etc/"$r"* 514 | done 515 | bin_remove="gcc" 516 | for r in $bin_remove; do 517 | rm -Rf ./"$APP".AppDir/.junest/usr/bin/"$r"* 518 | done 519 | lib_remove="gcc gconv libgphobos" 520 | for r in $lib_remove; do 521 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/"$r"* 522 | done 523 | share_remove="gcc gir i18n terminfo z" 524 | for r in $share_remove; do 525 | rm -Rf ./"$APP".AppDir/.junest/usr/share/"$r"* 526 | done 527 | echo Y | rm -Rf ./"$APP".AppDir/.cache/yay/* 528 | 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 529 | find ./"$APP".AppDir/.junest/usr/share/locale/*/*/* -not -iname "*$BIN*" -a -not -name "." -delete 2> /dev/null #REMOVE ALL ADDITIONAL LOCALE FILES 530 | rm -Rf ./"$APP".AppDir/.junest/home # remove the inbuilt home 531 | rm -Rf ./"$APP".AppDir/.junest/usr/include # files related to the compiler 532 | rm -Rf ./"$APP".AppDir/.junest/usr/share/man # AppImages are not ment to have man command 533 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/python*/__pycache__/* # if python is installed, removing this directory can save several megabytes 534 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgallium* 535 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgo.so* 536 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/libLLVM* # included in the compilation phase, can sometimes be excluded for daily use 537 | rm -Rf ./"$APP".AppDir/.junest/var/* # remove all packages downloaded with the package manager 538 | } 539 | 540 | _enable_mountpoints_for_the_inbuilt_bubblewrap() { 541 | mkdir -p ./"$APP".AppDir/.junest/home 542 | mkdir -p ./"$APP".AppDir/.junest/media 543 | mkdir -p ./"$APP".AppDir/.junest/usr/lib/locale 544 | mkdir -p ./"$APP".AppDir/.junest/usr/share/fonts 545 | mkdir -p ./"$APP".AppDir/.junest/usr/share/themes 546 | mkdir -p ./"$APP".AppDir/.junest/run/media 547 | mkdir -p ./"$APP".AppDir/.junest/run/user 548 | rm -f ./"$APP".AppDir/.junest/etc/localtime && touch ./"$APP".AppDir/.junest/etc/localtime 549 | [ ! -f ./"$APP".AppDir/.junest/etc/asound.conf ] && touch ./"$APP".AppDir/.junest/etc/asound.conf 550 | } 551 | 552 | _remove_more_bloatwares 553 | find ./"$APP".AppDir/.junest/usr/lib ./"$APP".AppDir/.junest/usr/lib32 -type f -regex '.*\.a' -exec rm -f {} \; 2>/dev/null 554 | find ./"$APP".AppDir/.junest/usr -type f -regex '.*\.so.*' -exec strip --strip-debug {} \; 555 | find ./"$APP".AppDir/.junest/usr/bin -type f ! -regex '.*\.so.*' -exec strip --strip-unneeded {} \; 556 | find ./"$APP".AppDir/.junest/usr -type d -empty -delete 557 | _enable_mountpoints_for_the_inbuilt_bubblewrap 558 | 559 | ############################################################################# 560 | # CREATE THE APPIMAGE 561 | ############################################################################# 562 | 563 | if test -f ./*.AppImage; then rm -Rf ./*archimage*.AppImage; fi 564 | 565 | APPNAME=$(cat ./"$APP".AppDir/*.desktop | grep 'Name=' | head -1 | cut -c 6- | sed 's/ /-/g') 566 | REPO="Database-of-pkg2appimaged-packages" 567 | TAG="asunder" 568 | VERSION="$VERSION" 569 | UPINFO="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|$REPO|$TAG|*x86_64.AppImage.zsync" 570 | 571 | ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ 572 | -u "$UPINFO" \ 573 | ./"$APP".AppDir "$APPNAME"_"$VERSION"-archimage4.3-x86_64.AppImage 574 | -------------------------------------------------------------------------------- /baobab3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | APP=baobab 4 | 5 | # CREATE A TEMPORARY DIRECTORY 6 | mkdir -p tmp 7 | cd tmp 8 | 9 | # DOWNLOADING THE DEPENDENCIES 10 | if test -f ./appimagetool; then 11 | echo " appimagetool already exists" 1> /dev/null 12 | else 13 | echo " Downloading appimagetool..." 14 | wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool 15 | fi 16 | if test -f ./pkg2appimage; then 17 | echo " pkg2appimage already exists" 1> /dev/null 18 | else 19 | echo " Downloading pkg2appimage..." 20 | wget -q "$(curl -Ls https://api.github.com/repos/AppImageCommunity/pkg2appimage/releases/latest | sed 's/[()",{} ]/\n/g' | grep -io "http.*x86_64.*appimage$" | head -1)" -O pkg2appimage 21 | fi 22 | chmod a+x ./appimagetool ./pkg2appimage 23 | rm -f ./recipe.yml 24 | 25 | # CREATING THE HEAD OF THE RECIPE 26 | echo "app: baobab 27 | binpatch: true 28 | 29 | ingredients: 30 | 31 | dist: oldoldstable 32 | sources: 33 | - deb http://ftp.debian.org/debian/ oldstable main contrib non-free 34 | - deb http://security.debian.org/debian-security/ oldstable-security main contrib non-free 35 | - deb http://ftp.debian.org/debian/ oldstable-updates main contrib non-free 36 | packages: 37 | - baobab" >> recipe.yml 38 | 39 | 40 | # DOWNLOAD ALL THE NEEDED PACKAGES AND COMPILE THE APPDIR 41 | ./pkg2appimage ./recipe.yml 42 | 43 | # COMPILE SCHEMAS 44 | glib-compile-schemas ./$APP/$APP.AppDir/usr/share/glib-2.0/schemas/ || echo "No ./usr/share/glib-2.0/schemas/" 45 | 46 | # CUSTOMIZE THE APPRUN 47 | rm -R -f ./$APP/$APP.AppDir/AppRun 48 | cat >> ./$APP/$APP.AppDir/AppRun << 'EOF' 49 | #!/bin/sh 50 | HERE="$(dirname "$(readlink -f "${0}")")" 51 | export UNION_PRELOAD=/:"${HERE}" 52 | export LD_LIBRARY_PATH=/lib/:/lib64/:/lib/x86_64-linux-gnu/:/usr/lib/:"${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${LD_LIBRARY_PATH}" 53 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}" 54 | export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${HERE}"/usr/lib/python*/:"${PYTHONPATH}" 55 | export PYTHONHOME="${HERE}"/usr/:"${HERE}"/usr/lib/python*/ 56 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 57 | export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}" 58 | export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}" 59 | export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}" 60 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 61 | exec ${EXEC} "$@" 62 | EOF 63 | 64 | # MADE THE APPRUN EXECUTABLE 65 | chmod a+x ./$APP/$APP.AppDir/AppRun 66 | # END OF THE PART RELATED TO THE APPRUN, NOW WE WELL SEE IF EVERYTHING WORKS ---------------------------------------------------------------------- 67 | 68 | # IMPORT THE LAUNCHER AND THE ICON TO THE APPDIR IF THEY NOT EXIST 69 | if test -f ./$APP/$APP.AppDir/*.desktop; then 70 | echo "The desktop file exists" 71 | else 72 | echo "Trying to get the .desktop file" 73 | cp ./$APP/$APP.AppDir/usr/share/applications/*$(ls . | grep -i $APP | cut -c -4)*desktop ./$APP/$APP.AppDir/ 2>/dev/null 74 | fi 75 | 76 | ICONNAME=$(cat ./$APP/$APP.AppDir/*desktop | grep "Icon=" | head -1 | cut -c 6-) 77 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/22x22/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 78 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/24x24/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 79 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/32x32/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 80 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/48x48/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 81 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/64x64/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 82 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/128x128/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 83 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/256x256/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 84 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/512x512/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 85 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/scalable/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 86 | cp ./$APP/$APP.AppDir/usr/share/applications/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 87 | 88 | # UNCOMMENT THE FOLLOWING LINE TO REMOVE FILES IN "METAINFO" IN CASE OF ERRORS WITH "APPSTREAM" 89 | rm -R -f ./$APP/$APP.AppDir/usr/share/metainfo/* 90 | 91 | # EXPORT THE APP TO AN APPIMAGE 92 | ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 ./$APP/$APP.AppDir 93 | cd .. 94 | mv ./tmp/*.AppImage . 95 | chmod a+x *.AppImage 96 | -------------------------------------------------------------------------------- /billard-gl: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u 4 | APP=billard-gl 5 | 6 | # CREATE A TEMPORARY DIRECTORY 7 | mkdir -p tmp && cd tmp || exit 1 8 | 9 | # DOWNLOADING THE DEPENDENCIES 10 | if test -f ./appimagetool; then 11 | echo " appimagetool already exists" 1> /dev/null 12 | else 13 | echo " Downloading appimagetool..." 14 | wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool 15 | fi 16 | if test -f ./pkg2appimage; then 17 | echo " pkg2appimage already exists" 1> /dev/null 18 | else 19 | echo " Downloading pkg2appimage..." 20 | wget -q "$(curl -Ls https://api.github.com/repos/AppImageCommunity/pkg2appimage/releases/latest | sed 's/[()",{} ]/\n/g' | grep -io "http.*x86_64.*appimage$" | head -1)" -O pkg2appimage 21 | fi 22 | chmod a+x ./appimagetool ./pkg2appimage 23 | rm -f ./recipe.yml 24 | 25 | # CREATING THE HEAD OF THE RECIPE 26 | echo "app: $APP 27 | binpatch: true 28 | 29 | ingredients: 30 | 31 | dist: oldstable 32 | #script: 33 | #- COMMAND 34 | sources: 35 | - deb http://ftp.debian.org/debian/ oldstable main contrib non-free 36 | - deb http://security.debian.org/debian-security/ oldstable-security main contrib non-free 37 | - deb http://ftp.debian.org/debian/ oldstable-updates main contrib non-free 38 | packages: 39 | - $APP" > recipe.yml 40 | 41 | 42 | # DOWNLOAD ALL THE NEEDED PACKAGES AND COMPILE THE APPDIR 43 | ./pkg2appimage ./recipe.yml 44 | 45 | # VERSION 46 | MAIN_DEB=$(find . -type f -name "$APP\_*.deb" | head -1 | sed 's:.*/::') 47 | if test -f ./"$APP"/"$MAIN_DEB"; then 48 | ar x ./"$APP"/"$MAIN_DEB" && tar xf ./control.tar.* && rm -f ./control.tar.* ./data.tar.* || exit 1 49 | VERSION=$(grep Version 0/dev/null 67 | fi 68 | 69 | cp ./"$APP"/"$APP".AppDir/usr/share/pixmaps/* ./"$APP"/"$APP".AppDir/ 70 | 71 | # EXPORT THE APP TO AN APPIMAGE 72 | printf '#!/bin/sh\nexit 0' > ./desktop-file-validate # hack due to https://github.com/AppImage/appimagetool/pull/47 73 | chmod a+x ./desktop-file-validate 74 | PATH="$PATH:$PWD" ARCH=x86_64 ./appimagetool -n ./"$APP"/"$APP".AppDir 75 | if ! test -f ./*.AppImage; then 76 | echo "No AppImage available."; exit 1 77 | fi 78 | cd .. && mv ./tmp/*.AppImage ./Billard-GL-"$VERSION"-x86_64.AppImage && chmod a+x ./*.AppImage || exit 1 79 | -------------------------------------------------------------------------------- /capbattleship: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | APP=capbattleship 4 | 5 | mkdir tmp; 6 | cd tmp; 7 | 8 | # DOWNLOADING THE DEPENDENCIES 9 | wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool 10 | wget -q "$(curl -Ls https://api.github.com/repos/AppImageCommunity/pkg2appimage/releases/latest | sed 's/[()",{} ]/\n/g' | grep -io "http.*x86_64.*appimage$" | head -1)" -O pkg2appimage 11 | chmod a+x ./appimagetool ./pkg2appimage 12 | 13 | # CREATING THE APPIMAGE: APPDIR FROM A RECIPE... 14 | echo "app: capbattleship 15 | binpatch: true 16 | 17 | ingredients: 18 | dist: stable 19 | sources: 20 | - deb http://ftp.debian.org/debian/ stable main contrib non-free 21 | script: 22 | - wget https://chezlefab.net/share/3f6c697fa65faf0baece/capbattleship_last_all.deb 23 | packages: 24 | - capbattleship" >> recipe.yml; 25 | 26 | 27 | 28 | ./pkg2appimage ./recipe.yml; 29 | 30 | # ...DOWNLOADING LIBUNIONPRELOAD... 31 | wget https://github.com/project-portable/libunionpreload/releases/download/amd64/libunionpreload.so 32 | chmod a+x libunionpreload.so 33 | mv ./libunionpreload.so ./$APP/$APP.AppDir/ 34 | 35 | # ...REPLACING THE EXISTING APPRUN WITH A CUSTOM ONE... 36 | rm -R -f ./$APP/$APP.AppDir/AppRun 37 | function1="'^Exec=.*'" 38 | function2="'s|%.||g'" 39 | echo '#!/bin/sh 40 | HERE="$(dirname "$(readlink -f "${0}")")" 41 | export UNION_PRELOAD="${HERE}" 42 | export LD_PRELOAD="${HERE}/libunionpreload.so" 43 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/opt/'$APP'/:"${HERE}"/sbin/:"${PATH}" 44 | export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/'$APP'/:"${HERE}"/usr/lib64/'$APP'/:"${HERE}"/usr/lib32/'$APP'/:"${HERE}"/usr/lib/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}" 45 | export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${HERE}"/usr/lib/python*/:"${PYTHONPATH}" 46 | export PYTHONHOME="${HERE}"/usr/:"${HERE}"/usr/lib/python*/ 47 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${HERE}"/usr/share/'$APP'/:"${XDG_DATA_DIRS}" 48 | export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}" 49 | export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}" 50 | export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/'$APP'/:"${HERE}"/usr/lib64/'$APP'/:"${HERE}"/usr/lib32/'$APP'/:"${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}" 51 | EXEC=$(grep -e '$function1' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e '$function2') 52 | exec ${EXEC} "$@"' >> AppRun 53 | chmod a+x AppRun 54 | 55 | mv ./AppRun ./$APP/$APP.AppDir 56 | 57 | # ...IMPORT THE LAUNCHER AND THE ICON TO THE APPDIR (uncomment if not available)... 58 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/22x22/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 59 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/24x24/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 60 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/32x32/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 61 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/48x48/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 62 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/64x64/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 63 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/128x128/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 64 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/256x256/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 65 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/512x512/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 66 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/scalable/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 67 | #cp ./$APP/$APP.AppDir/usr/share/applications/* ./$APP/$APP.AppDir/ 2>/dev/null 68 | # ...EXPORT THE APPDIR TO AN APPIMAGE! 69 | ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 ./$APP/$APP.AppDir; 70 | 71 | 72 | cd ..; 73 | mv ./tmp/*.AppImage ./; 74 | chmod a+x ./$APP 75 | 76 | rm -R -f ./tmp 77 | -------------------------------------------------------------------------------- /chromium-bsu-junest.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | APP=chromium-bsu 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="alsa-lib libpulse pipewire" #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="alsa" 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="libjxl_cms libbrotlienc.so libyuv.so libsharpyuv.so libdav librav libSvtAv libaom.so libSDL \ 18 | libogg.so libvorbis libFLAC.so libopus.so libmpg libmp3lame.so $lib_audio_keywords $lib_browser_launcher" 19 | 20 | [ -n "$lib_browser_launcher" ] && DEPENDENCES="$DEPENDENCES xapp hicolor-icon-theme" 21 | 22 | ############################################################################# 23 | # SETUP THE ENVIRONMENT 24 | ############################################################################# 25 | 26 | # Download appimagetool 27 | if [ ! -f ./appimagetool ]; then 28 | echo "-----------------------------------------------------------------------------" 29 | echo "◆ Downloading \"appimagetool\" from https://github.com/AppImage/appimagetool" 30 | echo "-----------------------------------------------------------------------------" 31 | curl -#Lo appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage && chmod a+x appimagetool 32 | fi 33 | 34 | # Create and enter the AppDir 35 | mkdir -p "$APP".AppDir archlinux && cd archlinux || exit 1 36 | 37 | # Set archlinux as a temporary $HOME directory 38 | HOME="$(dirname "$(readlink -f "$0")")" 39 | 40 | ############################################################################# 41 | # DOWNLOAD, INSTALL AND CONFIGURE JUNEST 42 | ############################################################################# 43 | 44 | _enable_multilib() { 45 | printf "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> ./.junest/etc/pacman.conf 46 | } 47 | 48 | _enable_chaoticaur() { 49 | # This function is ment to be used during the installation of JuNest, see "_pacman_patches" 50 | ./.local/share/junest/bin/junest -- sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com 51 | ./.local/share/junest/bin/junest -- sudo pacman-key --lsign-key 3056513887B78AEB 52 | ./.local/share/junest/bin/junest -- sudo pacman-key --populate chaotic 53 | ./.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' 54 | printf "\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist" >> ./.junest/etc/pacman.conf 55 | } 56 | 57 | _enable_archlinuxcn() { 58 | ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -U "https://repo.archlinuxcn.org/x86_64/$(curl -Ls https://repo.archlinuxcn.org/x86_64/ | tr '"' '\n' | grep "^archlinuxcn-keyring.*zst$" | tail -1)" 59 | printf "\n[archlinuxcn]\n#SigLevel = Never\nServer = http://repo.archlinuxcn.org/\$arch" >> ./.junest/etc/pacman.conf 60 | } 61 | 62 | _custom_mirrorlist() { 63 | COUNTRY=$(curl -i ipinfo.io 2>/dev/null | grep country | cut -c 15- | cut -c -2) 64 | if [ -n "$GITHUB_REPOSITORY_OWNER" ] || ! curl --output /dev/null --silent --head --fail "https://archlinux.org/mirrorlist/?country=$COUNTRY" 1>/dev/null; then 65 | curl -Ls https://archlinux.org/mirrorlist/all | awk NR==2 RS= | sed 's/#Server/Server/g' > ./.junest/etc/pacman.d/mirrorlist 66 | else 67 | curl -Ls "https://archlinux.org/mirrorlist/?country=$COUNTRY" | sed 's/#Server/Server/g' > ./.junest/etc/pacman.d/mirrorlist 68 | fi 69 | } 70 | 71 | _bypass_signature_check_level() { 72 | sed -i 's/#SigLevel/SigLevel/g; s/Required DatabaseOptional/Never/g' ./.junest/etc/pacman.conf 73 | } 74 | 75 | _install_junest() { 76 | echo "-----------------------------------------------------------------------------" 77 | echo "◆ Clone JuNest from https://github.com/fsquillace/junest" 78 | echo "-----------------------------------------------------------------------------" 79 | git clone https://github.com/fsquillace/junest.git ./.local/share/junest 80 | echo "-----------------------------------------------------------------------------" 81 | echo "◆ Downloading JuNest archive from https://github.com/ivan-hc/junest" 82 | echo "-----------------------------------------------------------------------------" 83 | curl -#Lo junest-x86_64.tar.gz https://github.com/ivan-hc/junest/releases/download/continuous/junest-x86_64.tar.gz 84 | ./.local/share/junest/bin/junest setup -i junest-x86_64.tar.gz 85 | rm -f junest-x86_64.tar.gz 86 | echo " Apply patches to PacMan..." 87 | #_enable_multilib 88 | #_enable_chaoticaur 89 | #_enable_archlinuxcn 90 | _custom_mirrorlist 91 | _bypass_signature_check_level 92 | 93 | # Update arch linux in junest 94 | ./.local/share/junest/bin/junest -- sudo pacman -Syy 95 | ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -Syu 96 | } 97 | 98 | if ! test -d "$HOME/.local/share/junest"; then 99 | echo "-----------------------------------------------------------------------------" 100 | echo " DOWNLOAD, INSTALL AND CONFIGURE JUNEST" 101 | echo "-----------------------------------------------------------------------------" 102 | _install_junest 103 | else 104 | echo "-----------------------------------------------------------------------------" 105 | echo " RESTART JUNEST" 106 | echo "-----------------------------------------------------------------------------" 107 | fi 108 | 109 | ############################################################################# 110 | # INSTALL PROGRAMS USING YAY 111 | ############################################################################# 112 | 113 | ./.local/share/junest/bin/junest -- yay -Syy 114 | #./.local/share/junest/bin/junest -- gpg --keyserver keyserver.ubuntu.com --recv-key C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF # UNCOMMENT IF YOU USE THE AUR 115 | if [ -n "$BASICSTUFF" ]; then 116 | ./.local/share/junest/bin/junest -- yay --noconfirm -S $BASICSTUFF 117 | fi 118 | if [ -n "$COMPILERS" ]; then 119 | ./.local/share/junest/bin/junest -- yay --noconfirm -S $COMPILERS 120 | fi 121 | if [ -n "$DEPENDENCES" ]; then 122 | ./.local/share/junest/bin/junest -- yay --noconfirm -S $DEPENDENCES 123 | fi 124 | if [ -n "$APP" ]; then 125 | ./.local/share/junest/bin/junest -- yay --noconfirm -S alsa-lib gtk3 xapp 126 | ./.local/share/junest/bin/junest -- yay --noconfirm -S "$APP" 127 | ./.local/share/junest/bin/junest -- glib-compile-schemas /usr/share/glib-2.0/schemas/ 128 | else 129 | echo "No app found, exiting"; exit 1 130 | fi 131 | 132 | cd .. 133 | 134 | echo "" 135 | echo "-----------------------------------------------------------------------------" 136 | echo " CREATING THE APPDIR" 137 | echo "-----------------------------------------------------------------------------" 138 | echo "" 139 | 140 | # Set locale 141 | rm -f archlinux/.junest/etc/locale.conf 142 | sed -i 's/LANG=${LANG:-C}/LANG=$LANG/g' archlinux/.junest/etc/profile.d/locale.sh 143 | 144 | # Add launcher and icon 145 | rm -f ./*.desktop 146 | LAUNCHER=$(grep -iRl "$BIN" archlinux/.junest/usr/share/applications/* | grep ".desktop" | head -1) 147 | cp -r "$LAUNCHER" "$APP".AppDir/ 148 | ICON=$(cat "$LAUNCHER" | grep "Icon=" | cut -c 6-) 149 | [ -z "$ICON" ] && ICON="$BIN" 150 | cp -r archlinux/.junest/usr/share/icons/*"$ICON"* "$APP".AppDir/ 2>/dev/null 151 | cp -r archlinux/.junest/usr/share/icons/hicolor/22x22/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 152 | cp -r archlinux/.junest/usr/share/icons/hicolor/24x24/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 153 | cp -r archlinux/.junest/usr/share/icons/hicolor/32x32/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 154 | cp -r archlinux/.junest/usr/share/icons/hicolor/48x48/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 155 | cp -r archlinux/.junest/usr/share/icons/hicolor/64x64/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 156 | cp -r archlinux/.junest/usr/share/icons/hicolor/128x128/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 157 | cp -r archlinux/.junest/usr/share/icons/hicolor/192x192/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 158 | cp -r archlinux/.junest/usr/share/icons/hicolor/256x256/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 159 | cp -r archlinux/.junest/usr/share/icons/hicolor/512x512/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 160 | cp -r archlinux/.junest/usr/share/icons/hicolor/scalable/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 161 | cp -r archlinux/.junest/usr/share/pixmaps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 162 | 163 | # Test if the desktop file and the icon are in the root of the future appimage (./*appdir/*) 164 | if test -f "$APP".AppDir/*.desktop; then 165 | echo "◆ The .desktop file is available in $APP.AppDir/" 166 | elif test -f archlinux/.junest/usr/bin/"$BIN"; then 167 | echo "◆ No .desktop file available for $APP, creating a new one" 168 | cat <<-HEREDOC >> "$APP".AppDir/"$APP".desktop 169 | [Desktop Entry] 170 | Version=1.0 171 | Type=Application 172 | Name=$(echo "$APP" | tr '[:lower:]' '[:upper:]') 173 | Comment= 174 | Exec=$BIN 175 | Icon=tux 176 | Categories=Utility; 177 | Terminal=true 178 | StartupNotify=true 179 | HEREDOC 180 | curl -Lo "$APP".AppDir/tux.png https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/favicon.ico 2>/dev/null 181 | else 182 | echo "No binary in path... aborting all the processes." 183 | exit 0 184 | fi 185 | 186 | if [ ! -d "$APP".AppDir/.local ]; then 187 | mkdir -p "$APP".AppDir/.local 188 | rsync -av archlinux/.local/ "$APP".AppDir/.local/ | echo "◆ Rsync .local directory to the AppDir" 189 | # Made JuNest a portable app and remove "read-only file system" errors 190 | sed -i 's#${JUNEST_HOME}/usr/bin/junest_wrapper#${HOME}/.cache/junest_wrapper.old#g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 191 | 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 192 | sed -i 's/ln/#ln/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 193 | sed -i 's/rm -f "$file"/test -f "$file"/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 194 | 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 195 | fi 196 | 197 | echo "◆ Rsync .junest directories structure to the AppDir" 198 | rm -Rf "$APP".AppDir/.junest/* 199 | archdirs=$(find archlinux/.junest -type d | sed 's/^archlinux\///g') 200 | for d in $archdirs; do 201 | mkdir -p "$APP".AppDir/"$d" 202 | done 203 | symlink_dirs=" bin sbin lib lib64 usr/sbin usr/lib64" 204 | for l in $symlink_dirs; do 205 | cp -r archlinux/.junest/"$l" "$APP".AppDir/.junest/"$l" 206 | done 207 | 208 | rsync -av archlinux/.junest/usr/bin_wrappers/ "$APP".AppDir/.junest/usr/bin_wrappers/ | echo "◆ Rsync bin_wrappers to the AppDir" 209 | rsync -av archlinux/.junest/etc/* "$APP".AppDir/.junest/etc/ | echo "◆ Rsync /etc" 210 | 211 | ############################################################################# 212 | # APPRUN 213 | ############################################################################# 214 | 215 | rm -f "$APP".AppDir/AppRun 216 | cat <<-'HEREDOC' >> "$APP".AppDir/AppRun 217 | #!/bin/sh 218 | HERE="$(dirname "$(readlink -f "$0")")" 219 | export UNION_PRELOAD="$HERE" 220 | export JUNEST_HOME="$HERE"/.junest 221 | 222 | if command -v unshare >/dev/null 2>&1 && ! unshare --user -p /bin/true >/dev/null 2>&1; then 223 | PROOT_ON=1 224 | export PATH="$HERE"/.local/share/junest/bin/:"$PATH" 225 | mkdir -p "$HOME"/.cache 226 | else 227 | export PATH="$PATH":"$HERE"/.local/share/junest/bin 228 | fi 229 | 230 | [ -z "$NVIDIA_ON" ] && NVIDIA_ON=1 231 | if [ "$NVIDIA_ON" = 1 ]; then 232 | DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}" 233 | CONTY_DIR="${DATADIR}/Conty/overlayfs_shared" 234 | [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)" 235 | if [ -n "$nvidia_driver_version" ]; then 236 | mkdir -p "${CONTY_DIR}"/nvidia "${CONTY_DIR}"/up/usr/lib "${CONTY_DIR}"/up/usr/share 237 | nvidia_data_dirs="egl glvnd nvidia vulkan" 238 | 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 239 | [ ! -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 240 | [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty=$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version) 241 | if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then 242 | rm -f "${CONTY_DIR}"/up/usr/lib/*; echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 243 | fi 244 | /sbin/ldconfig -p > "${CONTY_DIR}"/nvidia/host_libs 245 | grep -i "nvidia\|libcuda" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2 > "${CONTY_DIR}"/nvidia/host_nvidia_libs 246 | libnv_paths=$(grep "libnv" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2) 247 | for f in $libnv_paths; do strings "${f}" | grep -qi -m 1 "nvidia" && echo "${f}" >> "${CONTY_DIR}"/nvidia/host_nvidia_libs; done 248 | nvidia_libs=$(cat "${CONTY_DIR}"/nvidia/host_nvidia_libs) 249 | 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 250 | libvdpau_nvidia="${CONTY_DIR}/up/usr/lib/libvdpau_nvidia.so" 251 | 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 252 | [ -f "${libvdpau_nvidia}"."${nvidia_driver_version}" ] && [ ! -f "${libvdpau_nvidia}" ] && ln -s "${libvdpau_nvidia}"."${nvidia_driver_version}" "${libvdpau_nvidia}" 253 | [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}" 254 | [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}" 255 | fi 256 | fi 257 | 258 | PROOT_BINDINGS="" 259 | BWRAP_BINDINGS="" 260 | 261 | bind_files="/etc/resolv.conf /etc/hosts /etc/nsswitch.conf /etc/passwd /etc/group /etc/machine-id /etc/asound.conf /etc/localtime " 262 | for f in $bind_files; do [ -f "$f" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$f" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --ro-bind-try $f $f"; done 263 | 264 | bind_dirs=" /media /mnt /opt /run/media /usr/lib/locale /usr/share/fonts /usr/share/themes /var" 265 | for d in $bind_dirs; do [ -d "$d" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$d" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --bind-try $d $d"; done 266 | 267 | PROOT_BINDS=" --bind=/dev --bind=/sys --bind=/tmp --bind=/proc $PROOT_BINDINGS --bind=/home --bind=/home/$USER " 268 | BWRAP_BINDS=" --dev-bind /dev /dev --ro-bind /sys /sys --bind-try /tmp /tmp --proc /proc $BWRAP_BINDINGS " 269 | 270 | _JUNEST_CMD() { 271 | if [ "$PROOT_ON" = 1 ]; then 272 | "$HERE"/.local/share/junest/bin/junest proot -n -b "$PROOT_BINDS" "$@" 273 | else 274 | "$HERE"/.local/share/junest/bin/junest -n -b "$BWRAP_BINDS" "$@" 275 | fi 276 | } 277 | 278 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 279 | 280 | _JUNEST_CMD -- /usr/bin/$EXEC "$@" 281 | 282 | HEREDOC 283 | chmod a+x "$APP".AppDir/AppRun 284 | 285 | ############################################################################# 286 | # EXTRACT PACKAGES 287 | ############################################################################# 288 | 289 | [ -z "$extraction_count" ] && extraction_count=0 290 | [ ! -f ./autodeps ] && echo "$extraction_count" > ./autodeps 291 | [ -f ./autodeps ] && autodeps=$(cat ./autodeps) 292 | [ "$autodeps" != "$extraction_count" ] && rm -Rf ./deps ./packages && echo "$extraction_count" > ./autodeps 293 | 294 | [ ! -f ./userdeps ] && echo "$DEPENDENCES" > ./userdeps 295 | [ -f ./userdeps ] && userdeps=$(cat ./userdeps) 296 | [ "$userdeps" != "$DEPENDENCES" ] && rm -Rf ./deps ./packages && echo "$DEPENDENCES" > ./userdeps 297 | 298 | _extract_main_package() { 299 | mkdir -p base 300 | rm -Rf ./base/* 301 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 302 | if [ "$(echo "$pkg_full_path" | wc -l)" = 1 ]; then 303 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 304 | else 305 | for p in $pkg_full_path; do 306 | if tar fx "$p" .PKGINFO -O | grep -q "pkgname = $APP$"; then 307 | pkg_full_path="$p" 308 | fi 309 | done 310 | fi 311 | [ -z "$pkg_full_path" ] && echo "💀 ERROR: no package found for \"$APP\", operation aborted!" && exit 0 312 | tar fx "$pkg_full_path" -C ./base/ 313 | VERSION=$(cat ./base/.PKGINFO | grep pkgver | cut -c 10- | sed 's@.*:@@') 314 | mkdir -p deps 315 | } 316 | 317 | _download_missing_packages() { 318 | localpackage=$(find ./archlinux -name "$arg-[0-9]*zst") 319 | if ! test -f "$localpackage"; then 320 | ./archlinux/.local/share/junest/bin/junest -- yay --noconfirm -Sw "$arg" 321 | fi 322 | } 323 | 324 | _extract_package() { 325 | _download_missing_packages &> /dev/null 326 | pkg_full_path=$(find ./archlinux -name "$arg-[0-9]*zst") 327 | pkgname=$(echo "$pkg_full_path" | sed 's:.*/::') 328 | [ ! -f ./packages ] && rm -Rf ./deps/* && touch ./packages 329 | if [ -z "$( ls -A './deps' )" ]; then 330 | rm -f ./packages 331 | echo "" 332 | echo "-----------------------------------------------------------------------------" 333 | echo " EXTRACTING PACKAGES" 334 | echo "-----------------------------------------------------------------------------" 335 | echo "" 336 | fi 337 | if test -f "$pkg_full_path"; then 338 | if ! grep -q "$pkgname" ./packages 2>/dev/null;then 339 | echo "◆ Extracting $pkgname" 340 | tar fx "$pkg_full_path" -C ./deps/ --warning=no-unknown-keyword 341 | echo "$pkgname" >> ./packages 342 | fi 343 | [ -n "$lib_browser_launcher" ] && [[ "$arg" =~ (hicolor-icon-theme|xapp) ]] && tar fx "$pkg_full_path" -C ./base/ --warning=no-unknown-keyword --exclude='.PKGINFO' 344 | fi 345 | } 346 | 347 | _determine_packages_and_libraries() { 348 | if echo "$arg" | grep -q "\.so"; then 349 | LIBSAVED="$LIBSAVED $arg" 350 | 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 351 | _extract_package 352 | cat ./deps/.PKGINFO 2>/dev/null | grep "^depend = " | cut -c 10- | sed 's/=.*//' >> depdeps 353 | rm -f ./deps/.* 354 | fi 355 | } 356 | 357 | _extract_deps() { 358 | DEPS=$(sort -u ./depdeps) 359 | for arg in $DEPS; do 360 | _determine_packages_and_libraries 361 | done 362 | } 363 | 364 | _extract_all_dependences() { 365 | rm -f ./depdeps 366 | 367 | OPTDEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^optdepend = " | sed 's/optdepend = //g' | sed 's/=.*//' | sed 's/:.*//') 368 | for arg in $OPTDEPS; do 369 | _determine_packages_and_libraries 370 | done 371 | [ -f ./depdeps ] && _extract_deps 372 | rm -f ./depdeps 373 | 374 | ARGS=$(echo "$DEPENDENCES" | tr " " "\n") 375 | for arg in $ARGS; do 376 | _determine_packages_and_libraries 377 | done 378 | 379 | DEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^depend = " | sed 's/depend = //g' | sed 's/=.*//') 380 | for arg in $DEPS; do 381 | _determine_packages_and_libraries 382 | done 383 | 384 | # Set the level of sub-dependencies extraction, the higher the number, the bigger the AppImage will be 385 | if [ "$extraction_count" != 0 ]; then 386 | for e in $(seq "$extraction_count"); do _extract_deps; done 387 | fi 388 | } 389 | 390 | _extract_main_package 391 | _extract_all_dependences 392 | 393 | echo "" 394 | echo "-----------------------------------------------------------------------------" 395 | echo " IMPLEMENTING NECESSARY LIBRARIES (MAY TAKE SEVERAL MINUTES)" 396 | echo "-----------------------------------------------------------------------------" 397 | echo "" 398 | 399 | # Save files in /usr/bin 400 | _savebins() { 401 | echo "◆ Saving files in /usr/bin" 402 | cp -r ./archlinux/.junest/usr/bin/bwrap ./"$APP".AppDir/.junest/usr/bin/ 403 | cp -r ./archlinux/.junest/usr/bin/proot* ./"$APP".AppDir/.junest/usr/bin/ 404 | cp -r ./archlinux/.junest/usr/bin/*$BIN* ./"$APP".AppDir/.junest/usr/bin/ 405 | 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" 406 | utils_bin="awk bash $coreutils gawk gio grep ld ldd sed sh strings xdg-open" 407 | for b in $utils_bin; do 408 | cp -r ./archlinux/.junest/usr/bin/"$b" ./"$APP".AppDir/.junest/usr/bin/ 409 | done 410 | for arg in $BINSAVED; do 411 | cp -r ./archlinux/.junest/usr/bin/*"$arg"* ./"$APP".AppDir/.junest/usr/bin/ 412 | done 413 | } 414 | 415 | # Save files in /usr/lib 416 | _savelibs() { 417 | echo "◆ Detect libraries related to /usr/bin files" 418 | libs4bin=$(readelf -d ./"$APP".AppDir/.junest/usr/bin/* 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so") 419 | 420 | echo "◆ Saving JuNest core libraries" 421 | cp -r ./archlinux/.junest/usr/lib/ld-linux-x86-64.so* ./"$APP".AppDir/.junest/usr/lib/ 422 | lib_preset="$APP $BIN gconv libdw libelf libresolv.so libtinfo.so $libs4bin" 423 | LIBSAVED="$lib_preset $LIBSAVED $SHARESAVED" 424 | for arg in $LIBSAVED; do 425 | LIBPATHS="$LIBPATHS $(find ./archlinux/.junest/usr/lib -maxdepth 20 -wholename "*$arg*" | sed 's/\.\/archlinux\///g')" 426 | done 427 | for arg in $LIBPATHS; do 428 | [ ! -d "$APP".AppDir/"$arg" ] && cp -r ./archlinux/"$arg" "$APP".AppDir/"$arg" & 429 | done 430 | wait 431 | core_libs=$(find ./"$APP".AppDir -type f) 432 | lib_core=$(for c in $core_libs; do readelf -d "$c" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 433 | 434 | echo "◆ Detect libraries of the main package" 435 | base_libs=$(find ./base -type f | uniq) 436 | lib_base_0=$(for b in $base_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 437 | 438 | echo "◆ Detect libraries of the dependencies" 439 | dep_libs=$(find ./deps -executable -name "*.so*") 440 | lib_deps=$(for d in $dep_libs; do readelf -d "$d" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 441 | 442 | echo "◆ Detect and copy base libs" 443 | basebin_libs=$(find ./base -executable -name "*.so*") 444 | lib_base_1=$(for b in $basebin_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 445 | lib_base_1=$(echo "$lib_base_1" | tr ' ' '\n' | sort -u | xargs) 446 | 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) 447 | lib_base_2=$(echo "$lib_base_2" | tr ' ' '\n' | sort -u | xargs) 448 | 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) 449 | lib_base_3=$(echo "$lib_base_3" | tr ' ' '\n' | sort -u | xargs) 450 | 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) 451 | lib_base_4=$(echo "$lib_base_4" | tr ' ' '\n' | sort -u | xargs) 452 | 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) 453 | lib_base_5=$(echo "$lib_base_5" | tr ' ' '\n' | sort -u | xargs) 454 | 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) 455 | lib_base_6=$(echo "$lib_base_6" | tr ' ' '\n' | sort -u | xargs) 456 | 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) 457 | lib_base_7=$(echo "$lib_base_7" | tr ' ' '\n' | sort -u | xargs) 458 | 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) 459 | lib_base_8=$(echo "$lib_base_8" | tr ' ' '\n' | sort -u | xargs) 460 | 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) 461 | lib_base_9=$(echo "$lib_base_9" | tr ' ' '\n' | sort -u | xargs) 462 | 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" 463 | lib_base_libs=$(echo "$lib_base_libs" | tr ' ' '\n' | sort -u | sed 's/.so.*/.so/' | xargs) 464 | for l in $lib_base_libs; do 465 | rsync -av ./archlinux/.junest/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 466 | done 467 | wait 468 | for l in $lib_base_libs; do 469 | rsync -av ./deps/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 470 | done 471 | wait 472 | } 473 | 474 | # Save files in /usr/share 475 | _saveshare() { 476 | echo "◆ Saving directories in /usr/share" 477 | SHARESAVED="$SHARESAVED $APP $BIN fontconfig glib- locale mime wayland X11" 478 | for arg in $SHARESAVED; do 479 | cp -r ./archlinux/.junest/usr/share/*"$arg"* ./"$APP".AppDir/.junest/usr/share/ 480 | done 481 | } 482 | 483 | _savebins 2>/dev/null 484 | _savelibs 2>/dev/null 485 | _saveshare 2>/dev/null 486 | 487 | echo "" 488 | echo "-----------------------------------------------------------------------------" 489 | echo " ASSEMBLING THE APPIMAGE" 490 | echo "-----------------------------------------------------------------------------" 491 | echo "" 492 | 493 | _rsync_main_package() { 494 | rm -Rf ./base/.* 495 | rsync -av ./base/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync the content of the \"$APP\" package" 496 | } 497 | 498 | _rsync_dependences() { 499 | rm -Rf ./deps/.* 500 | chmod -R 777 ./deps/* 501 | rsync -av ./deps/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync all dependencies, please wait" 502 | } 503 | 504 | _rsync_main_package 505 | _rsync_dependences 506 | 507 | ############################################################################# 508 | # REMOVE BLOATWARES, ENABLE MOUNTPOINTS 509 | ############################################################################# 510 | 511 | _remove_more_bloatwares() { 512 | etc_remove="makepkg.conf pacman" 513 | for r in $etc_remove; do 514 | rm -Rf ./"$APP".AppDir/.junest/etc/"$r"* 515 | done 516 | bin_remove="gcc" 517 | for r in $bin_remove; do 518 | rm -Rf ./"$APP".AppDir/.junest/usr/bin/"$r"* 519 | done 520 | lib_remove="gcc" 521 | for r in $lib_remove; do 522 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/"$r"* 523 | done 524 | share_remove="gcc" 525 | for r in $share_remove; do 526 | rm -Rf ./"$APP".AppDir/.junest/usr/share/"$r"* 527 | done 528 | echo Y | rm -Rf ./"$APP".AppDir/.cache/yay/* 529 | 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 530 | find ./"$APP".AppDir/.junest/usr/share/locale/*/*/* -not -iname "*$BIN*" -a -not -name "." -delete 2> /dev/null #REMOVE ALL ADDITIONAL LOCALE FILES 531 | rm -Rf ./"$APP".AppDir/.junest/home # remove the inbuilt home 532 | rm -Rf ./"$APP".AppDir/.junest/usr/include # files related to the compiler 533 | rm -Rf ./"$APP".AppDir/.junest/usr/share/man # AppImages are not ment to have man command 534 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/python*/__pycache__/* # if python is installed, removing this directory can save several megabytes 535 | #rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgallium* 536 | #rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgo.so* 537 | #rm -Rf ./"$APP".AppDir/.junest/usr/lib/libLLVM* # included in the compilation phase, can sometimes be excluded for daily use 538 | rm -Rf ./"$APP".AppDir/.junest/var/* # remove all packages downloaded with the package manager 539 | } 540 | 541 | _enable_mountpoints_for_the_inbuilt_bubblewrap() { 542 | mkdir -p ./"$APP".AppDir/.junest/home 543 | mkdir -p ./"$APP".AppDir/.junest/media 544 | mkdir -p ./"$APP".AppDir/.junest/usr/lib/locale 545 | mkdir -p ./"$APP".AppDir/.junest/usr/share/fonts 546 | mkdir -p ./"$APP".AppDir/.junest/usr/share/themes 547 | mkdir -p ./"$APP".AppDir/.junest/run/media 548 | mkdir -p ./"$APP".AppDir/.junest/run/user 549 | rm -f ./"$APP".AppDir/.junest/etc/localtime && touch ./"$APP".AppDir/.junest/etc/localtime 550 | [ ! -f ./"$APP".AppDir/.junest/etc/asound.conf ] && touch ./"$APP".AppDir/.junest/etc/asound.conf 551 | } 552 | 553 | _remove_more_bloatwares 554 | find ./"$APP".AppDir/.junest/usr/lib ./"$APP".AppDir/.junest/usr/lib32 -type f -regex '.*\.a' -exec rm -f {} \; 2>/dev/null 555 | find ./"$APP".AppDir/.junest/usr -type f -regex '.*\.so.*' -exec strip --strip-debug {} \; 556 | find ./"$APP".AppDir/.junest/usr/bin -type f ! -regex '.*\.so.*' -exec strip --strip-unneeded {} \; 557 | find ./"$APP".AppDir/.junest/usr -type d -empty -delete 558 | _enable_mountpoints_for_the_inbuilt_bubblewrap 559 | 560 | ############################################################################# 561 | # CREATE THE APPIMAGE 562 | ############################################################################# 563 | 564 | if test -f ./*.AppImage; then rm -Rf ./*archimage*.AppImage; fi 565 | 566 | APPNAME=$(cat ./"$APP".AppDir/*.desktop | grep 'Name=' | head -1 | cut -c 6- | sed 's/ /-/g') 567 | REPO="Database-of-pkg2appimaged-packages" 568 | TAG="chromium-bsu" 569 | VERSION="$VERSION" 570 | UPINFO="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|$REPO|$TAG|*x86_64.AppImage.zsync" 571 | 572 | ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ 573 | -u "$UPINFO" \ 574 | ./"$APP".AppDir "$APPNAME"_"$VERSION"-archimage4.3-x86_64.AppImage 575 | -------------------------------------------------------------------------------- /extremetuxracer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u 4 | APP=extremetuxracer 5 | 6 | # CREATE A TEMPORARY DIRECTORY 7 | mkdir -p tmp && cd tmp || exit 1 8 | 9 | # DOWNLOADING THE DEPENDENCIES 10 | if test -f ./appimagetool; then 11 | echo " appimagetool already exists" 1> /dev/null 12 | else 13 | echo " Downloading appimagetool..." 14 | wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool 15 | fi 16 | if test -f ./pkg2appimage; then 17 | echo " pkg2appimage already exists" 1> /dev/null 18 | else 19 | echo " Downloading pkg2appimage..." 20 | wget -q "$(curl -Ls https://api.github.com/repos/AppImageCommunity/pkg2appimage/releases/latest | sed 's/[()",{} ]/\n/g' | grep -io "http.*x86_64.*appimage$" | head -1)" -O pkg2appimage 21 | fi 22 | chmod a+x ./appimagetool ./pkg2appimage 23 | rm -f ./recipe.yml 24 | 25 | # CREATING THE HEAD OF THE RECIPE 26 | echo "app: $APP 27 | binpatch: true 28 | 29 | ingredients: 30 | 31 | dist: stable 32 | #script: 33 | #- COMMAND 34 | sources: 35 | - deb http://ftp.debian.org/debian/ stable main contrib non-free 36 | - deb http://security.debian.org/debian-security/ stable-security main contrib non-free 37 | - deb http://ftp.debian.org/debian/ stable-updates main contrib non-free 38 | packages: 39 | - $APP" > recipe.yml 40 | 41 | 42 | # DOWNLOAD ALL THE NEEDED PACKAGES AND COMPILE THE APPDIR 43 | ./pkg2appimage ./recipe.yml 44 | 45 | # VERSION 46 | MAIN_DEB=$(find . -type f -name "$APP\_*.deb" | head -1 | sed 's:.*/::') 47 | if test -f ./"$APP"/"$MAIN_DEB"; then 48 | ar x ./"$APP"/"$MAIN_DEB" && tar xf ./control.tar.* && rm -f ./control.tar.* ./data.tar.* || exit 1 49 | VERSION=$(grep Version 0/dev/null 67 | fi 68 | 69 | ICONNAME=$(cat ./"$APP"/"$APP".AppDir/*desktop | grep "Icon=" | head -1 | cut -c 6-) 70 | cp ./"$APP"/"$APP".AppDir/usr/share/icons/hicolor/22x22/apps/*"$ICONNAME"* ./"$APP"/"$APP".AppDir/ 2>/dev/null 71 | cp ./"$APP"/"$APP".AppDir/usr/share/icons/hicolor/24x24/apps/*"$ICONNAME"* ./"$APP"/"$APP".AppDir/ 2>/dev/null 72 | cp ./"$APP"/"$APP".AppDir/usr/share/icons/hicolor/32x32/apps/*"$ICONNAME"* ./"$APP"/"$APP".AppDir/ 2>/dev/null 73 | cp ./"$APP"/"$APP".AppDir/usr/share/icons/hicolor/48x48/apps/*"$ICONNAME"* ./"$APP"/"$APP".AppDir/ 2>/dev/null 74 | cp ./"$APP"/"$APP".AppDir/usr/share/icons/hicolor/64x64/apps/*"$ICONNAME"* ./"$APP"/"$APP".AppDir/ 2>/dev/null 75 | cp ./"$APP"/"$APP".AppDir/usr/share/icons/hicolor/128x128/apps/*"$ICONNAME"* ./"$APP"/"$APP".AppDir/ 2>/dev/null 76 | cp ./"$APP"/"$APP".AppDir/usr/share/icons/hicolor/256x256/apps/*"$ICONNAME"* ./"$APP"/"$APP".AppDir/ 2>/dev/null 77 | cp ./"$APP"/"$APP".AppDir/usr/share/icons/hicolor/512x512/apps/*"$ICONNAME"* ./"$APP"/"$APP".AppDir/ 2>/dev/null 78 | cp ./"$APP"/"$APP".AppDir/usr/share/icons/hicolor/scalable/apps/*"$ICONNAME"* ./"$APP"/"$APP".AppDir/ 2>/dev/null 79 | cp ./"$APP"/"$APP".AppDir/usr/share/applications/*"$ICONNAME"* ./"$APP"/"$APP".AppDir/ 2>/dev/null 80 | 81 | # EXPORT THE APP TO AN APPIMAGE 82 | printf '#!/bin/sh\nexit 0' > ./desktop-file-validate # hack due to https://github.com/AppImage/appimagetool/pull/47 83 | chmod a+x ./desktop-file-validate 84 | PATH="$PATH:$PWD" ARCH=x86_64 ./appimagetool -n ./"$APP"/"$APP".AppDir 85 | if ! test -f ./*.AppImage; then 86 | echo "No AppImage available."; exit 1 87 | fi 88 | cd .. && mv ./tmp/*.AppImage ./Extreme_Tux_Racer-"$VERSION"-x86_64.AppImage && chmod a+x ./*.AppImage || exit 1 89 | -------------------------------------------------------------------------------- /gnome-system-monitor3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | APP=gnome-system-monitor 4 | 5 | # CREATE A TEMPORARY DIRECTORY 6 | mkdir -p tmp 7 | cd tmp 8 | 9 | # DOWNLOADING THE DEPENDENCIES 10 | if test -f ./appimagetool; then 11 | echo " appimagetool already exists" 1> /dev/null 12 | else 13 | echo " Downloading appimagetool..." 14 | wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool 15 | fi 16 | if test -f ./pkg2appimage; then 17 | echo " pkg2appimage already exists" 1> /dev/null 18 | else 19 | echo " Downloading pkg2appimage..." 20 | wget -q "$(curl -Ls https://api.github.com/repos/AppImageCommunity/pkg2appimage/releases/latest | sed 's/[()",{} ]/\n/g' | grep -io "http.*x86_64.*appimage$" | head -1)" -O pkg2appimage 21 | fi 22 | chmod a+x ./appimagetool ./pkg2appimage 23 | rm -f ./recipe.yml 24 | 25 | # CREATING THE HEAD OF THE RECIPE 26 | echo "app: $APP 27 | binpatch: true 28 | 29 | ingredients: 30 | 31 | dist: oldstable 32 | sources: 33 | - deb http://ftp.debian.org/debian/ oldstable main contrib non-free 34 | - deb http://security.debian.org/debian-security/ oldstable-security main contrib non-free 35 | - deb http://ftp.debian.org/debian/ oldstable-updates main contrib non-free 36 | packages: 37 | - $APP" >> recipe.yml 38 | 39 | 40 | # DOWNLOAD ALL THE NEEDED PACKAGES AND COMPILE THE APPDIR 41 | ./pkg2appimage ./recipe.yml 42 | 43 | # LIBUNIONPRELOAD 44 | wget https://github.com/project-portable/libunionpreload/releases/download/amd64/libunionpreload.so 45 | chmod a+x libunionpreload.so 46 | mv ./libunionpreload.so ./$APP/$APP.AppDir/ 47 | 48 | # COMPILE SCHEMAS 49 | glib-compile-schemas ./$APP/$APP.AppDir/usr/share/glib-2.0/schemas/ || echo "No ./usr/share/glib-2.0/schemas/" 50 | 51 | # CUSTOMIZE THE APPRUN 52 | rm -R -f ./$APP/$APP.AppDir/AppRun 53 | cat >> ./$APP/$APP.AppDir/AppRun << 'EOF' 54 | #!/bin/sh 55 | HERE="$(dirname "$(readlink -f "${0}")")" 56 | export UNION_PRELOAD="${HERE}" 57 | export LD_PRELOAD="${HERE}"/libunionpreload.so 58 | export LD_LIBRARY_PATH=/lib/:/lib64/:/lib/x86_64-linux-gnu/:/usr/lib/:"${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${LD_LIBRARY_PATH}" 59 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}" 60 | export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${HERE}"/usr/lib/python*/:"${PYTHONPATH}" 61 | export PYTHONHOME="${HERE}"/usr/:"${HERE}"/usr/lib/python*/ 62 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 63 | export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}" 64 | export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}" 65 | export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}" 66 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 67 | exec ${EXEC} "$@" 68 | EOF 69 | 70 | # MADE THE APPRUN EXECUTABLE 71 | chmod a+x ./$APP/$APP.AppDir/AppRun 72 | # END OF THE PART RELATED TO THE APPRUN, NOW WE WELL SEE IF EVERYTHING WORKS ---------------------------------------------------------------------- 73 | 74 | # IMPORT THE LAUNCHER AND THE ICON TO THE APPDIR IF THEY NOT EXIST 75 | if test -f ./$APP/$APP.AppDir/*.desktop; then 76 | echo "The desktop file exists" 77 | else 78 | echo "Trying to get the .desktop file" 79 | cp ./$APP/$APP.AppDir/usr/share/applications/*$(ls . | grep -i $APP | cut -c -4)*desktop ./$APP/$APP.AppDir/ 2>/dev/null 80 | fi 81 | 82 | ICONNAME=$(cat ./$APP/$APP.AppDir/*desktop | grep "Icon=" | head -1 | cut -c 6-) 83 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/22x22/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 84 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/24x24/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 85 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/32x32/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 86 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/48x48/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 87 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/64x64/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 88 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/128x128/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 89 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/256x256/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 90 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/512x512/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 91 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/scalable/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 92 | cp ./$APP/$APP.AppDir/usr/share/applications/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 93 | 94 | # UNCOMMENT THE FOLLOWING LINE TO REMOVE FILES IN "METAINFO" IN CASE OF ERRORS WITH "APPSTREAM" 95 | rm -R -f ./$APP/$APP.AppDir/usr/share/metainfo/* 96 | 97 | # EXPORT THE APP TO AN APPIMAGE 98 | ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 ./$APP/$APP.AppDir 99 | cd .. 100 | mv ./tmp/*.AppImage . 101 | chmod a+x *.AppImage 102 | -------------------------------------------------------------------------------- /kwave-junest.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | APP=kwave 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="" #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="libproxy libnghttp libidn libssh libpsl.so libunistring.so libxcb libuuid libGLX \ 18 | libogg.so libvorbis libFLAC.so libopus.so libmpg libmp3lame.so libLLVM $lib_audio_keywords $lib_browser_launcher" 19 | 20 | [ -n "$lib_browser_launcher" ] && DEPENDENCES="$DEPENDENCES xapp hicolor-icon-theme" 21 | 22 | ############################################################################# 23 | # SETUP THE ENVIRONMENT 24 | ############################################################################# 25 | 26 | # Download appimagetool 27 | if [ ! -f ./appimagetool ]; then 28 | echo "-----------------------------------------------------------------------------" 29 | echo "◆ Downloading \"appimagetool\" from https://github.com/AppImage/appimagetool" 30 | echo "-----------------------------------------------------------------------------" 31 | curl -#Lo appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage && chmod a+x appimagetool 32 | fi 33 | 34 | # Create and enter the AppDir 35 | mkdir -p "$APP".AppDir archlinux && cd archlinux || exit 1 36 | 37 | # Set archlinux as a temporary $HOME directory 38 | HOME="$(dirname "$(readlink -f "$0")")" 39 | 40 | ############################################################################# 41 | # DOWNLOAD, INSTALL AND CONFIGURE JUNEST 42 | ############################################################################# 43 | 44 | _enable_multilib() { 45 | printf "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> ./.junest/etc/pacman.conf 46 | } 47 | 48 | _enable_chaoticaur() { 49 | # This function is ment to be used during the installation of JuNest, see "_pacman_patches" 50 | ./.local/share/junest/bin/junest -- sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com 51 | ./.local/share/junest/bin/junest -- sudo pacman-key --lsign-key 3056513887B78AEB 52 | ./.local/share/junest/bin/junest -- sudo pacman-key --populate chaotic 53 | ./.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' 54 | printf "\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist" >> ./.junest/etc/pacman.conf 55 | } 56 | 57 | _enable_archlinuxcn() { 58 | ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -U "https://repo.archlinuxcn.org/x86_64/$(curl -Ls https://repo.archlinuxcn.org/x86_64/ | tr '"' '\n' | grep "^archlinuxcn-keyring.*zst$" | tail -1)" 59 | printf "\n[archlinuxcn]\n#SigLevel = Never\nServer = http://repo.archlinuxcn.org/\$arch" >> ./.junest/etc/pacman.conf 60 | } 61 | 62 | _custom_mirrorlist() { 63 | COUNTRY=$(curl -i ipinfo.io 2>/dev/null | grep country | cut -c 15- | cut -c -2) 64 | if [ -n "$GITHUB_REPOSITORY_OWNER" ] || ! curl --output /dev/null --silent --head --fail "https://archlinux.org/mirrorlist/?country=$COUNTRY" 1>/dev/null; then 65 | curl -Ls https://archlinux.org/mirrorlist/all | awk NR==2 RS= | sed 's/#Server/Server/g' > ./.junest/etc/pacman.d/mirrorlist 66 | else 67 | curl -Ls "https://archlinux.org/mirrorlist/?country=$COUNTRY" | sed 's/#Server/Server/g' > ./.junest/etc/pacman.d/mirrorlist 68 | fi 69 | } 70 | 71 | _bypass_signature_check_level() { 72 | sed -i 's/#SigLevel/SigLevel/g; s/Required DatabaseOptional/Never/g' ./.junest/etc/pacman.conf 73 | } 74 | 75 | _install_junest() { 76 | echo "-----------------------------------------------------------------------------" 77 | echo "◆ Clone JuNest from https://github.com/fsquillace/junest" 78 | echo "-----------------------------------------------------------------------------" 79 | git clone https://github.com/fsquillace/junest.git ./.local/share/junest 80 | echo "-----------------------------------------------------------------------------" 81 | echo "◆ Downloading JuNest archive from https://github.com/ivan-hc/junest" 82 | echo "-----------------------------------------------------------------------------" 83 | curl -#Lo junest-x86_64.tar.gz https://github.com/ivan-hc/junest/releases/download/continuous/junest-x86_64.tar.gz 84 | ./.local/share/junest/bin/junest setup -i junest-x86_64.tar.gz 85 | rm -f junest-x86_64.tar.gz 86 | echo " Apply patches to PacMan..." 87 | #_enable_multilib 88 | #_enable_chaoticaur 89 | #_enable_archlinuxcn 90 | _custom_mirrorlist 91 | _bypass_signature_check_level 92 | 93 | # Update arch linux in junest 94 | ./.local/share/junest/bin/junest -- sudo pacman -Syy 95 | ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -Syu 96 | } 97 | 98 | if ! test -d "$HOME/.local/share/junest"; then 99 | echo "-----------------------------------------------------------------------------" 100 | echo " DOWNLOAD, INSTALL AND CONFIGURE JUNEST" 101 | echo "-----------------------------------------------------------------------------" 102 | _install_junest 103 | else 104 | echo "-----------------------------------------------------------------------------" 105 | echo " RESTART JUNEST" 106 | echo "-----------------------------------------------------------------------------" 107 | fi 108 | 109 | ############################################################################# 110 | # INSTALL PROGRAMS USING YAY 111 | ############################################################################# 112 | 113 | ./.local/share/junest/bin/junest -- yay -Syy 114 | #./.local/share/junest/bin/junest -- gpg --keyserver keyserver.ubuntu.com --recv-key C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF # UNCOMMENT IF YOU USE THE AUR 115 | if [ -n "$BASICSTUFF" ]; then 116 | ./.local/share/junest/bin/junest -- yay --noconfirm -S $BASICSTUFF 117 | fi 118 | if [ -n "$COMPILERS" ]; then 119 | ./.local/share/junest/bin/junest -- yay --noconfirm -S $COMPILERS 120 | fi 121 | if [ -n "$DEPENDENCES" ]; then 122 | ./.local/share/junest/bin/junest -- yay --noconfirm -S $DEPENDENCES 123 | fi 124 | if [ -n "$APP" ]; then 125 | ./.local/share/junest/bin/junest -- yay --noconfirm -S alsa-lib gtk3 xapp 126 | ./.local/share/junest/bin/junest -- yay --noconfirm -S "$APP" 127 | ./.local/share/junest/bin/junest -- glib-compile-schemas /usr/share/glib-2.0/schemas/ 128 | else 129 | echo "No app found, exiting"; exit 1 130 | fi 131 | 132 | cd .. 133 | 134 | echo "" 135 | echo "-----------------------------------------------------------------------------" 136 | echo " CREATING THE APPDIR" 137 | echo "-----------------------------------------------------------------------------" 138 | echo "" 139 | 140 | # Set locale 141 | rm -f archlinux/.junest/etc/locale.conf 142 | sed -i 's/LANG=${LANG:-C}/LANG=$LANG/g' archlinux/.junest/etc/profile.d/locale.sh 143 | 144 | # Add launcher and icon 145 | rm -f ./*.desktop 146 | LAUNCHER=$(grep -iRl "$BIN" archlinux/.junest/usr/share/applications/* | grep ".desktop" | head -1) 147 | cp -r "$LAUNCHER" "$APP".AppDir/ 148 | ICON=$(cat "$LAUNCHER" | grep "Icon=" | cut -c 6-) 149 | [ -z "$ICON" ] && ICON="$BIN" 150 | cp -r archlinux/.junest/usr/share/icons/*"$ICON"* "$APP".AppDir/ 2>/dev/null 151 | cp -r archlinux/.junest/usr/share/icons/hicolor/22x22/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 152 | cp -r archlinux/.junest/usr/share/icons/hicolor/24x24/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 153 | cp -r archlinux/.junest/usr/share/icons/hicolor/32x32/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 154 | cp -r archlinux/.junest/usr/share/icons/hicolor/48x48/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 155 | cp -r archlinux/.junest/usr/share/icons/hicolor/64x64/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 156 | cp -r archlinux/.junest/usr/share/icons/hicolor/128x128/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 157 | cp -r archlinux/.junest/usr/share/icons/hicolor/192x192/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 158 | cp -r archlinux/.junest/usr/share/icons/hicolor/256x256/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 159 | cp -r archlinux/.junest/usr/share/icons/hicolor/512x512/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 160 | cp -r archlinux/.junest/usr/share/icons/hicolor/scalable/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 161 | cp -r archlinux/.junest/usr/share/pixmaps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 162 | mv "$APP".AppDir/*.svgz "$APP".AppDir/"$APP".svg 163 | 164 | # Test if the desktop file and the icon are in the root of the future appimage (./*appdir/*) 165 | if test -f "$APP".AppDir/*.desktop; then 166 | echo "◆ The .desktop file is available in $APP.AppDir/" 167 | elif test -f archlinux/.junest/usr/bin/"$BIN"; then 168 | echo "◆ No .desktop file available for $APP, creating a new one" 169 | cat <<-HEREDOC >> "$APP".AppDir/"$APP".desktop 170 | [Desktop Entry] 171 | Version=1.0 172 | Type=Application 173 | Name=$(echo "$APP" | tr '[:lower:]' '[:upper:]') 174 | Comment= 175 | Exec=$BIN 176 | Icon=tux 177 | Categories=Utility; 178 | Terminal=true 179 | StartupNotify=true 180 | HEREDOC 181 | curl -Lo "$APP".AppDir/tux.png https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/favicon.ico 2>/dev/null 182 | else 183 | echo "No binary in path... aborting all the processes." 184 | exit 0 185 | fi 186 | 187 | if [ ! -d "$APP".AppDir/.local ]; then 188 | mkdir -p "$APP".AppDir/.local 189 | rsync -av archlinux/.local/ "$APP".AppDir/.local/ | echo "◆ Rsync .local directory to the AppDir" 190 | # Made JuNest a portable app and remove "read-only file system" errors 191 | sed -i 's#${JUNEST_HOME}/usr/bin/junest_wrapper#${HOME}/.cache/junest_wrapper.old#g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 192 | 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 193 | sed -i 's/ln/#ln/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 194 | sed -i 's/rm -f "$file"/test -f "$file"/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 195 | 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 196 | fi 197 | 198 | echo "◆ Rsync .junest directories structure to the AppDir" 199 | rm -Rf "$APP".AppDir/.junest/* 200 | archdirs=$(find archlinux/.junest -type d | sed 's/^archlinux\///g') 201 | for d in $archdirs; do 202 | mkdir -p "$APP".AppDir/"$d" 203 | done 204 | symlink_dirs=" bin sbin lib lib64 usr/sbin usr/lib64" 205 | for l in $symlink_dirs; do 206 | cp -r archlinux/.junest/"$l" "$APP".AppDir/.junest/"$l" 207 | done 208 | 209 | rsync -av archlinux/.junest/usr/bin_wrappers/ "$APP".AppDir/.junest/usr/bin_wrappers/ | echo "◆ Rsync bin_wrappers to the AppDir" 210 | rsync -av archlinux/.junest/etc/* "$APP".AppDir/.junest/etc/ | echo "◆ Rsync /etc" 211 | 212 | ############################################################################# 213 | # APPRUN 214 | ############################################################################# 215 | 216 | rm -f "$APP".AppDir/AppRun 217 | cat <<-'HEREDOC' >> "$APP".AppDir/AppRun 218 | #!/bin/sh 219 | HERE="$(dirname "$(readlink -f "$0")")" 220 | export UNION_PRELOAD="$HERE" 221 | export JUNEST_HOME="$HERE"/.junest 222 | 223 | if command -v unshare >/dev/null 2>&1 && ! unshare --user -p /bin/true >/dev/null 2>&1; then 224 | PROOT_ON=1 225 | export PATH="$HERE"/.local/share/junest/bin/:"$PATH" 226 | mkdir -p "$HOME"/.cache 227 | else 228 | export PATH="$PATH":"$HERE"/.local/share/junest/bin 229 | fi 230 | 231 | [ -z "$NVIDIA_ON" ] && NVIDIA_ON=1 232 | if [ "$NVIDIA_ON" = 1 ]; then 233 | DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}" 234 | CONTY_DIR="${DATADIR}/Conty/overlayfs_shared" 235 | [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)" 236 | if [ -n "$nvidia_driver_version" ]; then 237 | mkdir -p "${CONTY_DIR}"/nvidia "${CONTY_DIR}"/up/usr/lib "${CONTY_DIR}"/up/usr/share 238 | nvidia_data_dirs="egl glvnd nvidia vulkan" 239 | 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 240 | [ ! -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 241 | [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty=$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version) 242 | if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then 243 | rm -f "${CONTY_DIR}"/up/usr/lib/*; echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 244 | fi 245 | /sbin/ldconfig -p > "${CONTY_DIR}"/nvidia/host_libs 246 | grep -i "nvidia\|libcuda" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2 > "${CONTY_DIR}"/nvidia/host_nvidia_libs 247 | libnv_paths=$(grep "libnv" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2) 248 | for f in $libnv_paths; do strings "${f}" | grep -qi -m 1 "nvidia" && echo "${f}" >> "${CONTY_DIR}"/nvidia/host_nvidia_libs; done 249 | nvidia_libs=$(cat "${CONTY_DIR}"/nvidia/host_nvidia_libs) 250 | 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 251 | libvdpau_nvidia="${CONTY_DIR}/up/usr/lib/libvdpau_nvidia.so" 252 | 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 253 | [ -f "${libvdpau_nvidia}"."${nvidia_driver_version}" ] && [ ! -f "${libvdpau_nvidia}" ] && ln -s "${libvdpau_nvidia}"."${nvidia_driver_version}" "${libvdpau_nvidia}" 254 | [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}" 255 | [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}" 256 | fi 257 | fi 258 | 259 | PROOT_BINDINGS="" 260 | BWRAP_BINDINGS="" 261 | 262 | bind_files="/etc/resolv.conf /etc/hosts /etc/nsswitch.conf /etc/passwd /etc/group /etc/machine-id /etc/asound.conf /etc/localtime " 263 | for f in $bind_files; do [ -f "$f" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$f" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --ro-bind-try $f $f"; done 264 | 265 | bind_dirs=" /media /mnt /opt /run/media /usr/lib/locale /usr/share/fonts /usr/share/themes /var" 266 | for d in $bind_dirs; do [ -d "$d" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$d" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --bind-try $d $d"; done 267 | 268 | PROOT_BINDS=" --bind=/dev --bind=/sys --bind=/tmp --bind=/proc $PROOT_BINDINGS --bind=/home --bind=/home/$USER " 269 | BWRAP_BINDS=" --dev-bind /dev /dev --ro-bind /sys /sys --bind-try /tmp /tmp --proc /proc $BWRAP_BINDINGS " 270 | 271 | _JUNEST_CMD() { 272 | if [ "$PROOT_ON" = 1 ]; then 273 | "$HERE"/.local/share/junest/bin/junest proot -n -b "$PROOT_BINDS" "$@" 274 | else 275 | "$HERE"/.local/share/junest/bin/junest -n -b "$BWRAP_BINDS" "$@" 276 | fi 277 | } 278 | 279 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 280 | 281 | _JUNEST_CMD -- /usr/bin/$EXEC "$@" 282 | 283 | HEREDOC 284 | chmod a+x "$APP".AppDir/AppRun 285 | 286 | ############################################################################# 287 | # EXTRACT PACKAGES 288 | ############################################################################# 289 | 290 | [ -z "$extraction_count" ] && extraction_count=0 291 | [ ! -f ./autodeps ] && echo "$extraction_count" > ./autodeps 292 | [ -f ./autodeps ] && autodeps=$(cat ./autodeps) 293 | [ "$autodeps" != "$extraction_count" ] && rm -Rf ./deps ./packages && echo "$extraction_count" > ./autodeps 294 | 295 | [ ! -f ./userdeps ] && echo "$DEPENDENCES" > ./userdeps 296 | [ -f ./userdeps ] && userdeps=$(cat ./userdeps) 297 | [ "$userdeps" != "$DEPENDENCES" ] && rm -Rf ./deps ./packages && echo "$DEPENDENCES" > ./userdeps 298 | 299 | _extract_main_package() { 300 | mkdir -p base 301 | rm -Rf ./base/* 302 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 303 | if [ "$(echo "$pkg_full_path" | wc -l)" = 1 ]; then 304 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 305 | else 306 | for p in $pkg_full_path; do 307 | if tar fx "$p" .PKGINFO -O | grep -q "pkgname = $APP$"; then 308 | pkg_full_path="$p" 309 | fi 310 | done 311 | fi 312 | [ -z "$pkg_full_path" ] && echo "💀 ERROR: no package found for \"$APP\", operation aborted!" && exit 0 313 | tar fx "$pkg_full_path" -C ./base/ 314 | VERSION=$(cat ./base/.PKGINFO | grep pkgver | cut -c 10- | sed 's@.*:@@') 315 | mkdir -p deps 316 | } 317 | 318 | _download_missing_packages() { 319 | localpackage=$(find ./archlinux -name "$arg-[0-9]*zst") 320 | if ! test -f "$localpackage"; then 321 | ./archlinux/.local/share/junest/bin/junest -- yay --noconfirm -Sw "$arg" 322 | fi 323 | } 324 | 325 | _extract_package() { 326 | _download_missing_packages &> /dev/null 327 | pkg_full_path=$(find ./archlinux -name "$arg-[0-9]*zst") 328 | pkgname=$(echo "$pkg_full_path" | sed 's:.*/::') 329 | [ ! -f ./packages ] && rm -Rf ./deps/* && touch ./packages 330 | if [ -z "$( ls -A './deps' )" ]; then 331 | rm -f ./packages 332 | echo "" 333 | echo "-----------------------------------------------------------------------------" 334 | echo " EXTRACTING PACKAGES" 335 | echo "-----------------------------------------------------------------------------" 336 | echo "" 337 | fi 338 | if test -f "$pkg_full_path"; then 339 | if ! grep -q "$pkgname" ./packages 2>/dev/null;then 340 | echo "◆ Extracting $pkgname" 341 | tar fx "$pkg_full_path" -C ./deps/ --warning=no-unknown-keyword 342 | echo "$pkgname" >> ./packages 343 | fi 344 | [ -n "$lib_browser_launcher" ] && [[ "$arg" =~ (hicolor-icon-theme|xapp) ]] && tar fx "$pkg_full_path" -C ./base/ --warning=no-unknown-keyword --exclude='.PKGINFO' 345 | fi 346 | } 347 | 348 | _determine_packages_and_libraries() { 349 | if echo "$arg" | grep -q "\.so"; then 350 | LIBSAVED="$LIBSAVED $arg" 351 | 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 352 | _extract_package 353 | cat ./deps/.PKGINFO 2>/dev/null | grep "^depend = " | cut -c 10- | sed 's/=.*//' >> depdeps 354 | rm -f ./deps/.* 355 | fi 356 | } 357 | 358 | _extract_deps() { 359 | DEPS=$(sort -u ./depdeps) 360 | for arg in $DEPS; do 361 | _determine_packages_and_libraries 362 | done 363 | } 364 | 365 | _extract_all_dependences() { 366 | rm -f ./depdeps 367 | 368 | OPTDEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^optdepend = " | sed 's/optdepend = //g' | sed 's/=.*//' | sed 's/:.*//') 369 | for arg in $OPTDEPS; do 370 | _determine_packages_and_libraries 371 | done 372 | [ -f ./depdeps ] && _extract_deps 373 | rm -f ./depdeps 374 | 375 | ARGS=$(echo "$DEPENDENCES" | tr " " "\n") 376 | for arg in $ARGS; do 377 | _determine_packages_and_libraries 378 | done 379 | 380 | DEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^depend = " | sed 's/depend = //g' | sed 's/=.*//') 381 | for arg in $DEPS; do 382 | _determine_packages_and_libraries 383 | done 384 | 385 | # Set the level of sub-dependencies extraction, the higher the number, the bigger the AppImage will be 386 | if [ "$extraction_count" != 0 ]; then 387 | for e in $(seq "$extraction_count"); do _extract_deps; done 388 | fi 389 | } 390 | 391 | _extract_main_package 392 | _extract_all_dependences 393 | 394 | echo "" 395 | echo "-----------------------------------------------------------------------------" 396 | echo " IMPLEMENTING NECESSARY LIBRARIES (MAY TAKE SEVERAL MINUTES)" 397 | echo "-----------------------------------------------------------------------------" 398 | echo "" 399 | 400 | # Save files in /usr/bin 401 | _savebins() { 402 | echo "◆ Saving files in /usr/bin" 403 | cp -r ./archlinux/.junest/usr/bin/bwrap ./"$APP".AppDir/.junest/usr/bin/ 404 | cp -r ./archlinux/.junest/usr/bin/proot* ./"$APP".AppDir/.junest/usr/bin/ 405 | cp -r ./archlinux/.junest/usr/bin/*$BIN* ./"$APP".AppDir/.junest/usr/bin/ 406 | 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" 407 | utils_bin="awk bash $coreutils gawk gio grep ld ldd sed sh strings xdg-open" 408 | for b in $utils_bin; do 409 | cp -r ./archlinux/.junest/usr/bin/"$b" ./"$APP".AppDir/.junest/usr/bin/ 410 | done 411 | for arg in $BINSAVED; do 412 | cp -r ./archlinux/.junest/usr/bin/*"$arg"* ./"$APP".AppDir/.junest/usr/bin/ 413 | done 414 | } 415 | 416 | # Save files in /usr/lib 417 | _savelibs() { 418 | echo "◆ Detect libraries related to /usr/bin files" 419 | libs4bin=$(readelf -d ./"$APP".AppDir/.junest/usr/bin/* 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so") 420 | 421 | echo "◆ Saving JuNest core libraries" 422 | cp -r ./archlinux/.junest/usr/lib/ld-linux-x86-64.so* ./"$APP".AppDir/.junest/usr/lib/ 423 | lib_preset="$APP $BIN gconv libdw libelf libresolv.so libtinfo.so $libs4bin" 424 | LIBSAVED="$lib_preset $LIBSAVED $SHARESAVED" 425 | for arg in $LIBSAVED; do 426 | LIBPATHS="$LIBPATHS $(find ./archlinux/.junest/usr/lib -maxdepth 20 -wholename "*$arg*" | sed 's/\.\/archlinux\///g')" 427 | done 428 | for arg in $LIBPATHS; do 429 | [ ! -d "$APP".AppDir/"$arg" ] && cp -r ./archlinux/"$arg" "$APP".AppDir/"$arg" & 430 | done 431 | wait 432 | core_libs=$(find ./"$APP".AppDir -type f) 433 | lib_core=$(for c in $core_libs; do readelf -d "$c" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 434 | 435 | echo "◆ Detect libraries of the main package" 436 | base_libs=$(find ./base -type f | uniq) 437 | lib_base_0=$(for b in $base_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 438 | 439 | echo "◆ Detect libraries of the dependencies" 440 | dep_libs=$(find ./deps -executable -name "*.so*") 441 | lib_deps=$(for d in $dep_libs; do readelf -d "$d" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 442 | 443 | echo "◆ Detect and copy base libs" 444 | basebin_libs=$(find ./base -executable -name "*.so*") 445 | lib_base_1=$(for b in $basebin_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 446 | lib_base_1=$(echo "$lib_base_1" | tr ' ' '\n' | sort -u | xargs) 447 | 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) 448 | lib_base_2=$(echo "$lib_base_2" | tr ' ' '\n' | sort -u | xargs) 449 | 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) 450 | lib_base_3=$(echo "$lib_base_3" | tr ' ' '\n' | sort -u | xargs) 451 | 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) 452 | lib_base_4=$(echo "$lib_base_4" | tr ' ' '\n' | sort -u | xargs) 453 | 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) 454 | lib_base_5=$(echo "$lib_base_5" | tr ' ' '\n' | sort -u | xargs) 455 | 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) 456 | lib_base_6=$(echo "$lib_base_6" | tr ' ' '\n' | sort -u | xargs) 457 | 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) 458 | lib_base_7=$(echo "$lib_base_7" | tr ' ' '\n' | sort -u | xargs) 459 | 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) 460 | lib_base_8=$(echo "$lib_base_8" | tr ' ' '\n' | sort -u | xargs) 461 | 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) 462 | lib_base_9=$(echo "$lib_base_9" | tr ' ' '\n' | sort -u | xargs) 463 | 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" 464 | lib_base_libs=$(echo "$lib_base_libs" | tr ' ' '\n' | sort -u | sed 's/.so.*/.so/' | xargs) 465 | for l in $lib_base_libs; do 466 | rsync -av ./archlinux/.junest/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 467 | done 468 | wait 469 | for l in $lib_base_libs; do 470 | rsync -av ./deps/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 471 | done 472 | wait 473 | } 474 | 475 | # Save files in /usr/share 476 | _saveshare() { 477 | echo "◆ Saving directories in /usr/share" 478 | SHARESAVED="$SHARESAVED $APP $BIN fontconfig glib- locale mime wayland X11" 479 | for arg in $SHARESAVED; do 480 | cp -r ./archlinux/.junest/usr/share/*"$arg"* ./"$APP".AppDir/.junest/usr/share/ 481 | done 482 | } 483 | 484 | _savebins 2>/dev/null 485 | _savelibs 2>/dev/null 486 | _saveshare 2>/dev/null 487 | 488 | echo "" 489 | echo "-----------------------------------------------------------------------------" 490 | echo " ASSEMBLING THE APPIMAGE" 491 | echo "-----------------------------------------------------------------------------" 492 | echo "" 493 | 494 | _rsync_main_package() { 495 | rm -Rf ./base/.* 496 | rsync -av ./base/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync the content of the \"$APP\" package" 497 | } 498 | 499 | _rsync_dependences() { 500 | rm -Rf ./deps/.* 501 | chmod -R 777 ./deps/* 502 | rsync -av ./deps/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync all dependencies, please wait" 503 | } 504 | 505 | _rsync_main_package 506 | _rsync_dependences 507 | 508 | ############################################################################# 509 | # REMOVE BLOATWARES, ENABLE MOUNTPOINTS 510 | ############################################################################# 511 | 512 | _remove_more_bloatwares() { 513 | etc_remove="makepkg.conf pacman" 514 | for r in $etc_remove; do 515 | rm -Rf ./"$APP".AppDir/.junest/etc/"$r"* 516 | done 517 | bin_remove="gcc" 518 | for r in $bin_remove; do 519 | rm -Rf ./"$APP".AppDir/.junest/usr/bin/"$r"* 520 | done 521 | lib_remove="gcc" 522 | for r in $lib_remove; do 523 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/"$r"* 524 | done 525 | share_remove="gcc" 526 | for r in $share_remove; do 527 | rm -Rf ./"$APP".AppDir/.junest/usr/share/"$r"* 528 | done 529 | echo Y | rm -Rf ./"$APP".AppDir/.cache/yay/* 530 | 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 531 | find ./"$APP".AppDir/.junest/usr/share/locale/*/*/* -not -iname "*$BIN*" -a -not -name "." -delete 2> /dev/null #REMOVE ALL ADDITIONAL LOCALE FILES 532 | rm -Rf ./"$APP".AppDir/.junest/home # remove the inbuilt home 533 | rm -Rf ./"$APP".AppDir/.junest/usr/include # files related to the compiler 534 | rm -Rf ./"$APP".AppDir/.junest/usr/share/man # AppImages are not ment to have man command 535 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/python*/__pycache__/* # if python is installed, removing this directory can save several megabytes 536 | #rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgallium* 537 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgo.so* 538 | #rm -Rf ./"$APP".AppDir/.junest/usr/lib/libLLVM* # included in the compilation phase, can sometimes be excluded for daily use 539 | rm -Rf ./"$APP".AppDir/.junest/var/* # remove all packages downloaded with the package manager 540 | } 541 | 542 | _enable_mountpoints_for_the_inbuilt_bubblewrap() { 543 | mkdir -p ./"$APP".AppDir/.junest/home 544 | mkdir -p ./"$APP".AppDir/.junest/media 545 | mkdir -p ./"$APP".AppDir/.junest/usr/lib/locale 546 | mkdir -p ./"$APP".AppDir/.junest/usr/share/fonts 547 | mkdir -p ./"$APP".AppDir/.junest/usr/share/themes 548 | mkdir -p ./"$APP".AppDir/.junest/run/media 549 | mkdir -p ./"$APP".AppDir/.junest/run/user 550 | rm -f ./"$APP".AppDir/.junest/etc/localtime && touch ./"$APP".AppDir/.junest/etc/localtime 551 | [ ! -f ./"$APP".AppDir/.junest/etc/asound.conf ] && touch ./"$APP".AppDir/.junest/etc/asound.conf 552 | } 553 | 554 | _remove_more_bloatwares 555 | find ./"$APP".AppDir/.junest/usr/lib ./"$APP".AppDir/.junest/usr/lib32 -type f -regex '.*\.a' -exec rm -f {} \; 2>/dev/null 556 | find ./"$APP".AppDir/.junest/usr -type f -regex '.*\.so.*' -exec strip --strip-debug {} \; 557 | find ./"$APP".AppDir/.junest/usr/bin -type f ! -regex '.*\.so.*' -exec strip --strip-unneeded {} \; 558 | find ./"$APP".AppDir/.junest/usr -type d -empty -delete 559 | _enable_mountpoints_for_the_inbuilt_bubblewrap 560 | 561 | ############################################################################# 562 | # CREATE THE APPIMAGE 563 | ############################################################################# 564 | 565 | if test -f ./*.AppImage; then rm -Rf ./*archimage*.AppImage; fi 566 | 567 | APPNAME="Kwave" 568 | REPO="Database-of-pkg2appimaged-packages" 569 | TAG="kwave" 570 | VERSION="$VERSION" 571 | UPINFO="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|$REPO|$TAG|*x86_64.AppImage.zsync" 572 | 573 | ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ 574 | -u "$UPINFO" \ 575 | ./"$APP".AppDir "$APPNAME"_"$VERSION"-archimage4.3-x86_64.AppImage 576 | -------------------------------------------------------------------------------- /latest-release.txt: -------------------------------------------------------------------------------- 1 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/webcamoid/Webcamoid_9.2.3-1-archimage4.3-x86_64.AppImage 2 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/quickemu/QuickEMU_4.9.7.r37.gc6c75e6-1-archimage4.2-x86_64.AppImage 3 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/kwave/Kwave_25.04.1-1-archimage4.3-x86_64.AppImage 4 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/gearlever/Gear-Lever_3.2.4-1-archimage4.3-x86_64.AppImage 5 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/falkon/Falkon_25.04.1-1-archimage4.3-x86_64.AppImage 6 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/chromium-bsu/Chromium-B.S.U._0.9.16.1-3-archimage4.3-x86_64.AppImage 7 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/audacious/Audacious_4.4.2-1-archimage4.3-x86_64.AppImage 8 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/asunder/Asunder-CD-Ripper_3.0.1-2-archimage4.3-x86_64.AppImage 9 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/sunvox/Sunvox_2.1.2.b-1-archimage4.3-x86_64.AppImage 10 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/simple-scan3/Document_Scanner-3.38.1-x86_64.AppImage 11 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/visipics/VisiPics-1.3-x86_64.AppImage 12 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/simplescreenrecorder/SimpleScreenRecorder-0.4.4-1-x86_64.AppImage 13 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/lxtask/Task_Manager-0.1.10-1-x86_64.AppImage 14 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/extremetuxracer/Extreme_Tux_Racer-0.8.2-1-x86_64.AppImage 15 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/billard-gl/Billard-GL-1.75-17-x86_64.AppImage 16 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/mate-system-monitor/MATE_System_Monitor-171-x86_64.AppImage 17 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/gnome-system-monitor3/System_Monitor-3.38.0-x86_64.AppImage 18 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/baobab3/Disk_Usage_Analyzer-3.38.0-x86_64.AppImage 19 | https://github.com/ivan-hc/Database-of-pkg2appimaged-packages/releases/download/capbattleship/CAP_Pirate_Battleship-x86_64.AppImage 20 | -------------------------------------------------------------------------------- /lxtask: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u 4 | APP=lxtask 5 | 6 | # CREATE A TEMPORARY DIRECTORY 7 | mkdir -p tmp && cd tmp || exit 1 8 | 9 | # DOWNLOADING THE DEPENDENCIES 10 | if test -f ./appimagetool; then 11 | echo " appimagetool already exists" 1> /dev/null 12 | else 13 | echo " Downloading appimagetool..." 14 | wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool 15 | fi 16 | if test -f ./pkg2appimage; then 17 | echo " pkg2appimage already exists" 1> /dev/null 18 | else 19 | echo " Downloading pkg2appimage..." 20 | wget -q "$(curl -Ls https://api.github.com/repos/AppImageCommunity/pkg2appimage/releases/latest | sed 's/[()",{} ]/\n/g' | grep -io "http.*x86_64.*appimage$" | head -1)" -O pkg2appimage 21 | fi 22 | chmod a+x ./appimagetool ./pkg2appimage 23 | rm -f ./recipe.yml 24 | 25 | # CREATING THE HEAD OF THE RECIPE 26 | echo "app: $APP 27 | binpatch: true 28 | 29 | ingredients: 30 | 31 | dist: oldstable 32 | #script: 33 | #- COMMAND 34 | sources: 35 | - deb http://ftp.debian.org/debian/ oldstable main contrib non-free 36 | - deb http://security.debian.org/debian-security/ oldstable-security main contrib non-free 37 | - deb http://ftp.debian.org/debian/ oldstable-updates main contrib non-free 38 | packages: 39 | - $APP" > recipe.yml 40 | 41 | 42 | # DOWNLOAD ALL THE NEEDED PACKAGES AND COMPILE THE APPDIR 43 | ./pkg2appimage ./recipe.yml 44 | 45 | # VERSION 46 | MAIN_DEB=$(find . -type f -name "$APP\_*.deb" | head -1 | sed 's:.*/::') 47 | if test -f ./"$APP"/"$MAIN_DEB"; then 48 | ar x ./"$APP"/"$MAIN_DEB" && tar xf ./control.tar.* && rm -f ./control.tar.* ./data.tar.* || exit 1 49 | VERSION=$(grep Version 0> ./"$APP"/"$APP".AppDir/AppRun << 'EOF' 64 | #!/bin/sh 65 | HERE="$(dirname "$(readlink -f "${0}")")" 66 | export UNION_PRELOAD="${HERE}" 67 | 68 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}" 69 | 70 | if test -d "${HERE}"/libunionpreload.so; then export LD_PRELOAD="${HERE}"/libunionpreload.so; fi 71 | #export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/lib/:"${HERE}"/lib64/:"${HERE}"/lib/x86_64-linux-gnu/:"${LD_LIBRARY_PATH}" 72 | export LD_LIBRARY_PATH=/lib/:/lib64/:/lib/x86_64-linux-gnu/:/usr/lib/:"${LD_LIBRARY_PATH}" 73 | 74 | if test -d "${HERE}"/usr/lib/python*; then 75 | PYTHONVERSION=$(find "${HERE}"/usr/lib -type d -name "python*" | head -1 | sed 's:.*/::') 76 | export PYTHONPATH="${HERE}"/usr/lib/"$PYTHONVERSION"/site-packages/:"${HERE}"/usr/lib/"$PYTHONVERSION"/lib-dynload/:"${PYTHONPATH}" 77 | export PYTHONHOME="${HERE}"/usr/ 78 | fi 79 | 80 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 81 | 82 | export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}" 83 | 84 | export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}" 85 | 86 | QTVER=$(find "${HERE}"/usr/lib -type d -name "qt*" | head -1 | sed 's:.*/::') 87 | if [ -z "$QTVER" ]; then 88 | export QT_PLUGIN_PATH="${HERE}"/usr/lib/"$QTVER"/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/"$QTVER"/plugins/:"${HERE}"/usr/lib64/"$QTVER"/plugins/:"${HERE}"/lib/"$QTVER"/plugins/:"${HERE}"/lib64/"$QTVER"/plugins/:"${QT_PLUGIN_PATH}" 89 | fi 90 | 91 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 92 | exec ${EXEC} "$@" 93 | EOF 94 | 95 | # MADE THE APPRUN EXECUTABLE 96 | chmod a+x ./"$APP"/"$APP".AppDir/AppRun 97 | # END OF THE PART RELATED TO THE APPRUN, NOW WE WELL SEE IF EVERYTHING WORKS ---------------------------------------------------------------------- 98 | 99 | # IMPORT THE LAUNCHER AND THE ICON TO THE APPDIR IF THEY NOT EXIST 100 | if test -f ./"$APP"/"$APP".AppDir/*.desktop; then 101 | echo "The desktop file exists" 102 | else 103 | echo "Trying to get the .desktop file" 104 | cp "./$APP/$APP.AppDir/usr/share/applications/*$(find . -type f -name "*$APP*.desktop" | head -1 | sed 's:.*/::')*" ./"$APP"/"$APP".AppDir/ 2>/dev/null 105 | fi 106 | 107 | wget https://upload.wikimedia.org/wikipedia/commons/6/64/GNOME_System_Monitor_icon_2019.svg -O ./"$APP"/"$APP".AppDir/utilities-system-monitor.svg 108 | 109 | # EXPORT THE APP TO AN APPIMAGE 110 | printf '#!/bin/sh\nexit 0' > ./desktop-file-validate # hack due to https://github.com/AppImage/appimagetool/pull/47 111 | chmod a+x ./desktop-file-validate 112 | PATH="$PATH:$PWD" ARCH=x86_64 ./appimagetool -n ./"$APP"/"$APP".AppDir 113 | if ! test -f ./*.AppImage; then 114 | echo "No AppImage available."; exit 1 115 | fi 116 | cd .. && mv ./tmp/*.AppImage ./Task_Manager-"$VERSION"-x86_64.AppImage && chmod a+x ./*.AppImage || exit 1 117 | -------------------------------------------------------------------------------- /mate-system-monitor: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | APP=mate-system-monitor 4 | 5 | # CREATE A TEMPORARY DIRECTORY 6 | mkdir -p tmp 7 | cd tmp 8 | 9 | # DOWNLOADING THE DEPENDENCIES 10 | if test -f ./appimagetool; then 11 | echo " appimagetool already exists" 1> /dev/null 12 | else 13 | echo " Downloading appimagetool..." 14 | wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool 15 | fi 16 | if test -f ./pkg2appimage; then 17 | echo " pkg2appimage already exists" 1> /dev/null 18 | else 19 | echo " Downloading pkg2appimage..." 20 | wget -q "$(curl -Ls https://api.github.com/repos/AppImageCommunity/pkg2appimage/releases/latest | sed 's/[()",{} ]/\n/g' | grep -io "http.*x86_64.*appimage$" | head -1)" -O pkg2appimage 21 | fi 22 | chmod a+x ./appimagetool ./pkg2appimage 23 | rm -f ./recipe.yml 24 | 25 | # CREATING THE HEAD OF THE RECIPE 26 | echo "app: $APP 27 | binpatch: true 28 | 29 | ingredients: 30 | 31 | dist: oldstable 32 | sources: 33 | - deb http://ftp.debian.org/debian/ oldstable main contrib non-free 34 | - deb http://security.debian.org/debian-security/ oldstable-security main contrib non-free 35 | - deb http://ftp.debian.org/debian/ oldstable-updates main contrib non-free 36 | packages: 37 | - $APP" >> recipe.yml 38 | 39 | 40 | # DOWNLOAD ALL THE NEEDED PACKAGES AND COMPILE THE APPDIR 41 | ./pkg2appimage ./recipe.yml 42 | 43 | # LIBUNIONPRELOAD 44 | #wget https://github.com/project-portable/libunionpreload/releases/download/amd64/libunionpreload.so 45 | #chmod a+x libunionpreload.so 46 | #mv ./libunionpreload.so ./$APP/$APP.AppDir/ 47 | 48 | # COMPILE SCHEMAS 49 | glib-compile-schemas ./$APP/$APP.AppDir/usr/share/glib-2.0/schemas/ || echo "No ./usr/share/glib-2.0/schemas/" 50 | 51 | # CUSTOMIZE THE APPRUN 52 | rm -R -f ./$APP/$APP.AppDir/AppRun 53 | cat >> ./$APP/$APP.AppDir/AppRun << 'EOF' 54 | #!/bin/sh 55 | HERE="$(dirname "$(readlink -f "${0}")")" 56 | export UNION_PRELOAD=/:"${HERE}" 57 | #export LD_PRELOAD="${HERE}"/libunionpreload.so 58 | export LD_LIBRARY_PATH=/lib/:/lib64/:/lib/x86_64-linux-gnu/:/usr/lib/:"${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${LD_LIBRARY_PATH}" 59 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}" 60 | export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${HERE}"/usr/lib/python*/:"${PYTHONPATH}" 61 | export PYTHONHOME="${HERE}"/usr/:"${HERE}"/usr/lib/python*/ 62 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 63 | export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}" 64 | export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}" 65 | export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}" 66 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 67 | exec ${EXEC} "$@" 68 | EOF 69 | 70 | # MADE THE APPRUN EXECUTABLE 71 | chmod a+x ./$APP/$APP.AppDir/AppRun 72 | # END OF THE PART RELATED TO THE APPRUN, NOW WE WELL SEE IF EVERYTHING WORKS ---------------------------------------------------------------------- 73 | 74 | # IMPORT THE LAUNCHER AND THE ICON TO THE APPDIR IF THEY NOT EXIST 75 | if test -f ./$APP/$APP.AppDir/*.desktop; then 76 | echo "The desktop file exists" 77 | else 78 | echo "Trying to get the .desktop file" 79 | cp ./$APP/$APP.AppDir/usr/share/applications/*$(ls . | grep -i $APP | cut -c -4)*desktop ./$APP/$APP.AppDir/ 2>/dev/null 80 | fi 81 | 82 | wget https://upload.wikimedia.org/wikipedia/commons/8/86/Utilities-system-monitor.svg -O ./$APP/$APP.AppDir/utilities-system-monitor.png 2>/dev/null 83 | 84 | # UNCOMMENT THE FOLLOWING LINE TO REMOVE FILES IN "METAINFO" IN CASE OF ERRORS WITH "APPSTREAM" 85 | rm -R -f ./$APP/$APP.AppDir/usr/share/metainfo/* 86 | 87 | # EXPORT THE APP TO AN APPIMAGE 88 | ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 ./$APP/$APP.AppDir 89 | cd .. 90 | mv ./tmp/*.AppImage . 91 | chmod a+x *.AppImage 92 | -------------------------------------------------------------------------------- /quickemu-junest.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | APP=quickemu 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="gawk qemu-full" #SYNTAX: "APP1 APP2 APP3 APP4...", LEAVE BLANK IF NO OTHER DEPENDENCES 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 libdl.so libpthread.so librt.so libasound.so libX11-xcb.so libxapp-gtk3-module.so libgtk-3.so.0 pk p11" 17 | LIBSAVED="SAVELIBSPLEASE $lib_audio_keywords $lib_browser_launcher" 18 | 19 | ############################################################################# 20 | # SETUP THE ENVIRONMENT 21 | ############################################################################# 22 | 23 | # Download appimagetool 24 | if [ ! -f ./appimagetool ]; then 25 | echo "-----------------------------------------------------------------------------" 26 | echo "◆ Downloading \"appimagetool\" from https://github.com/AppImage/appimagetool" 27 | echo "-----------------------------------------------------------------------------" 28 | curl -#Lo appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage && chmod a+x appimagetool 29 | fi 30 | 31 | # Create and enter the AppDir 32 | mkdir -p "$APP".AppDir && cd "$APP".AppDir || exit 1 33 | 34 | # Set the AppDir as a temporary $HOME directory 35 | HOME="$(dirname "$(readlink -f "$0")")" 36 | 37 | ############################################################################# 38 | # DOWNLOAD, INSTALL AND CONFIGURE JUNEST 39 | ############################################################################# 40 | 41 | _enable_multilib() { 42 | printf "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> ./.junest/etc/pacman.conf 43 | } 44 | 45 | _enable_chaoticaur() { 46 | # This function is ment to be used during the installation of JuNest, see "_pacman_patches" 47 | ./.local/share/junest/bin/junest -- sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com 48 | ./.local/share/junest/bin/junest -- sudo pacman-key --lsign-key 3056513887B78AEB 49 | ./.local/share/junest/bin/junest -- sudo pacman-key --populate chaotic 50 | ./.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' 51 | printf "\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist" >> ./.junest/etc/pacman.conf 52 | } 53 | 54 | _custom_mirrorlist() { 55 | COUNTRY=$(curl -i ipinfo.io 2>/dev/null | grep country | cut -c 15- | cut -c -2) 56 | if [ -n "$GITHUB_REPOSITORY_OWNER" ] || ! curl --output /dev/null --silent --head --fail "https://archlinux.org/mirrorlist/?country=$COUNTRY" 1>/dev/null; then 57 | curl -Ls https://archlinux.org/mirrorlist/all | awk NR==2 RS= | sed 's/#Server/Server/g' > ./.junest/etc/pacman.d/mirrorlist 58 | else 59 | curl -Ls "https://archlinux.org/mirrorlist/?country=$COUNTRY" | sed 's/#Server/Server/g' > ./.junest/etc/pacman.d/mirrorlist 60 | fi 61 | } 62 | 63 | _bypass_signature_check_level() { 64 | sed -i 's/#SigLevel/SigLevel/g; s/Required DatabaseOptional/Never/g' ./.junest/etc/pacman.conf 65 | } 66 | 67 | _install_junest() { 68 | echo "-----------------------------------------------------------------------------" 69 | echo "◆ Clone JuNest from https://github.com/fsquillace/junest" 70 | echo "-----------------------------------------------------------------------------" 71 | git clone https://github.com/fsquillace/junest.git ./.local/share/junest 72 | echo "-----------------------------------------------------------------------------" 73 | echo "◆ Downloading JuNest archive from https://github.com/ivan-hc/junest" 74 | echo "-----------------------------------------------------------------------------" 75 | curl -#Lo junest-x86_64.tar.gz https://github.com/ivan-hc/junest/releases/download/continuous/junest-x86_64.tar.gz 76 | ./.local/share/junest/bin/junest setup -i junest-x86_64.tar.gz 77 | rm -f junest-x86_64.tar.gz 78 | echo " Apply patches to PacMan..." 79 | #_enable_multilib 80 | _enable_chaoticaur 81 | _custom_mirrorlist 82 | _bypass_signature_check_level 83 | 84 | # Update arch linux in junest 85 | ./.local/share/junest/bin/junest -- sudo pacman -Syy 86 | ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -Syu 87 | } 88 | 89 | _restore_junest() { 90 | cd .. 91 | echo "-----------------------------------------------------------------------------" 92 | echo " RESTORATION OF BACKUPS IN PROGRESS..." 93 | echo "-----------------------------------------------------------------------------" 94 | echo "" 95 | rsync -av ./junest-backups/ ./"$APP".AppDir/.junest/ | echo "◆ Restore the content of the Arch Linux container, please wait" 96 | [ -d ./"$APP".AppDir/.cache ] && rsync -av ./stock-cache/ ./"$APP".AppDir/.cache/ | echo "◆ Restore the content of JuNest's ~/.cache directory" 97 | rsync -av ./stock-local/ ./"$APP".AppDir/.local/ | echo "◆ Restore the content of JuNest's ~/.local directory" 98 | echo "" 99 | echo "-----------------------------------------------------------------------------" 100 | echo "" 101 | cd ./"$APP".AppDir || exit 1 102 | } 103 | 104 | if ! test -d "$HOME/.local/share/junest"; then 105 | _install_junest 106 | else 107 | _restore_junest 108 | fi 109 | 110 | ############################################################################# 111 | # INSTALL PROGRAMS USING YAY 112 | ############################################################################# 113 | 114 | ./.local/share/junest/bin/junest -- yay -Syy 115 | ./.local/share/junest/bin/junest -- gpg --keyserver keyserver.ubuntu.com --recv-key C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF # UNCOMMENT IF YOU USE THE AUR 116 | if [ -n "$BASICSTUFF" ]; then 117 | ./.local/share/junest/bin/junest -- yay --noconfirm -S "$BASICSTUFF" 118 | fi 119 | if [ -n "$COMPILERS" ]; then 120 | ./.local/share/junest/bin/junest -- yay --noconfirm -S "$COMPILERS" 121 | fi 122 | if [ -n "$DEPENDENCES" ]; then 123 | ./.local/share/junest/bin/junest -- yay --noconfirm -S "$DEPENDENCES" 124 | fi 125 | if [ -n "$APP" ]; then 126 | ./.local/share/junest/bin/junest -- yay --noconfirm -S alsa-lib gtk3 xapp 127 | ./.local/share/junest/bin/junest -- yay --noconfirm -S "$APP" 128 | ./.local/share/junest/bin/junest -- glib-compile-schemas /usr/share/glib-2.0/schemas/ 129 | else 130 | echo "No app found, exiting"; exit 1 131 | fi 132 | 133 | # Backup JuNest for furter tests 134 | cd .. 135 | echo "" 136 | echo "-----------------------------------------------------------------------------" 137 | echo " BACKUP OF JUNEST FOR FURTHER APPIMAGE BUILDING ATTEMPTS" 138 | echo "-----------------------------------------------------------------------------" 139 | mkdir -p ./junest-backups ./stock-cache ./stock-local 140 | echo "" 141 | rsync -av --ignore-existing ./"$APP".AppDir/.junest/ ./junest-backups/ | echo "◆ Backup the content of the Arch Linux container, please wait" 142 | [ -d ./"$APP".AppDir/.cache ] && rsync -av --ignore-existing ./"$APP".AppDir/.cache/ ./stock-cache/ | echo "◆ Backup the content of JuNest's ~/.cache directory" 143 | rsync -av --ignore-existing ./"$APP".AppDir/.local/ ./stock-local/ | echo "◆ Backup the content of JuNest's ~/.local directory" 144 | echo "" 145 | echo "-----------------------------------------------------------------------------" 146 | cd ./"$APP".AppDir || exit 1 147 | 148 | ############################################################################# 149 | # LAUNCHER AND ICON / MADE JUNEST A PORTABLE CONTAINER 150 | ############################################################################# 151 | 152 | # Set locale 153 | rm -f ./.junest/etc/locale.conf 154 | sed -i 's/LANG=${LANG:-C}/LANG=$LANG/g' ./.junest/etc/profile.d/locale.sh 155 | 156 | # Add launcher and icon 157 | rm -f ./*.desktop 158 | #LAUNCHER=$(grep -iRl "$BIN" ./.junest/usr/share/applications/* | grep ".desktop" | head -1) 159 | #cp -r "$LAUNCHER" ./ 160 | ICON="$BIN" 161 | cp -r ./.junest/usr/share/icons/*"$ICON"* ./ 2>/dev/null 162 | cp -r ./.junest/usr/share/icons/hicolor/22x22/apps/*"$ICON"* ./ 2>/dev/null 163 | cp -r ./.junest/usr/share/icons/hicolor/24x24/apps/*"$ICON"* ./ 2>/dev/null 164 | cp -r ./.junest/usr/share/icons/hicolor/32x32/apps/*"$ICON"* ./ 2>/dev/null 165 | cp -r ./.junest/usr/share/icons/hicolor/48x48/apps/*"$ICON"* ./ 2>/dev/null 166 | cp -r ./.junest/usr/share/icons/hicolor/64x64/apps/*"$ICON"* ./ 2>/dev/null 167 | cp -r ./.junest/usr/share/icons/hicolor/128x128/apps/*"$ICON"* ./ 2>/dev/null 168 | cp -r ./.junest/usr/share/icons/hicolor/192x192/apps/*"$ICON"* ./ 2>/dev/null 169 | cp -r ./.junest/usr/share/icons/hicolor/256x256/apps/*"$ICON"* ./ 2>/dev/null 170 | cp -r ./.junest/usr/share/icons/hicolor/512x512/apps/*"$ICON"* ./ 2>/dev/null 171 | cp -r ./.junest/usr/share/icons/hicolor/scalable/apps/*"$ICON"* ./ 2>/dev/null 172 | cp -r ./.junest/usr/share/pixmaps/*"$ICON"* ./ 2>/dev/null 173 | 174 | # Test if the desktop file and the icon are in the root of the future appimage (./*appdir/*) 175 | if test -f ./*.desktop; then 176 | echo "◆ The .desktop file is available in $APP.AppDir/" 177 | elif test -f ./.junest/usr/bin/"$BIN"; then 178 | echo "" 179 | echo "◆ No .desktop file available for $APP, creating a new one..." 180 | echo "" 181 | cat <<-HEREDOC >> ./"$APP".desktop 182 | [Desktop Entry] 183 | Version=1.0 184 | Type=Application 185 | Terminal=false 186 | Exec=$BIN 187 | Name=QuickEMU 188 | Icon=$BIN 189 | Categories=System;Utility; 190 | StartupNotify=true 191 | HEREDOC 192 | curl -Lo quickemu.png https://raw.githubusercontent.com/quickemu-project/quickemu/master/.github/logo.png 193 | else 194 | echo "No binary in path... aborting all the processes." 195 | exit 0 196 | fi 197 | 198 | # Made JuNest a portable app and remove "read-only file system" errors 199 | sed -i 's#${JUNEST_HOME}/usr/bin/junest_wrapper#${HOME}/.cache/junest_wrapper.old#g' ./.local/share/junest/lib/core/wrappers.sh 200 | sed -i 's/rm -f "${JUNEST_HOME}${bin_path}_wrappers/#rm -f "${JUNEST_HOME}${bin_path}_wrappers/g' ./.local/share/junest/lib/core/wrappers.sh 201 | sed -i 's/ln/#ln/g' ./.local/share/junest/lib/core/wrappers.sh 202 | sed -i 's/rm -f "$file"/test -f "$file"/g' ./.local/share/junest/lib/core/wrappers.sh 203 | sed -i 's#--bind "$HOME" "$HOME"#--bind-try /home /home --bind-try /run/user /run/user#g' .local/share/junest/lib/core/namespace.sh 204 | 205 | ############################################################################# 206 | # APPRUN 207 | ############################################################################# 208 | 209 | rm -f ./AppRun 210 | cat <<-'HEREDOC' >> ./AppRun 211 | #!/bin/sh 212 | HERE="$(dirname "$(readlink -f "$0")")" 213 | export UNION_PRELOAD="$HERE" 214 | export JUNEST_HOME="$HERE"/.junest 215 | 216 | if command -v unshare >/dev/null 2>&1 && ! unshare --user -p /bin/true >/dev/null 2>&1; then 217 | PROOT_ON=1 218 | export PATH="$HERE"/.local/share/junest/bin/:"$PATH" 219 | mkdir -p "$HOME"/.cache 220 | else 221 | export PATH="$PATH":"$HERE"/.local/share/junest/bin 222 | fi 223 | 224 | [ -z "$NVIDIA_ON" ] && NVIDIA_ON=1 225 | if [ "$NVIDIA_ON" = 1 ]; then 226 | DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}" 227 | CONTY_DIR="${DATADIR}/Conty/overlayfs_shared" 228 | [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)" 229 | if [ -n "$nvidia_driver_version" ]; then 230 | mkdir -p "${CONTY_DIR}"/nvidia "${CONTY_DIR}"/up/usr/lib "${CONTY_DIR}"/up/usr/share 231 | nvidia_data_dirs="egl glvnd nvidia vulkan" 232 | 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 233 | [ ! -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 234 | [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty=$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version) 235 | if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then 236 | rm -f "${CONTY_DIR}"/up/usr/lib/*; echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 237 | fi 238 | /sbin/ldconfig -p > "${CONTY_DIR}"/nvidia/host_libs 239 | grep -i "nvidia\|libcuda" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2 > "${CONTY_DIR}"/nvidia/host_nvidia_libs 240 | libnv_paths=$(grep "libnv" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2) 241 | for f in $libnv_paths; do strings "${f}" | grep -qi -m 1 "nvidia" && echo "${f}" >> "${CONTY_DIR}"/nvidia/host_nvidia_libs; done 242 | nvidia_libs=$(cat "${CONTY_DIR}"/nvidia/host_nvidia_libs) 243 | 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 244 | libvdpau_nvidia="${CONTY_DIR}/up/usr/lib/libvdpau_nvidia.so" 245 | 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 246 | [ -f "${libvdpau_nvidia}"."${nvidia_driver_version}" ] && [ ! -f "${libvdpau_nvidia}" ] && ln -s "${libvdpau_nvidia}"."${nvidia_driver_version}" "${libvdpau_nvidia}" 247 | [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}" 248 | [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}" 249 | fi 250 | fi 251 | 252 | PROOT_BINDINGS="" 253 | BWRAP_BINDINGS="" 254 | 255 | bind_files="/etc/resolv.conf /etc/hosts /etc/nsswitch.conf /etc/passwd /etc/group /etc/machine-id /etc/asound.conf /etc/localtime " 256 | for f in $bind_files; do [ -f "$f" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$f" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --ro-bind-try $f $f"; done 257 | 258 | bind_dirs=" /media /mnt /opt /run/media /usr/lib/locale /usr/share/fonts /usr/share/themes /var" 259 | for d in $bind_dirs; do [ -d "$d" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$d" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --bind-try $d $d"; done 260 | 261 | PROOT_BINDS=" --bind=/dev --bind=/sys --bind=/tmp --bind=/proc $PROOT_BINDINGS --bind=/home --bind=/home/$USER " 262 | BWRAP_BINDS=" --dev-bind /dev /dev --ro-bind /sys /sys --bind-try /tmp /tmp --proc /proc $BWRAP_BINDINGS " 263 | 264 | _JUNEST_CMD() { 265 | if [ "$PROOT_ON" = 1 ]; then 266 | "$HERE"/.local/share/junest/bin/junest proot -n -b "$PROOT_BINDS" "$@" 267 | else 268 | "$HERE"/.local/share/junest/bin/junest -n -b "$BWRAP_BINDS" "$@" 269 | fi 270 | } 271 | 272 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 273 | 274 | _JUNEST_CMD -- $EXEC "$@" 275 | 276 | HEREDOC 277 | chmod a+x ./AppRun 278 | 279 | cd .. || exit 1 280 | 281 | ############################################################################# 282 | # EXTRACT PACKAGES 283 | ############################################################################# 284 | 285 | # EXTRACT PACKAGES 286 | _extract_main_package() { 287 | mkdir -p base 288 | rm -Rf ./base/* 289 | pkg_full_path=$(find ./"$APP".AppDir -type f -name "$APP-*zst") 290 | if [ "$(echo "$pkg_full_path" | wc -l)" = 1 ]; then 291 | pkg_full_path=$(find ./"$APP".AppDir -type f -name "$APP-*zst") 292 | else 293 | for p in $pkg_full_path; do 294 | if tar "$p" .PKGINFO -O | grep -q "pkgname = $APP$"; then 295 | pkg_full_path="$p" 296 | fi 297 | done 298 | fi 299 | [ -z "$pkg_full_path" ] && echo "💀 ERROR: no package found for \"$APP\", operation aborted!" && exit 0 300 | tar fx "$pkg_full_path" -C ./base/ 301 | VERSION=$(cat ./base/.PKGINFO | grep pkgver | cut -c 10- | sed 's@.*:@@') 302 | mkdir -p deps 303 | rm -Rf ./deps/* 304 | } 305 | 306 | _download_missing_packages() { 307 | localpackage=$(find ./"$APP".AppDir -name "$arg-[0-9]*zst") 308 | if ! test -f "$localpackage"; then 309 | ./"$APP".AppDir/.local/share/junest/bin/junest -- yay --noconfirm -Sw "$arg" 310 | fi 311 | } 312 | 313 | _extract_package() { 314 | _download_missing_packages &> /dev/null 315 | pkg_full_path=$(find ./"$APP".AppDir -name "$arg-[0-9]*zst") 316 | pkgname=$(echo "$pkg_full_path" | sed 's:.*/::') 317 | if test -f "$pkg_full_path"; then 318 | if ! grep -q "$pkgname" ./packages 2>/dev/null;then 319 | echo "◆ Extracting $pkgname" 320 | tar fx "$pkg_full_path" -C ./deps/ --warning=no-unknown-keyword 321 | echo "$pkgname" >> ./packages 322 | else 323 | tar fx "$pkg_full_path" -C ./deps/ --warning=no-unknown-keyword 324 | echo "$pkgname" >> ./packages 325 | fi 326 | [ -n "$lib_browser_launcher" ] && [[ "$arg" =~ (hicolor-icon-theme|xapp) ]] && tar fx "$pkg_full_path" -C ./base/ --warning=no-unknown-keyword --exclude='.PKGINFO' 327 | fi 328 | } 329 | 330 | _determine_packages_and_libraries() { 331 | if echo "$arg" | grep -q "\.so"; then 332 | LIBSAVED="$LIBSAVED $arg" 333 | 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 334 | _extract_package 335 | cat ./deps/.PKGINFO 2>/dev/null | grep "^depend = " | cut -c 10- | sed 's/=.*//' >> depdeps 336 | rm -f ./deps/.* 337 | fi 338 | } 339 | 340 | _extract_deps() { 341 | DEPS=$(sort -u ./depdeps) 342 | for arg in $DEPS; do 343 | _determine_packages_and_libraries 344 | done 345 | } 346 | 347 | _extract_all_dependences() { 348 | rm -f ./depdeps 349 | 350 | OPTDEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^optdepend = " | sed 's/optdepend = //g' | sed 's/=.*//' | sed 's/:.*//') 351 | for arg in $OPTDEPS; do 352 | _determine_packages_and_libraries 353 | done 354 | [ -f ./depdeps ] && _extract_deps 355 | rm -f ./depdeps 356 | 357 | ARGS=$(echo "$DEPENDENCES" | tr " " "\n") 358 | for arg in $ARGS; do 359 | _determine_packages_and_libraries 360 | done 361 | 362 | DEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^depend = " | sed 's/depend = //g' | sed 's/=.*//') 363 | for arg in $DEPS; do 364 | _determine_packages_and_libraries 365 | done 366 | 367 | # Set the level of sub-dependencies extraction, the higher the number, the bigger the AppImage will be 368 | [ -z "$extraction_count" ] && extraction_count=2 369 | for e in $(seq "$extraction_count"); do _extract_deps; done 370 | 371 | rm -f ./packages 372 | } 373 | 374 | echo "-----------------------------------------------------------------------------" 375 | echo " EXTRACTING DEPENDENCES" 376 | echo "-----------------------------------------------------------------------------" 377 | echo "" 378 | _extract_main_package 379 | _extract_all_dependences 380 | 381 | # SAVE ESSENTIAL FILES AND LIBRARIES 382 | echo "" 383 | echo "-----------------------------------------------------------------------------" 384 | echo " IMPLEMENTING NECESSARY LIBRARIES (MAY TAKE SEVERAL MINUTES)" 385 | echo "-----------------------------------------------------------------------------" 386 | echo "" 387 | 388 | ############################################################################# 389 | # SAVE FILES AND DIRECTORIES AND DETECT THE NEEDED LIBRARIES 390 | ############################################################################# 391 | 392 | # Save files in /usr/bin 393 | _savebins() { 394 | echo "◆ Saving files in /usr/bin" 395 | mkdir save 396 | mv ./"$APP".AppDir/.junest/usr/bin/bwrap ./save/ 397 | mv ./"$APP".AppDir/.junest/usr/bin/proot* ./save/ 398 | mv ./"$APP".AppDir/.junest/usr/bin/*$BIN* ./save/ 399 | 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" 400 | utils_bin="bash $coreutils grep ld sed sh strings" 401 | for b in $utils_bin; do 402 | mv ./"$APP".AppDir/.junest/usr/bin/"$b" ./save/ 403 | done 404 | for arg in $BINSAVED; do 405 | mv ./"$APP".AppDir/.junest/usr/bin/*"$arg"* ./save/ 406 | done 407 | rm -Rf ./"$APP".AppDir/.junest/usr/bin/* 408 | mv ./save/* ./"$APP".AppDir/.junest/usr/bin/ 409 | rmdir save 410 | } 411 | 412 | # Save files in /usr/lib 413 | _binlibs() { 414 | echo "◆ Saving libraries related to /usr/bin files" 415 | readelf -d ./"$APP".AppDir/.junest/usr/bin/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list 416 | mv ./"$APP".AppDir/.junest/usr/lib/ld-linux-x86-64.so* ./save/ 417 | mv ./"$APP".AppDir/.junest/usr/lib/*$APP* ./save/ 418 | mv ./"$APP".AppDir/.junest/usr/lib/*$BIN* ./save/ 419 | mv ./"$APP".AppDir/.junest/usr/lib/libdw* ./save/ 420 | mv ./"$APP".AppDir/.junest/usr/lib/libelf* ./save/ 421 | for arg in $SHARESAVED; do 422 | mv ./"$APP".AppDir/.junest/usr/lib/*"$arg"* ./save/ 423 | done 424 | ARGS=$(tail -n +2 ./list | sort -u | uniq) 425 | for arg in $ARGS; do 426 | mv ./"$APP".AppDir/.junest/usr/lib/"$arg"* ./save/ 427 | find ./"$APP".AppDir/.junest/usr/lib/ -name "$arg" -exec cp -r --parents -t save/ {} + 428 | done 429 | rm -Rf "$(find ./save/ | sort | grep ".AppDir" | head -1)" 430 | rm list 431 | } 432 | 433 | _include_swrast_dri() { 434 | mkdir ./save/dri 435 | mv ./"$APP".AppDir/.junest/usr/lib/dri/swrast_dri.so ./save/dri/ 436 | } 437 | 438 | _libkeywords() { 439 | echo "◆ Saving libraries using keywords" 440 | for arg in $LIBSAVED; do 441 | mv ./"$APP".AppDir/.junest/usr/lib/*"$arg"* ./save/ 442 | done 443 | } 444 | 445 | _readelf_save() { 446 | echo "◆ Saving libraries related to previously saved files" 447 | find_libs=$(find ./save -type f -name '*.so*' | uniq) 448 | for f in $find_libs; do 449 | readelf -d "$f" | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list & 450 | done 451 | wait 452 | ARGS=$(tail -n +2 ./list | sort -u | uniq) 453 | for arg in $ARGS; do 454 | mv ./"$APP".AppDir/.junest/usr/lib/"$arg"* ./save/ 455 | find ./"$APP".AppDir/.junest/usr/lib/ -name "$arg" -exec cp -r --parents -t save/ {} + 456 | done 457 | rsync -av ./save/"$APP".AppDir/.junest/usr/lib/ ./save/ 458 | rm -Rf "$(find ./save/ | sort | grep ".AppDir" | head -1)" 459 | rm list 460 | } 461 | 462 | _readelf_base() { 463 | echo "◆ Detect libraries of the main package" 464 | find_libs=$(find ./base -type f | uniq) 465 | for f in $find_libs; do 466 | readelf -d "$f" | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list & 467 | done 468 | wait 469 | } 470 | 471 | _readelf_deps() { 472 | echo "◆ Detect libraries of the dependencies" 473 | find_libs=$(find ./deps -executable -type f | uniq) 474 | for f in $find_libs; do 475 | readelf -d "$f" | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list & 476 | done 477 | wait 478 | } 479 | 480 | _liblibs() { 481 | _readelf_base 482 | _readelf_deps 483 | echo "◆ Saving libraries related to the previously extracted packages" 484 | ARGS=$(tail -n +2 ./list | sort -u | uniq) 485 | for arg in $ARGS; do 486 | mv ./"$APP".AppDir/.junest/usr/lib/"$arg"* ./save/ 487 | find ./"$APP".AppDir/.junest/usr/lib/ -name "$arg" -exec cp -r --parents -t save/ {} + 488 | done 489 | rsync -av ./save/"$APP".AppDir/.junest/usr/lib/ ./save/ 490 | rm -Rf "$(find ./save/ | sort | grep ".AppDir" | head -1)" 491 | rm list 492 | _readelf_save 493 | _readelf_save 494 | _readelf_save 495 | _readelf_save 496 | } 497 | 498 | _mvlibs() { 499 | echo "◆ Restore saved libraries to /usr/lib" 500 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/* 501 | mv ./save/* ./"$APP".AppDir/.junest/usr/lib/ 502 | } 503 | 504 | _savelibs() { 505 | mkdir save 506 | _binlibs 2> /dev/null 507 | #_include_swrast_dri 2> /dev/null 508 | _libkeywords 2> /dev/null 509 | _liblibs 2> /dev/null 510 | _mvlibs 2> /dev/null 511 | rmdir save 512 | } 513 | 514 | # Save files in /usr/share 515 | _saveshare() { 516 | mkdir save 517 | mv ./"$APP".AppDir/.junest/usr/share/*$APP* ./save/ 518 | mv ./"$APP".AppDir/.junest/usr/share/*$BIN* ./save/ 519 | mv ./"$APP".AppDir/.junest/usr/share/fontconfig ./save/ 520 | mv ./"$APP".AppDir/.junest/usr/share/glib-* ./save/ 521 | mv ./"$APP".AppDir/.junest/usr/share/locale ./save/ 522 | mv ./"$APP".AppDir/.junest/usr/share/mime ./save/ 523 | mv ./"$APP".AppDir/.junest/usr/share/wayland ./save/ 524 | mv ./"$APP".AppDir/.junest/usr/share/X11 ./save/ 525 | for arg in $SHARESAVED; do 526 | mv ./"$APP".AppDir/.junest/usr/share/*"$arg"* ./save/ 527 | done 528 | rm -Rf ./"$APP".AppDir/.junest/usr/share/* 529 | mv ./save/* ./"$APP".AppDir/.junest/usr/share/ 530 | rmdir save 531 | } 532 | 533 | _savebins 2> /dev/null 534 | _savelibs 535 | _saveshare 2> /dev/null 536 | 537 | # ASSEMBLING THE APPIMAGE PACKAGE 538 | _rsync_main_package() { 539 | echo "" 540 | echo "-----------------------------------------------------------------------------" 541 | rm -Rf ./base/.* 542 | rsync -av ./base/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync the content of the \"$APP\" package" 543 | } 544 | 545 | _rsync_dependences() { 546 | rm -Rf ./deps/.* 547 | rsync -av ./deps/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync all dependeces, please wait..." 548 | echo "-----------------------------------------------------------------------------" 549 | echo "" 550 | } 551 | 552 | ############################################################################# 553 | # REMOVE BLOATWARES, ENABLE MOUNTPOINTS 554 | ############################################################################# 555 | 556 | _remove_more_bloatwares() { 557 | etc_remove="makepkg.conf pacman" 558 | for r in $etc_remove; do 559 | rm -Rf ./"$APP".AppDir/.junest/etc/"$r"* 560 | done 561 | bin_remove="gcc" 562 | for r in $bin_remove; do 563 | rm -Rf ./"$APP".AppDir/.junest/usr/bin/"$r"* 564 | done 565 | lib_remove="gcc" 566 | for r in $lib_remove; do 567 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/"$r"* 568 | done 569 | share_remove="gcc" 570 | for r in $share_remove; do 571 | rm -Rf ./"$APP".AppDir/.junest/usr/share/"$r"* 572 | done 573 | echo Y | rm -Rf ./"$APP".AppDir/.cache/yay/* 574 | 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 575 | find ./"$APP".AppDir/.junest/usr/share/locale/*/*/* -not -iname "*$BIN*" -a -not -name "." -delete 2> /dev/null #REMOVE ALL ADDITIONAL LOCALE FILES 576 | rm -Rf ./"$APP".AppDir/.junest/home # remove the inbuilt home 577 | rm -Rf ./"$APP".AppDir/.junest/usr/include # files related to the compiler 578 | rm -Rf ./"$APP".AppDir/.junest/usr/share/man # AppImages are not ment to have man command 579 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/python*/__pycache__/* # if python is installed, removing this directory can save several megabytes 580 | #rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgallium* 581 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgo.so* 582 | #rm -Rf ./"$APP".AppDir/.junest/usr/lib/libLLVM* # included in the compilation phase, can sometimes be excluded for daily use 583 | rm -Rf ./"$APP".AppDir/.junest/var/* # remove all packages downloaded with the package manager 584 | } 585 | 586 | _enable_mountpoints_for_the_inbuilt_bubblewrap() { 587 | mkdir -p ./"$APP".AppDir/.junest/home 588 | mkdir -p ./"$APP".AppDir/.junest/media 589 | mkdir -p ./"$APP".AppDir/.junest/usr/lib/locale 590 | mkdir -p ./"$APP".AppDir/.junest/usr/share/fonts 591 | mkdir -p ./"$APP".AppDir/.junest/usr/share/themes 592 | mkdir -p ./"$APP".AppDir/.junest/run/media 593 | mkdir -p ./"$APP".AppDir/.junest/run/user 594 | rm -f ./"$APP".AppDir/.junest/etc/localtime && touch ./"$APP".AppDir/.junest/etc/localtime 595 | [ ! -f ./"$APP".AppDir/.junest/etc/asound.conf ] && touch ./"$APP".AppDir/.junest/etc/asound.conf 596 | } 597 | 598 | _rsync_main_package 599 | _rsync_dependences 600 | _remove_more_bloatwares 601 | find ./"$APP".AppDir/.junest/usr/lib ./"$APP".AppDir/.junest/usr/lib32 -type f -regex '.*\.a' -exec rm -f {} \; 602 | find ./"$APP".AppDir/.junest/usr -type f -regex '.*\.so.*' -exec strip --strip-debug {} \; 603 | find ./"$APP".AppDir/.junest/usr/bin -type f ! -regex '.*\.so.*' -exec strip --strip-unneeded {} \; 604 | _enable_mountpoints_for_the_inbuilt_bubblewrap 605 | 606 | ############################################################################# 607 | # CREATE THE APPIMAGE 608 | ############################################################################# 609 | 610 | if test -f ./*.AppImage; then rm -Rf ./*archimage*.AppImage; fi 611 | 612 | APPNAME=$(cat ./"$APP".AppDir/*.desktop | grep 'Name=' | head -1 | cut -c 6- | sed 's/ /-/g') 613 | REPO="Database-of-pkg2appimaged-packages" 614 | TAG="$APP" 615 | VERSION="$VERSION" 616 | UPINFO="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|$REPO|$TAG|*x86_64.AppImage.zsync" 617 | 618 | ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ 619 | -u "$UPINFO" \ 620 | ./"$APP".AppDir "$APPNAME"_"$VERSION"-archimage4.2-x86_64.AppImage 621 | -------------------------------------------------------------------------------- /simple-scan3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | APP=simple-scan 4 | 5 | # CREATE A TEMPORARY DIRECTORY 6 | mkdir -p tmp 7 | cd tmp 8 | 9 | # DOWNLOADING THE DEPENDENCIES 10 | if test -f ./appimagetool; then 11 | echo " appimagetool already exists" 1> /dev/null 12 | else 13 | echo " Downloading appimagetool..." 14 | wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool 15 | fi 16 | if test -f ./pkg2appimage; then 17 | echo " pkg2appimage already exists" 1> /dev/null 18 | else 19 | echo " Downloading pkg2appimage..." 20 | wget -q "$(curl -Ls https://api.github.com/repos/AppImageCommunity/pkg2appimage/releases/latest | sed 's/[()",{} ]/\n/g' | grep -io "http.*x86_64.*appimage$" | head -1)" -O pkg2appimage 21 | fi 22 | chmod a+x ./appimagetool ./pkg2appimage 23 | rm -f ./recipe.yml 24 | 25 | # CREATING THE HEAD OF THE RECIPE 26 | echo "app: simple-scan 27 | binpatch: true 28 | 29 | ingredients: 30 | 31 | dist: oldoldstable 32 | sources: 33 | - deb http://ftp.debian.org/debian/ oldstable main contrib non-free 34 | - deb http://security.debian.org/debian-security/ oldstable-security main contrib non-free 35 | - deb http://ftp.debian.org/debian/ oldstable-updates main contrib non-free 36 | packages: 37 | - simple-scan" >> recipe.yml 38 | 39 | 40 | # DOWNLOAD ALL THE NEEDED PACKAGES AND COMPILE THE APPDIR 41 | ./pkg2appimage ./recipe.yml 42 | 43 | # COMPILE SCHEMAS 44 | glib-compile-schemas ./$APP/$APP.AppDir/usr/share/glib-2.0/schemas/ || echo "No ./usr/share/glib-2.0/schemas/" 45 | 46 | # CUSTOMIZE THE APPRUN 47 | rm -R -f ./$APP/$APP.AppDir/AppRun 48 | cat >> ./$APP/$APP.AppDir/AppRun << 'EOF' 49 | #!/bin/sh 50 | HERE="$(dirname "$(readlink -f "${0}")")" 51 | export UNION_PRELOAD=/:"${HERE}" 52 | export LD_LIBRARY_PATH=/lib/:/lib64/:/lib/x86_64-linux-gnu/:/usr/lib/:"${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${LD_LIBRARY_PATH}" 53 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}" 54 | export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${HERE}"/usr/lib/python*/:"${PYTHONPATH}" 55 | export PYTHONHOME="${HERE}"/usr/:"${HERE}"/usr/lib/python*/ 56 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 57 | export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}" 58 | export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}" 59 | export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}" 60 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 61 | exec ${EXEC} "$@" 62 | EOF 63 | 64 | # MADE THE APPRUN EXECUTABLE 65 | chmod a+x ./$APP/$APP.AppDir/AppRun 66 | # END OF THE PART RELATED TO THE APPRUN, NOW WE WELL SEE IF EVERYTHING WORKS ---------------------------------------------------------------------- 67 | 68 | # IMPORT THE LAUNCHER AND THE ICON TO THE APPDIR IF THEY NOT EXIST 69 | if test -f ./$APP/$APP.AppDir/*.desktop; then 70 | echo "The desktop file exists" 71 | else 72 | echo "Trying to get the .desktop file" 73 | cp ./$APP/$APP.AppDir/usr/share/applications/*$(ls . | grep -i $APP | cut -c -4)*desktop ./$APP/$APP.AppDir/ 2>/dev/null 74 | fi 75 | 76 | ICONNAME=$(cat ./$APP/$APP.AppDir/*desktop | grep "Icon=" | head -1 | cut -c 6-) 77 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/22x22/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 78 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/24x24/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 79 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/32x32/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 80 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/48x48/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 81 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/64x64/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 82 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/128x128/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 83 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/256x256/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 84 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/512x512/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 85 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/scalable/apps/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 86 | cp ./$APP/$APP.AppDir/usr/share/applications/*$ICONNAME* ./$APP/$APP.AppDir/ 2>/dev/null 87 | 88 | # UNCOMMENT THE FOLLOWING LINE TO REMOVE FILES IN "METAINFO" IN CASE OF ERRORS WITH "APPSTREAM" 89 | rm -R -f ./$APP/$APP.AppDir/usr/share/metainfo/* 90 | 91 | # EXPORT THE APP TO AN APPIMAGE 92 | ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 ./$APP/$APP.AppDir 93 | cd .. 94 | mv ./tmp/*.AppImage . 95 | chmod a+x *.AppImage 96 | -------------------------------------------------------------------------------- /simplescreenrecorder: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u 4 | APP=simplescreenrecorder 5 | 6 | # CREATE A TEMPORARY DIRECTORY 7 | mkdir -p tmp && cd tmp || exit 1 8 | 9 | # DOWNLOADING THE DEPENDENCIES 10 | if test -f ./appimagetool; then 11 | echo " appimagetool already exists" 1> /dev/null 12 | else 13 | echo " Downloading appimagetool..." 14 | wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool 15 | fi 16 | if test -f ./pkg2appimage; then 17 | echo " pkg2appimage already exists" 1> /dev/null 18 | else 19 | echo " Downloading pkg2appimage..." 20 | wget -q "$(curl -Ls https://api.github.com/repos/AppImageCommunity/pkg2appimage/releases/latest | sed 's/[()",{} ]/\n/g' | grep -io "http.*x86_64.*appimage$" | head -1)" -O pkg2appimage 21 | fi 22 | chmod a+x ./appimagetool ./pkg2appimage 23 | rm -f ./recipe.yml 24 | 25 | # CREATING THE HEAD OF THE RECIPE 26 | echo "app: $APP 27 | union: true 28 | 29 | ingredients: 30 | dist: trusty 31 | script: 32 | - wget https://github.com/tsujan/Kvantum/releases/download/V0.10.5/kvantum_0.10.5-ubuntuLTS_amd64.deb 33 | sources: 34 | - deb http://it.archive.ubuntu.com/ubuntu/ trusty main universe 35 | ppas: 36 | - maarten-baert/simplescreenrecorder 37 | packages: 38 | - $APP 39 | - kvantum" > recipe.yml 40 | 41 | 42 | # DOWNLOAD ALL THE NEEDED PACKAGES AND COMPILE THE APPDIR 43 | ./pkg2appimage ./recipe.yml 44 | 45 | # VERSION 46 | MAIN_DEB=$(find . -type f -name "$APP\_*.deb" | head -1 | sed 's:.*/::') 47 | if test -f ./"$APP"/"$MAIN_DEB"; then 48 | ar x ./"$APP"/"$MAIN_DEB" && tar xf ./control.tar.* && rm -f ./control.tar.* ./data.tar.* || exit 1 49 | VERSION=$(grep Version 0> ./"$APP"/"$APP".AppDir/AppRun << 'EOF' 64 | #!/bin/sh 65 | HERE="$(dirname "$(readlink -f "${0}")")" 66 | export UNION_PRELOAD="${HERE}" 67 | export LD_PRELOAD="${HERE}/libunionpreload.so" 68 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}" 69 | export LD_LIBRARY_PATH=/lib/:/lib64/:/usr/lib/:/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}" 70 | export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${PYTHONPATH}" 71 | export PYTHONHOME="${HERE}"/usr/ 72 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 73 | export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}" 74 | export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}" 75 | export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}" 76 | if test -d /usr/share/Kvantum; then 77 | export QT_STYLE_OVERRIDE=kvantum 78 | fi 79 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 80 | exec ${EXEC} "$@" 81 | EOF 82 | 83 | # MADE THE APPRUN EXECUTABLE 84 | chmod a+x ./"$APP"/"$APP".AppDir/AppRun 85 | # END OF THE PART RELATED TO THE APPRUN, NOW WE WELL SEE IF EVERYTHING WORKS ---------------------------------------------------------------------- 86 | 87 | # IMPORT THE LAUNCHER AND THE ICON TO THE APPDIR IF THEY NOT EXIST 88 | if test -f ./"$APP"/"$APP".AppDir/*.desktop; then 89 | echo "The desktop file exists" 90 | else 91 | echo "Trying to get the .desktop file" 92 | cp "./$APP/$APP.AppDir/usr/share/applications/*$(find . -type f -name "*$APP*.desktop" | head -1 | sed 's:.*/::')*" ./"$APP"/"$APP".AppDir/ 2>/dev/null 93 | fi 94 | 95 | # DEBLOAT 96 | rm -R -f ./"$APP"/"$APP".AppDir/usr/lib/x86_64-linux-gnu/qt5 97 | rm -R -f ./"$APP"/"$APP".AppDir/usr/lib/x86_64-linux-gnu/*Qt*so.5* 98 | strip --strip-debug ./"$APP"/"$APP".AppDir/usr/lib/* 99 | strip --strip-debug ./"$APP"/"$APP".AppDir/usr/lib/x86_64-linux-gnu/* 100 | strip --strip-unneeded ./"$APP"/"$APP".AppDir/usr/bin/* 101 | 102 | # EXPORT THE APP TO AN APPIMAGE 103 | printf '#!/bin/sh\nexit 0' > ./desktop-file-validate # hack due to https://github.com/AppImage/appimagetool/pull/47 104 | chmod a+x ./desktop-file-validate 105 | PATH="$PATH:$PWD" ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 ./"$APP"/"$APP".AppDir 106 | if ! test -f ./*.AppImage; then 107 | echo "No AppImage available."; exit 1 108 | fi 109 | cd .. && mv ./tmp/*.AppImage ./SimpleScreenRecorder-"$VERSION"-x86_64.AppImage && chmod a+x ./*.AppImage || exit 1 110 | -------------------------------------------------------------------------------- /webcamoid-junest.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | APP=webcamoid 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="libvlc" #SYNTAX: "APP1 APP2 APP3 APP4...", LEAVE BLANK IF NO OTHER DEPENDENCIES ARE NEEDED 6 | BASICSTUFF="binutils debugedit gzip jack2 qt6-multimedia" 7 | COMPILERS="base-devel" 8 | 9 | ############################################################################# 10 | # KEYWORDS TO FIND AND SAVE WHEN COMPILING THE APPIMAGE 11 | ############################################################################# 12 | 13 | BINSAVED="gst" 14 | SHARESAVED="alsa" 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="libproxy libxcb qt libuuid libpulsecommon libjack.so Multimedia libGLX \ 18 | libLLVM libsensors.so libxshmfence.so libdrm libsodium.so libsoxr.so libglslang-default-resource-limits.so vlc vdpau libSDL $lib_audio_keywords $lib_browser_launcher" 19 | 20 | [ -n "$lib_browser_launcher" ] && DEPENDENCES="$DEPENDENCES xapp hicolor-icon-theme" 21 | 22 | ############################################################################# 23 | # SETUP THE ENVIRONMENT 24 | ############################################################################# 25 | 26 | # Download appimagetool 27 | if [ ! -f ./appimagetool ]; then 28 | echo "-----------------------------------------------------------------------------" 29 | echo "◆ Downloading \"appimagetool\" from https://github.com/AppImage/appimagetool" 30 | echo "-----------------------------------------------------------------------------" 31 | curl -#Lo appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage && chmod a+x appimagetool 32 | fi 33 | 34 | # Create and enter the AppDir 35 | mkdir -p "$APP".AppDir archlinux && cd archlinux || exit 1 36 | 37 | # Set archlinux as a temporary $HOME directory 38 | HOME="$(dirname "$(readlink -f "$0")")" 39 | 40 | ############################################################################# 41 | # DOWNLOAD, INSTALL AND CONFIGURE JUNEST 42 | ############################################################################# 43 | 44 | _enable_multilib() { 45 | printf "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> ./.junest/etc/pacman.conf 46 | } 47 | 48 | _enable_chaoticaur() { 49 | # This function is ment to be used during the installation of JuNest, see "_pacman_patches" 50 | ./.local/share/junest/bin/junest -- sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com 51 | ./.local/share/junest/bin/junest -- sudo pacman-key --lsign-key 3056513887B78AEB 52 | ./.local/share/junest/bin/junest -- sudo pacman-key --populate chaotic 53 | ./.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' 54 | printf "\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist" >> ./.junest/etc/pacman.conf 55 | } 56 | 57 | _enable_archlinuxcn() { 58 | ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -U "https://repo.archlinuxcn.org/x86_64/$(curl -Ls https://repo.archlinuxcn.org/x86_64/ | tr '"' '\n' | grep "^archlinuxcn-keyring.*zst$" | tail -1)" 59 | printf "\n[archlinuxcn]\n#SigLevel = Never\nServer = http://repo.archlinuxcn.org/\$arch" >> ./.junest/etc/pacman.conf 60 | } 61 | 62 | _custom_mirrorlist() { 63 | COUNTRY=$(curl -i ipinfo.io 2>/dev/null | grep country | cut -c 15- | cut -c -2) 64 | if [ -n "$GITHUB_REPOSITORY_OWNER" ] || ! curl --output /dev/null --silent --head --fail "https://archlinux.org/mirrorlist/?country=$COUNTRY" 1>/dev/null; then 65 | curl -Ls https://archlinux.org/mirrorlist/all | awk NR==2 RS= | sed 's/#Server/Server/g' > ./.junest/etc/pacman.d/mirrorlist 66 | else 67 | curl -Ls "https://archlinux.org/mirrorlist/?country=$COUNTRY" | sed 's/#Server/Server/g' > ./.junest/etc/pacman.d/mirrorlist 68 | fi 69 | } 70 | 71 | _bypass_signature_check_level() { 72 | sed -i 's/#SigLevel/SigLevel/g; s/Required DatabaseOptional/Never/g' ./.junest/etc/pacman.conf 73 | } 74 | 75 | _install_junest() { 76 | echo "-----------------------------------------------------------------------------" 77 | echo "◆ Clone JuNest from https://github.com/fsquillace/junest" 78 | echo "-----------------------------------------------------------------------------" 79 | git clone https://github.com/fsquillace/junest.git ./.local/share/junest 80 | echo "-----------------------------------------------------------------------------" 81 | echo "◆ Downloading JuNest archive from https://github.com/ivan-hc/junest" 82 | echo "-----------------------------------------------------------------------------" 83 | curl -#Lo junest-x86_64.tar.gz https://github.com/ivan-hc/junest/releases/download/continuous/junest-x86_64.tar.gz 84 | ./.local/share/junest/bin/junest setup -i junest-x86_64.tar.gz 85 | rm -f junest-x86_64.tar.gz 86 | echo " Apply patches to PacMan..." 87 | #_enable_multilib 88 | _enable_chaoticaur 89 | #_enable_archlinuxcn 90 | _custom_mirrorlist 91 | _bypass_signature_check_level 92 | 93 | # Update arch linux in junest 94 | ./.local/share/junest/bin/junest -- sudo pacman -Syy 95 | ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -Syu 96 | } 97 | 98 | if ! test -d "$HOME/.local/share/junest"; then 99 | echo "-----------------------------------------------------------------------------" 100 | echo " DOWNLOAD, INSTALL AND CONFIGURE JUNEST" 101 | echo "-----------------------------------------------------------------------------" 102 | _install_junest 103 | else 104 | echo "-----------------------------------------------------------------------------" 105 | echo " RESTART JUNEST" 106 | echo "-----------------------------------------------------------------------------" 107 | fi 108 | 109 | ############################################################################# 110 | # INSTALL PROGRAMS USING YAY 111 | ############################################################################# 112 | 113 | ./.local/share/junest/bin/junest -- yay -Syy 114 | ./.local/share/junest/bin/junest -- gpg --keyserver keyserver.ubuntu.com --recv-key C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF # UNCOMMENT IF YOU USE THE AUR 115 | if [ -n "$BASICSTUFF" ]; then 116 | ./.local/share/junest/bin/junest -- yay --noconfirm -S $BASICSTUFF 117 | fi 118 | if [ -n "$COMPILERS" ]; then 119 | ./.local/share/junest/bin/junest -- yay --noconfirm -S $COMPILERS 120 | fi 121 | if [ -n "$DEPENDENCES" ]; then 122 | ./.local/share/junest/bin/junest -- yay --noconfirm -S $DEPENDENCES 123 | fi 124 | if [ -n "$APP" ]; then 125 | ./.local/share/junest/bin/junest -- yay --noconfirm -S alsa-lib gtk3 xapp 126 | ./.local/share/junest/bin/junest -- yay --noconfirm -S "$APP" 127 | ./.local/share/junest/bin/junest -- glib-compile-schemas /usr/share/glib-2.0/schemas/ 128 | else 129 | echo "No app found, exiting"; exit 1 130 | fi 131 | 132 | cd .. 133 | 134 | echo "" 135 | echo "-----------------------------------------------------------------------------" 136 | echo " CREATING THE APPDIR" 137 | echo "-----------------------------------------------------------------------------" 138 | echo "" 139 | 140 | # Set locale 141 | rm -f archlinux/.junest/etc/locale.conf 142 | sed -i 's/LANG=${LANG:-C}/LANG=$LANG/g' archlinux/.junest/etc/profile.d/locale.sh 143 | 144 | # Add launcher and icon 145 | rm -f ./*.desktop 146 | LAUNCHER=$(grep -iRl "$BIN" archlinux/.junest/usr/share/applications/* | grep ".desktop" | head -1) 147 | cp -r "$LAUNCHER" "$APP".AppDir/ 148 | ICON=$(cat "$LAUNCHER" | grep "Icon=" | cut -c 6-) 149 | [ -z "$ICON" ] && ICON="$BIN" 150 | cp -r archlinux/.junest/usr/share/icons/*"$ICON"* "$APP".AppDir/ 2>/dev/null 151 | cp -r archlinux/.junest/usr/share/icons/hicolor/22x22/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 152 | cp -r archlinux/.junest/usr/share/icons/hicolor/24x24/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 153 | cp -r archlinux/.junest/usr/share/icons/hicolor/32x32/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 154 | cp -r archlinux/.junest/usr/share/icons/hicolor/48x48/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 155 | cp -r archlinux/.junest/usr/share/icons/hicolor/64x64/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 156 | cp -r archlinux/.junest/usr/share/icons/hicolor/128x128/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 157 | cp -r archlinux/.junest/usr/share/icons/hicolor/192x192/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 158 | cp -r archlinux/.junest/usr/share/icons/hicolor/256x256/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 159 | cp -r archlinux/.junest/usr/share/icons/hicolor/512x512/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 160 | cp -r archlinux/.junest/usr/share/icons/hicolor/scalable/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 161 | cp -r archlinux/.junest/usr/share/pixmaps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 162 | 163 | # Test if the desktop file and the icon are in the root of the future appimage (./*appdir/*) 164 | if test -f "$APP".AppDir/*.desktop; then 165 | echo "◆ The .desktop file is available in $APP.AppDir/" 166 | elif test -f archlinux/.junest/usr/bin/"$BIN"; then 167 | echo "◆ No .desktop file available for $APP, creating a new one" 168 | cat <<-HEREDOC >> "$APP".AppDir/"$APP".desktop 169 | [Desktop Entry] 170 | Version=1.0 171 | Type=Application 172 | Name=$(echo "$APP" | tr '[:lower:]' '[:upper:]') 173 | Comment= 174 | Exec=$BIN 175 | Icon=tux 176 | Categories=Utility; 177 | Terminal=true 178 | StartupNotify=true 179 | HEREDOC 180 | curl -Lo "$APP".AppDir/tux.png https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/favicon.ico 2>/dev/null 181 | else 182 | echo "No binary in path... aborting all the processes." 183 | exit 0 184 | fi 185 | 186 | if [ ! -d "$APP".AppDir/.local ]; then 187 | mkdir -p "$APP".AppDir/.local 188 | rsync -av archlinux/.local/ "$APP".AppDir/.local/ | echo "◆ Rsync .local directory to the AppDir" 189 | # Made JuNest a portable app and remove "read-only file system" errors 190 | sed -i 's#${JUNEST_HOME}/usr/bin/junest_wrapper#${HOME}/.cache/junest_wrapper.old#g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 191 | 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 192 | sed -i 's/ln/#ln/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 193 | sed -i 's/rm -f "$file"/test -f "$file"/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 194 | 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 195 | fi 196 | 197 | echo "◆ Rsync .junest directories structure to the AppDir" 198 | rm -Rf "$APP".AppDir/.junest/* 199 | archdirs=$(find archlinux/.junest -type d | sed 's/^archlinux\///g') 200 | for d in $archdirs; do 201 | mkdir -p "$APP".AppDir/"$d" 202 | done 203 | symlink_dirs=" bin sbin lib lib64 usr/sbin usr/lib64" 204 | for l in $symlink_dirs; do 205 | cp -r archlinux/.junest/"$l" "$APP".AppDir/.junest/"$l" 206 | done 207 | 208 | rsync -av archlinux/.junest/usr/bin_wrappers/ "$APP".AppDir/.junest/usr/bin_wrappers/ | echo "◆ Rsync bin_wrappers to the AppDir" 209 | rsync -av archlinux/.junest/etc/* "$APP".AppDir/.junest/etc/ | echo "◆ Rsync /etc" 210 | 211 | ############################################################################# 212 | # APPRUN 213 | ############################################################################# 214 | 215 | rm -f "$APP".AppDir/AppRun 216 | cat <<-'HEREDOC' >> "$APP".AppDir/AppRun 217 | #!/bin/sh 218 | HERE="$(dirname "$(readlink -f "$0")")" 219 | export UNION_PRELOAD="$HERE" 220 | export JUNEST_HOME="$HERE"/.junest 221 | 222 | if command -v unshare >/dev/null 2>&1 && ! unshare --user -p /bin/true >/dev/null 2>&1; then 223 | PROOT_ON=1 224 | export PATH="$HERE"/.local/share/junest/bin/:"$PATH" 225 | mkdir -p "$HOME"/.cache 226 | else 227 | export PATH="$PATH":"$HERE"/.local/share/junest/bin 228 | fi 229 | 230 | [ -z "$NVIDIA_ON" ] && NVIDIA_ON=1 231 | if [ "$NVIDIA_ON" = 1 ]; then 232 | DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}" 233 | CONTY_DIR="${DATADIR}/Conty/overlayfs_shared" 234 | [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)" 235 | if [ -n "$nvidia_driver_version" ]; then 236 | mkdir -p "${CONTY_DIR}"/nvidia "${CONTY_DIR}"/up/usr/lib "${CONTY_DIR}"/up/usr/share 237 | nvidia_data_dirs="egl glvnd nvidia vulkan" 238 | 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 239 | [ ! -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 240 | [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty=$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version) 241 | if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then 242 | rm -f "${CONTY_DIR}"/up/usr/lib/*; echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 243 | fi 244 | /sbin/ldconfig -p > "${CONTY_DIR}"/nvidia/host_libs 245 | grep -i "nvidia\|libcuda" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2 > "${CONTY_DIR}"/nvidia/host_nvidia_libs 246 | libnv_paths=$(grep "libnv" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2) 247 | for f in $libnv_paths; do strings "${f}" | grep -qi -m 1 "nvidia" && echo "${f}" >> "${CONTY_DIR}"/nvidia/host_nvidia_libs; done 248 | nvidia_libs=$(cat "${CONTY_DIR}"/nvidia/host_nvidia_libs) 249 | 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 250 | libvdpau_nvidia="${CONTY_DIR}/up/usr/lib/libvdpau_nvidia.so" 251 | 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 252 | [ -f "${libvdpau_nvidia}"."${nvidia_driver_version}" ] && [ ! -f "${libvdpau_nvidia}" ] && ln -s "${libvdpau_nvidia}"."${nvidia_driver_version}" "${libvdpau_nvidia}" 253 | [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}" 254 | [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}" 255 | fi 256 | fi 257 | 258 | PROOT_BINDINGS="" 259 | BWRAP_BINDINGS="" 260 | 261 | bind_files="/etc/resolv.conf /etc/hosts /etc/nsswitch.conf /etc/passwd /etc/group /etc/machine-id /etc/asound.conf /etc/localtime " 262 | for f in $bind_files; do [ -f "$f" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$f" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --ro-bind-try $f $f"; done 263 | 264 | bind_dirs=" /media /mnt /opt /run/media /usr/lib/locale /usr/share/fonts /usr/share/themes /var" 265 | for d in $bind_dirs; do [ -d "$d" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$d" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --bind-try $d $d"; done 266 | 267 | PROOT_BINDS=" --bind=/dev --bind=/sys --bind=/tmp --bind=/proc $PROOT_BINDINGS --bind=/home --bind=/home/$USER " 268 | BWRAP_BINDS=" --dev-bind /dev /dev --ro-bind /sys /sys --bind-try /tmp /tmp --proc /proc $BWRAP_BINDINGS " 269 | 270 | _JUNEST_CMD() { 271 | if [ "$PROOT_ON" = 1 ]; then 272 | "$HERE"/.local/share/junest/bin/junest proot -n -b "$PROOT_BINDS" "$@" 273 | else 274 | "$HERE"/.local/share/junest/bin/junest -n -b "$BWRAP_BINDS" "$@" 275 | fi 276 | } 277 | 278 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 279 | 280 | _JUNEST_CMD -- /usr/bin/$EXEC "$@" 281 | 282 | HEREDOC 283 | chmod a+x "$APP".AppDir/AppRun 284 | 285 | ############################################################################# 286 | # EXTRACT PACKAGES 287 | ############################################################################# 288 | 289 | [ -z "$extraction_count" ] && extraction_count=0 290 | [ ! -f ./autodeps ] && echo "$extraction_count" > ./autodeps 291 | [ -f ./autodeps ] && autodeps=$(cat ./autodeps) 292 | [ "$autodeps" != "$extraction_count" ] && rm -Rf ./deps ./packages && echo "$extraction_count" > ./autodeps 293 | 294 | [ ! -f ./userdeps ] && echo "$DEPENDENCES" > ./userdeps 295 | [ -f ./userdeps ] && userdeps=$(cat ./userdeps) 296 | [ "$userdeps" != "$DEPENDENCES" ] && rm -Rf ./deps ./packages && echo "$DEPENDENCES" > ./userdeps 297 | 298 | _extract_main_package() { 299 | mkdir -p base 300 | rm -Rf ./base/* 301 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 302 | if [ "$(echo "$pkg_full_path" | wc -l)" = 1 ]; then 303 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 304 | else 305 | for p in $pkg_full_path; do 306 | if tar fx "$p" .PKGINFO -O | grep -q "pkgname = $APP$"; then 307 | pkg_full_path="$p" 308 | fi 309 | done 310 | fi 311 | [ -z "$pkg_full_path" ] && echo "💀 ERROR: no package found for \"$APP\", operation aborted!" && exit 0 312 | tar fx "$pkg_full_path" -C ./base/ 313 | VERSION=$(cat ./base/.PKGINFO | grep pkgver | cut -c 10- | sed 's@.*:@@') 314 | mkdir -p deps 315 | } 316 | 317 | _download_missing_packages() { 318 | localpackage=$(find ./archlinux -name "$arg-[0-9]*zst") 319 | if ! test -f "$localpackage"; then 320 | ./archlinux/.local/share/junest/bin/junest -- yay --noconfirm -Sw "$arg" 321 | fi 322 | } 323 | 324 | _extract_package() { 325 | _download_missing_packages &> /dev/null 326 | pkg_full_path=$(find ./archlinux -name "$arg-[0-9]*zst") 327 | pkgname=$(echo "$pkg_full_path" | sed 's:.*/::') 328 | [ ! -f ./packages ] && rm -Rf ./deps/* && touch ./packages 329 | if [ -z "$( ls -A './deps' )" ]; then 330 | rm -f ./packages 331 | echo "" 332 | echo "-----------------------------------------------------------------------------" 333 | echo " EXTRACTING PACKAGES" 334 | echo "-----------------------------------------------------------------------------" 335 | echo "" 336 | fi 337 | if test -f "$pkg_full_path"; then 338 | if ! grep -q "$pkgname" ./packages 2>/dev/null;then 339 | echo "◆ Extracting $pkgname" 340 | tar fx "$pkg_full_path" -C ./deps/ --warning=no-unknown-keyword 341 | echo "$pkgname" >> ./packages 342 | fi 343 | [ -n "$lib_browser_launcher" ] && [[ "$arg" =~ (hicolor-icon-theme|xapp|v4l-utils|gstreamer|ffmpeg) ]] && tar fx "$pkg_full_path" -C ./base/ --warning=no-unknown-keyword --exclude='.PKGINFO' 344 | fi 345 | } 346 | 347 | _determine_packages_and_libraries() { 348 | if echo "$arg" | grep -q "\.so"; then 349 | LIBSAVED="$LIBSAVED $arg" 350 | 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 351 | _extract_package 352 | cat ./deps/.PKGINFO 2>/dev/null | grep "^depend = " | cut -c 10- | sed 's/=.*//' >> depdeps 353 | rm -f ./deps/.* 354 | fi 355 | } 356 | 357 | _extract_deps() { 358 | DEPS=$(sort -u ./depdeps) 359 | for arg in $DEPS; do 360 | _determine_packages_and_libraries 361 | done 362 | } 363 | 364 | _extract_all_dependences() { 365 | rm -f ./depdeps 366 | 367 | OPTDEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^optdepend = " | sed 's/optdepend = //g' | sed 's/=.*//' | sed 's/:.*//') 368 | for arg in $OPTDEPS; do 369 | _determine_packages_and_libraries 370 | done 371 | [ -f ./depdeps ] && _extract_deps 372 | rm -f ./depdeps 373 | 374 | ARGS=$(echo "$DEPENDENCES" | tr " " "\n") 375 | for arg in $ARGS; do 376 | _determine_packages_and_libraries 377 | done 378 | 379 | DEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^depend = " | sed 's/depend = //g' | sed 's/=.*//') 380 | for arg in $DEPS; do 381 | _determine_packages_and_libraries 382 | done 383 | 384 | # Set the level of sub-dependencies extraction, the higher the number, the bigger the AppImage will be 385 | if [ "$extraction_count" != 0 ]; then 386 | for e in $(seq "$extraction_count"); do _extract_deps; done 387 | fi 388 | } 389 | 390 | _extract_main_package 391 | _extract_all_dependences 392 | 393 | echo "" 394 | echo "-----------------------------------------------------------------------------" 395 | echo " IMPLEMENTING NECESSARY LIBRARIES (MAY TAKE SEVERAL MINUTES)" 396 | echo "-----------------------------------------------------------------------------" 397 | echo "" 398 | 399 | # Save files in /usr/bin 400 | _savebins() { 401 | echo "◆ Saving files in /usr/bin" 402 | cp -r ./archlinux/.junest/usr/bin/bwrap ./"$APP".AppDir/.junest/usr/bin/ 403 | cp -r ./archlinux/.junest/usr/bin/proot* ./"$APP".AppDir/.junest/usr/bin/ 404 | cp -r ./archlinux/.junest/usr/bin/*$BIN* ./"$APP".AppDir/.junest/usr/bin/ 405 | 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" 406 | utils_bin="awk bash $coreutils gawk gio grep ld ldd sed sh strings xdg-open" 407 | for b in $utils_bin; do 408 | cp -r ./archlinux/.junest/usr/bin/"$b" ./"$APP".AppDir/.junest/usr/bin/ 409 | done 410 | for arg in $BINSAVED; do 411 | cp -r ./archlinux/.junest/usr/bin/*"$arg"* ./"$APP".AppDir/.junest/usr/bin/ 412 | done 413 | } 414 | 415 | # Save files in /usr/lib 416 | _savelibs() { 417 | echo "◆ Detect libraries related to /usr/bin files" 418 | libs4bin=$(readelf -d ./"$APP".AppDir/.junest/usr/bin/* 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so") 419 | 420 | echo "◆ Saving JuNest core libraries" 421 | cp -r ./archlinux/.junest/usr/lib/ld-linux-x86-64.so* ./"$APP".AppDir/.junest/usr/lib/ 422 | lib_preset="$APP $BIN gconv libdw libelf libresolv.so libtinfo.so $libs4bin" 423 | LIBSAVED="$lib_preset $LIBSAVED $SHARESAVED" 424 | for arg in $LIBSAVED; do 425 | LIBPATHS="$LIBPATHS $(find ./archlinux/.junest/usr/lib -maxdepth 20 -wholename "*$arg*" | sed 's/\.\/archlinux\///g')" 426 | done 427 | for arg in $LIBPATHS; do 428 | [ ! -d "$APP".AppDir/"$arg" ] && cp -r ./archlinux/"$arg" "$APP".AppDir/"$arg" & 429 | done 430 | wait 431 | core_libs=$(find ./"$APP".AppDir -type f) 432 | lib_core=$(for c in $core_libs; do readelf -d "$c" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 433 | 434 | echo "◆ Detect libraries of the main package" 435 | base_libs=$(find ./base -type f | uniq) 436 | lib_base_0=$(for b in $base_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 437 | 438 | echo "◆ Detect libraries of the dependencies" 439 | dep_libs=$(find ./deps -executable -name "*.so*") 440 | lib_deps=$(for d in $dep_libs; do readelf -d "$d" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 441 | 442 | echo "◆ Detect and copy base libs" 443 | basebin_libs=$(find ./base -executable -name "*.so*") 444 | lib_base_1=$(for b in $basebin_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 445 | lib_base_1=$(echo "$lib_base_1" | tr ' ' '\n' | sort -u | xargs) 446 | 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) 447 | lib_base_2=$(echo "$lib_base_2" | tr ' ' '\n' | sort -u | xargs) 448 | 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) 449 | lib_base_3=$(echo "$lib_base_3" | tr ' ' '\n' | sort -u | xargs) 450 | 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) 451 | lib_base_4=$(echo "$lib_base_4" | tr ' ' '\n' | sort -u | xargs) 452 | 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) 453 | lib_base_5=$(echo "$lib_base_5" | tr ' ' '\n' | sort -u | xargs) 454 | 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) 455 | lib_base_6=$(echo "$lib_base_6" | tr ' ' '\n' | sort -u | xargs) 456 | 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) 457 | lib_base_7=$(echo "$lib_base_7" | tr ' ' '\n' | sort -u | xargs) 458 | 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) 459 | lib_base_8=$(echo "$lib_base_8" | tr ' ' '\n' | sort -u | xargs) 460 | 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) 461 | lib_base_9=$(echo "$lib_base_9" | tr ' ' '\n' | sort -u | xargs) 462 | 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" 463 | lib_base_libs=$(echo "$lib_base_libs" | tr ' ' '\n' | sort -u | sed 's/.so.*/.so/' | xargs) 464 | for l in $lib_base_libs; do 465 | rsync -av ./archlinux/.junest/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 466 | done 467 | wait 468 | for l in $lib_base_libs; do 469 | rsync -av ./deps/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 470 | done 471 | wait 472 | } 473 | 474 | # Save files in /usr/share 475 | _saveshare() { 476 | echo "◆ Saving directories in /usr/share" 477 | SHARESAVED="$SHARESAVED $APP $BIN fontconfig glib- locale mime wayland X11" 478 | for arg in $SHARESAVED; do 479 | cp -r ./archlinux/.junest/usr/share/*"$arg"* ./"$APP".AppDir/.junest/usr/share/ 480 | done 481 | } 482 | 483 | _savebins 2>/dev/null 484 | _savelibs 2>/dev/null 485 | _saveshare 2>/dev/null 486 | 487 | echo "" 488 | echo "-----------------------------------------------------------------------------" 489 | echo " ASSEMBLING THE APPIMAGE" 490 | echo "-----------------------------------------------------------------------------" 491 | echo "" 492 | 493 | _rsync_main_package() { 494 | rm -Rf ./base/.* 495 | rsync -av ./base/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync the content of the \"$APP\" package" 496 | } 497 | 498 | _rsync_dependences() { 499 | rm -Rf ./deps/.* 500 | chmod -R 777 ./deps/* 501 | #rsync -av ./deps/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync all dependencies, please wait" 502 | } 503 | 504 | _rsync_main_package 505 | _rsync_dependences 506 | 507 | ############################################################################# 508 | # REMOVE BLOATWARES, ENABLE MOUNTPOINTS 509 | ############################################################################# 510 | 511 | _remove_more_bloatwares() { 512 | etc_remove="makepkg.conf pacman" 513 | for r in $etc_remove; do 514 | rm -Rf ./"$APP".AppDir/.junest/etc/"$r"* 515 | done 516 | bin_remove="gcc" 517 | for r in $bin_remove; do 518 | rm -Rf ./"$APP".AppDir/.junest/usr/bin/"$r"* 519 | done 520 | lib_remove="gcc" 521 | for r in $lib_remove; do 522 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/"$r"* 523 | done 524 | share_remove="gcc" 525 | for r in $share_remove; do 526 | rm -Rf ./"$APP".AppDir/.junest/usr/share/"$r"* 527 | done 528 | echo Y | rm -Rf ./"$APP".AppDir/.cache/yay/* 529 | 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 530 | find ./"$APP".AppDir/.junest/usr/share/locale/*/*/* -not -iname "*$BIN*" -a -not -name "." -delete 2> /dev/null #REMOVE ALL ADDITIONAL LOCALE FILES 531 | rm -Rf ./"$APP".AppDir/.junest/home # remove the inbuilt home 532 | rm -Rf ./"$APP".AppDir/.junest/usr/include # files related to the compiler 533 | rm -Rf ./"$APP".AppDir/.junest/usr/share/man # AppImages are not ment to have man command 534 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/python*/__pycache__/* # if python is installed, removing this directory can save several megabytes 535 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgallium* 536 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgo.so* 537 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/libLLVM* # included in the compilation phase, can sometimes be excluded for daily use 538 | rm -Rf ./"$APP".AppDir/.junest/var/* # remove all packages downloaded with the package manager 539 | } 540 | 541 | _enable_mountpoints_for_the_inbuilt_bubblewrap() { 542 | mkdir -p ./"$APP".AppDir/.junest/home 543 | mkdir -p ./"$APP".AppDir/.junest/media 544 | mkdir -p ./"$APP".AppDir/.junest/usr/lib/locale 545 | mkdir -p ./"$APP".AppDir/.junest/usr/share/fonts 546 | mkdir -p ./"$APP".AppDir/.junest/usr/share/themes 547 | mkdir -p ./"$APP".AppDir/.junest/run/media 548 | mkdir -p ./"$APP".AppDir/.junest/run/user 549 | rm -f ./"$APP".AppDir/.junest/etc/localtime && touch ./"$APP".AppDir/.junest/etc/localtime 550 | [ ! -f ./"$APP".AppDir/.junest/etc/asound.conf ] && touch ./"$APP".AppDir/.junest/etc/asound.conf 551 | } 552 | 553 | _remove_more_bloatwares 554 | find ./"$APP".AppDir/.junest/usr/lib ./"$APP".AppDir/.junest/usr/lib32 -type f -regex '.*\.a' -exec rm -f {} \; 2>/dev/null 555 | find ./"$APP".AppDir/.junest/usr -type f -regex '.*\.so.*' -exec strip --strip-debug {} \; 556 | find ./"$APP".AppDir/.junest/usr/bin -type f ! -regex '.*\.so.*' -exec strip --strip-unneeded {} \; 557 | find ./"$APP".AppDir/.junest/usr -type d -empty -delete 558 | _enable_mountpoints_for_the_inbuilt_bubblewrap 559 | 560 | ############################################################################# 561 | # CREATE THE APPIMAGE 562 | ############################################################################# 563 | 564 | if test -f ./*.AppImage; then rm -Rf ./*archimage*.AppImage; fi 565 | 566 | APPNAME=$(cat ./"$APP".AppDir/*.desktop | grep 'Name=' | head -1 | cut -c 6- | sed 's/ /-/g') 567 | REPO="Database-of-pkg2appimaged-packages" 568 | TAG="webcamoid" 569 | VERSION="$VERSION" 570 | UPINFO="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|$REPO|$TAG|*x86_64.AppImage.zsync" 571 | 572 | ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ 573 | -u "$UPINFO" \ 574 | ./"$APP".AppDir "$APPNAME"_"$VERSION"-archimage4.3-x86_64.AppImage 575 | --------------------------------------------------------------------------------