├── latest-release.txt ├── .github ├── FUNDING.yml └── workflows │ ├── cronjob.yml │ └── CI.yml ├── README.md ├── legacy ├── ppa-based │ └── obs-studio-ppa.sh └── junest-based │ ├── obs-junest.sh │ └── obs-full-junest.sh └── obs-studio-all-junest.sh /latest-release.txt: -------------------------------------------------------------------------------- 1 | Sun Dec 21 01:42:02 UTC 2025 2 | -------------------------------------------------------------------------------- /.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/cronjob.yml: -------------------------------------------------------------------------------- 1 | name: Github Action with a cronjob trigger 2 | on: 3 | schedule: 4 | - cron: "0 0 1/10 * *" 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@v6 22 | 23 | - name: "Release date" 24 | run: | 25 | date > 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/CI.yml: -------------------------------------------------------------------------------- 1 | name: OBS Studio Appimage 2 | concurrency: 3 | group: build-${{ github.ref }} 4 | cancel-in-progress: true 5 | 6 | on: 7 | schedule: 8 | - cron: "0 6 * * 6" 9 | workflow_dispatch: 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v6 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 ./obs-studio-all-junest.sh 24 | ./obs-studio-all-junest.sh 25 | mkdir dist 26 | mv *AppImage* dist/ 27 | 28 | - name: Upload artifact 29 | uses: actions/upload-artifact@v4.4.0 30 | with: 31 | name: OBS-Studio-x86_64.AppImage 32 | path: 'dist' 33 | 34 | release: 35 | needs: [build] 36 | permissions: write-all 37 | runs-on: ubuntu-latest 38 | 39 | steps: 40 | - uses: actions/download-artifact@v4.1.8 41 | with: 42 | name: OBS-Studio-x86_64.AppImage 43 | 44 | # Snapshot Release 45 | - name: get date 46 | run: | 47 | SNAPSHOT_TAG="$(date --utc +'%Y%m%d-%H%M%S')" 48 | echo SNAPSHOT_TAG="${SNAPSHOT_TAG}" >> "${GITHUB_ENV}" 49 | continue-on-error: false 50 | - name: create snapshot 51 | uses: softprops/action-gh-release@v2 52 | with: 53 | name: "Snapshot ${{ env.SNAPSHOT_TAG}}" 54 | tag_name: "${{ env.SNAPSHOT_TAG}}" 55 | prerelease: false 56 | draft: false 57 | generate_release_notes: false 58 | make_latest: false 59 | files: | 60 | *.AppImage* 61 | continue-on-error: false 62 | 63 | # Continuous release 64 | - name: release 65 | uses: marvinpinto/action-automatic-releases@latest 66 | with: 67 | title: Continuous build 68 | automatic_release_tag: continuous 69 | prerelease: false 70 | draft: false 71 | files: | 72 | *.AppImage* 73 | repo_token: ${{ secrets.GITHUB_TOKEN }} 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository creates and distributes the unofficial Appimage of OBS Studio built on top of JuNest, the lightweight Arch Linux based distro that runs, without root privileges, on top of any other Linux distro. 2 | 3 | Sinc of October 2, 2025, the two builds are based on the "obs-studio-stable" package in ChaoticAUR and are both available at "[continuous](https://github.com/ivan-hc/OBS-Studio-appimage/releases/tag/continuous)" or "[latest](https://github.com/ivan-hc/OBS-Studio-appimage/releases/latest)" tag: 4 | - **Full** (`full`) build includes libcef and then browser support 5 | - **Lite** (`lite`) build instead has not such library and is about 100 MB smaller (compressed, while extracted is more than 300 MB smaller). 6 | 7 | Choose which one is right for you. 8 | 9 | Weekly snapshots are also available among the other [releases](https://github.com/ivan-hc/OBS-Studio-appimage/releases). 10 | 11 | ## Credits 12 | - JuNest https://github.com/fsquillace/junest 13 | - ArchImage https://github.com/ivan-hc/ArchImage 14 | 15 | ------------------------------------------------------------------------ 16 | 17 | ## Install and update it with ease 18 | 19 | ### *"*AM*" Application Manager* 20 | #### *Package manager, database & solutions for all AppImages and portable apps for GNU/Linux!* 21 | 22 | [![sample.png](https://raw.githubusercontent.com/ivan-hc/AM/main/sample/sample.png)](https://github.com/ivan-hc/AM) 23 | 24 | [![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) 25 | 26 | *"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.* 27 | 28 | *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).* 29 | 30 | *"AM"/"AppMan" aims to be the default package manager for all AppImage packages, giving them a home to stay.* 31 | 32 | *You can consult the entire **list of managed apps** at [**portable-linux-apps.github.io/apps**](https://portable-linux-apps.github.io/apps).* 33 | 34 | ## *Go to *https://github.com/ivan-hc/AM* for more!* 35 | 36 | ------------------------------------------------------------------------ 37 | 38 | | [***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) | 39 | | - | - | - | - | 40 | 41 | ------------------------------------------------------------------------ 42 | -------------------------------------------------------------------------------- /legacy/ppa-based/obs-studio-ppa.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | APP=obs-studio 4 | 5 | mkdir -p tmp 6 | cd tmp 7 | 8 | # DOWNLOADING THE DEPENDENCIES 9 | if test -f ./appimagetool; then 10 | echo " appimagetool already exists" 1> /dev/null 11 | else 12 | echo " Downloading appimagetool..." 13 | wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool 14 | fi 15 | if test -f ./pkg2appimage; then 16 | echo " pkg2appimage already exists" 1> /dev/null 17 | else 18 | echo " Downloading pkg2appimage..." 19 | wget -q https://raw.githubusercontent.com/ivan-hc/AM-application-manager/main/tools/pkg2appimage 20 | fi 21 | chmod a+x ./appimagetool ./pkg2appimage 22 | 23 | # CREATING THE APPIMAGE: APPDIR FROM A RECIPE... 24 | 25 | PREVIOUSLTS=$(wget -q https://releases.ubuntu.com/ -O - | grep class | grep LTS | grep -m2 href | tail -n1 | sed -n 's/.*href="\([^"]*\).*/\1/p' | rev| cut -c 2- | rev) 26 | DEB=$(wget -q https://ppa.launchpadcontent.net/obsproject/obs-studio/ubuntu/pool/main/o/obs-studio/ -O - | grep $PREVIOUSLTS | grep amd64.deb | grep -o -P '(?<=href=").*(?=">obs)') 27 | wget https://ppa.launchpadcontent.net/obsproject/obs-studio/ubuntu/pool/main/o/obs-studio/$DEB 28 | ar x ./*.deb 29 | tar fx ./control.tar.xz 30 | 31 | mkdir -p $APP 32 | mv ./$DEB ./$APP/ 33 | 34 | # ...COMPILE THE RECIPE... 35 | rm -f ./recipe.yml 36 | echo "app: $APP 37 | binpatch: true 38 | ingredients: 39 | dist: $PREVIOUSLTS 40 | sources: 41 | - deb http://archive.ubuntu.com/ubuntu/ $PREVIOUSLTS main universe restricted multiverse 42 | - deb http://archive.ubuntu.com/ubuntu $PREVIOUSLTS-security main universe restricted multiverse 43 | - deb http://archive.ubuntu.com/ubuntu/ $PREVIOUSLTS-updates main universe restricted multiverse 44 | ppas: 45 | - obsproject/obs-studio 46 | packages: 47 | - obs-studio 48 | - ffmpeg 49 | - libvlc5 50 | - libnss-mdns 51 | - libxdmcp6 52 | - libxau6 53 | - libxdamage1 54 | - libpciaccess0 55 | - libxcb-randr0 56 | - libpangocairo-1.0-0 57 | - libpangoft2-1.0-0 58 | - libqt5x11extras5 59 | - libqt5x11extras5-dev 60 | - libssl-dev 61 | - libxcb-glx0-dev 62 | - v4l2loopback-dkms 63 | - xcb" >> recipe.yml 64 | 65 | echo "" >> deps 66 | cat control | grep -e "Depends:" | tr ' ' '\n' | grep -w -v '(' | grep -w -v ',' | grep -w -v '|' | grep -w -v ')' | tr ',' '\n' | grep -w -v "" >> deps 67 | ARGS=$(sed '1d' ./deps) 68 | for arg in $ARGS; do echo " - $arg" >> ./recipe.yml; done 69 | 70 | # ...RUN PKG2APPIMAGE... 71 | ./pkg2appimage ./recipe.yml 72 | 73 | # ...DOWNLOADING LIBUNIONPRELOAD... 74 | wget https://github.com/project-portable/libunionpreload/releases/download/amd64/libunionpreload.so 75 | chmod a+x libunionpreload.so 76 | mv ./libunionpreload.so ./$APP/$APP.AppDir/ 77 | 78 | # ...REPLACING THE EXISTING APPRUN WITH A CUSTOM ONE... 79 | rm -R -f ./$APP/$APP.AppDir/AppRun 80 | cat >> ./$APP/$APP.AppDir/AppRun << 'EOF' 81 | #!/bin/sh 82 | HERE="$(dirname "$(readlink -f $0)")" 83 | export UNION_PRELOAD=$HERE 84 | export LD_PRELOAD=$HERE/libunionpreload.so 85 | export PATH=$HERE/usr/bin/:$HERE/usr/sbin/:$HERE/bin/:$HERE/sbin/:$PATH 86 | export LD_LIBRARY_PATH=/lib/:/lib64/:/usr/lib/:/usr/lib/x86_64-linux-gnu/:$HERE/usr/lib/x86_64-linux-gnu/obs-plugins/:$HERE/usr/lib/x86_64-linux-gnu/cmake/libobs/:$HERE/usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/:$HERE/usr/lib/x86_64-linux-gnu/cmake/obs-frontend-api/:$HERE/usr/lib/x86_64-linux-gnu/obs-scripting/:$HERE/usr/lib/:$HERE/usr/lib/x86_64-linux-gnu/:$HERE/lib/:$HERE/lib/x86_64-linux-gnu/:$HERE/usr/lib/gcc/x86_64-linux-gnu/9/:$HERE/usr/lib/python3.8/lib-dynload/:$LD_LIBRARY_PATH 87 | export PYTHONPATH=$HERE/usr/lib/python3.8/:$PYTHONPATH 88 | export PYTHONHOME=$HERE/usr/:$PYTHONHOME 89 | export XDG_DATA_DIRS=$HERE/usr/share/:$XDG_DATA_DIRS 90 | export PERL5LIB=$HERE/usr/share/perl5/:$HERE/usr/lib/perl5/:$PERLLIB 91 | export GSETTINGS_SCHEMA_DIR=$HERE/usr/share/glib-2.0/schemas/:$GSETTINGS_SCHEMA_DIR 92 | export QT_PLUGIN_PATH=$HERE/lib/:$HERE/usr/lib/:$HERE/usr/lib/x86_64-linux-gnu/qt5/plugins/:$HERE/usr/lib/x86_64-linux-gnu/obs-plugins/:$HERE/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/:$QT_PLUGIN_PATH 93 | 94 | 95 | export OBS_DATA_PATH=$HERE/usr/share/obs/obs-studio/ 96 | export OBS_PLUGINS_LIB_PATH=$HERE/usr/lib/x86_64-linux-gnu/obs-plugins/ 97 | export OBS_PLUGINS_DATA_PATH=$HERE/usr/share/obs/obs-plugins/ 98 | export LIBOBS_DATA_PATH=$HERE/usr/share/obs/libobs/ 99 | export QT_QPA_PLATFORM_PLUGIN_PATH=$HERE/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/ 100 | export OBS_INCLUDE_PATH=$HERE/usr/include/obs/ 101 | 102 | export INCLUDE_PATH=$HERE/usr/include/ 103 | 104 | export QT_DEBUG_PLUGINS=1 105 | exec $HERE/usr/bin/obs "$@" 106 | EOF 107 | chmod a+x ./$APP/$APP.AppDir/AppRun 108 | 109 | # ...IMPORT THE LAUNCHER AND THE ICON TO THE APPDIR (uncomment if not available)... 110 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/22x22/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 111 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/24x24/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 112 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/32x32/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 113 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/48x48/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 114 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/64x64/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 115 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/128x128/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 116 | cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/256x256/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 117 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/512x512/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 118 | #cp ./$APP/$APP.AppDir/usr/share/icons/hicolor/scalable/apps/* ./$APP/$APP.AppDir/ 2>/dev/null 119 | cp ./$APP/$APP.AppDir/usr/share/applications/* ./$APP/$APP.AppDir/ 2>/dev/null 120 | 121 | # ...EXPORT THE APPDIR TO AN APPIMAGE! 122 | ARCH=x86_64 ./appimagetool -n ./$APP/$APP.AppDir; 123 | mkdir version 124 | mv ./$APP/$APP$underscore*.deb ./version/ 125 | version=$(ls ./version | cut -c 12- | rev | cut -c 11- | rev) 126 | 127 | cd .. 128 | mv ./tmp/*.AppImage ./OBS-Studio-$version-x86_64.AppImage 129 | -------------------------------------------------------------------------------- /obs-studio-all-junest.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | APP=obs-studio-stable 4 | BIN="obs" #CHANGE THIS IF THE NAME OF THE BINARY IS DIFFERENT FROM "$APP" (for example, the binary of "obs-studio" is "obs") 5 | DEPENDENCES="libfdk-aac luajit pipiwire python" #SYNTAX: "APP1 APP2 APP3 APP4...", LEAVE BLANK IF NO OTHER DEPENDENCIES ARE NEEDED 6 | BASICSTUFF="binutils debugedit gzip" 7 | COMPILERS="base-devel" 8 | 9 | # Set keywords to searchan include in names of directories and files in /usr/bin (BINSAVED), /usr/share (SHARESAVED) and /usr/lib (LIBSAVED) 10 | BINSAVED="python v4l" 11 | SHARESAVED="glvnd" 12 | LIBSAVED="python" 13 | 14 | # Set the items you want to manually REMOVE. Complete the path in /etc/, /usr/bin/, /usr/lib/, /usr/lib/python*/ and /usr/share/ respectively. 15 | # The "rm" command will take into account the listed object/path and add an asterisk at the end, completing the path to be removed. 16 | # Some keywords and paths are already set. Remove them if you consider them necessary for the AppImage to function properly. 17 | ETC_REMOVED="makepkg.conf pacman" 18 | BIN_REMOVED="gcc qt.conf" 19 | LIB_REMOVED="gcc" 20 | PYTHON_REMOVED="__pycache__/" 21 | SHARE_REMOVED="gcc icons/AdwaitaLegacy icons/Adwaita/cursors/ terminfo" 22 | 23 | # Set mountpoints, they are ment to be set into the AppRun. 24 | # Default mounted files are /etc/resolv.conf, /etc/hosts, /etc/nsswitch.conf, /etc/passwd, /etc/group, /etc/machine-id, /etc/asound.conf and /etc/localtime 25 | # Default mounted directories are /media, /mnt, /opt, /run/media, /usr/lib/locale, /usr/share/fonts, /usr/share/themes, /var, and Nvidia-related directories 26 | # Do not touch this if you are not sure. 27 | mountpoint_files="" 28 | mountpoint_dirs="" 29 | 30 | # Post-installation processes (add whatever you want) 31 | _post_installation_processes() { 32 | printf "\n◆ User's processes: \n\n" 33 | echo " - None" 34 | # Add here your code 35 | } 36 | 37 | ########################################################################################################################################################## 38 | # SETUP THE ENVIRONMENT 39 | ########################################################################################################################################################## 40 | 41 | # Download archimage-builder.sh 42 | if [ ! -f ./archimage-builder.sh ]; then 43 | ARCHIMAGE_BUILDER="https://raw.githubusercontent.com/ivan-hc/ArchImage/refs/heads/main/core/archimage-builder.sh" 44 | wget --retry-connrefused --tries=30 "$ARCHIMAGE_BUILDER" -O ./archimage-builder.sh || exit 0 45 | fi 46 | 47 | # Create and enter the AppDir 48 | mkdir -p AppDir archlinux && cd archlinux || exit 1 49 | 50 | _JUNEST_CMD() { 51 | ./.local/share/junest/bin/junest "$@" 52 | } 53 | 54 | # Set archlinux as a temporary $HOME directory 55 | HOME="$(dirname "$(readlink -f "$0")")" 56 | 57 | ########################################################################################################################################################## 58 | # DOWNLOAD, INSTALL AND CONFIGURE JUNEST 59 | ########################################################################################################################################################## 60 | 61 | _enable_archlinuxcn() { ARCHLINUXCN_ON="1"; } 62 | _enable_chaoticaur() { CHAOTICAUR_ON="1"; } 63 | _enable_multilib() { MULTILIB_ON="1"; } 64 | 65 | #_enable_archlinuxcn 66 | _enable_chaoticaur 67 | #_enable_multilib 68 | 69 | [ -f ../archimage-builder.sh ] && source ../archimage-builder.sh junest-setup "$@" 70 | 71 | ########################################################################################################################################################## 72 | # INSTALL PROGRAMS USING YAY 73 | ########################################################################################################################################################## 74 | 75 | [ -f ../archimage-builder.sh ] && source ../archimage-builder.sh install "$@" 76 | 77 | cd .. 78 | 79 | ########################################################################################################################################################## 80 | # APPDIR 81 | ########################################################################################################################################################## 82 | 83 | [ -f ./archimage-builder.sh ] && source ./archimage-builder.sh appdir "$@" 84 | 85 | ########################################################################################################################################################## 86 | # APPRUN 87 | ########################################################################################################################################################## 88 | 89 | rm -f AppDir/AppRun 90 | 91 | # Set to "1" if you want to add Nvidia drivers manager in the AppRun 92 | export NVIDIA_ON=1 93 | 94 | [ -f ./archimage-builder.sh ] && source ./archimage-builder.sh apprun "$@" 95 | 96 | # AppRun footer, here you can add options and change the way the AppImage interacts with its internal structure 97 | cat <<-'HEREDOC' >> AppDir/AppRun 98 | 99 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 100 | if ! echo "$EXEC" | grep -q "/usr/bin"; then EXEC="/usr/bin/$EXEC"; fi 101 | 102 | _JUNEST_CMD -- $EXEC "$@" 103 | 104 | HEREDOC 105 | chmod a+x AppDir/AppRun 106 | 107 | ########################################################################################################################################################## 108 | # COMPILE 109 | ########################################################################################################################################################## 110 | 111 | [ -f ./archimage-builder.sh ] && source ./archimage-builder.sh compile "$@" 112 | 113 | ########################################################################################################################################################## 114 | # CREATE THE APPIMAGE - FULL VERSION 115 | ########################################################################################################################################################## 116 | 117 | if test -f ./*.AppImage; then rm -Rf ./*archimage*.AppImage; fi 118 | 119 | APPNAME=$(cat AppDir/*.desktop | grep '^Name=' | head -1 | cut -c 6- | sed 's/ /-/g') 120 | REPO="OBS-Studio-appimage" 121 | TAG="latest" 122 | UPINFO="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|$REPO|$TAG|*full-x86_64.AppImage.zsync" 123 | 124 | echo "$VERSION" > ./version 125 | 126 | _appimagetool() { 127 | if ! command -v appimagetool 1>/dev/null; then 128 | if [ ! -f ./appimagetool ]; then 129 | echo " Downloading appimagetool..." && curl -#Lo appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-"$ARCH".AppImage && chmod a+x ./appimagetool || exit 1 130 | fi 131 | ./appimagetool "$@" 132 | else 133 | appimagetool "$@" 134 | fi 135 | } 136 | 137 | ARCH=x86_64 _appimagetool -u "$UPINFO" AppDir "$APPNAME"_"$VERSION"-"$ARCHIMAGE_VERSION"-full-x86_64.AppImage 138 | 139 | if ! test -f ./*full*.AppImage; then exit 1; fi 140 | 141 | ########################################################################################################################################################## 142 | # CREATE THE APPIMAGE - LITE VERSION 143 | ########################################################################################################################################################## 144 | 145 | rm -Rf AppDir/.junest/usr/lib/obs-plugins/libcef.so 146 | rm -Rf AppDir/.junest/usr/lib/obs-plugins/obs-browser* 147 | 148 | if test -f ./*lite*.AppImage; then rm -Rf ./*archimage*lite*.AppImage; fi 149 | 150 | UPINFO="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|$REPO|$TAG|*lite-x86_64.AppImage.zsync" 151 | 152 | ARCH=x86_64 _appimagetool -u "$UPINFO" AppDir "$APPNAME"_"$VERSION"-"$ARCHIMAGE_VERSION"-lite-x86_64.AppImage 153 | 154 | if ! test -f ./*lite*.AppImage; then exit 1; fi 155 | -------------------------------------------------------------------------------- /legacy/junest-based/obs-junest.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | APP=obs-studio 4 | BIN="obs" #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="v4l" 14 | SHARESAVED="glvnd" 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="EGL libDeckLinkAPI libdrm libedit libfdk libFLAC.so libglslang-default-resource-limits.so libLLVM libluajit libpxbackend libsensors \ 18 | libSM.so libsodium.so libsoxr.so libva libwayland xcb libxshmfence qt v4l libSDL libuuid libxkb libcjson libavahi $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 | ./.local/share/junest/bin/junest -- yay --noconfirm -S python # to force one Python version and prevent modules from being installed in different directories (e.g. "mesonbuild") 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 | curl -#Lo gdk-pixbuf2-2.x-x86_64.pkg.tar.zst https://github.com/pkgforge-dev/archlinux-pkgs-debloated/releases/download/continuous/gdk-pixbuf2-mini-x86_64.pkg.tar.zst || exit 1 129 | ./.local/share/junest/bin/junest -- yay --noconfirm -U "$HOME"/gdk-pixbuf2-2.x-x86_64.pkg.tar.zst 130 | curl -#Lo llvm-libs-2.x-x86_64.pkg.tar.zst https://github.com/pkgforge-dev/archlinux-pkgs-debloated/releases/download/continuous/llvm-libs-nano-x86_64.pkg.tar.zst || exit 1 131 | ./.local/share/junest/bin/junest -- yay --noconfirm -U "$HOME"/llvm-libs-2.x-x86_64.pkg.tar.zst 132 | curl -#Lo mesa-2.x-x86_64.pkg.tar.zst https://github.com/pkgforge-dev/archlinux-pkgs-debloated/releases/download/continuous/mesa-nano-x86_64.pkg.tar.zst || exit 1 133 | ./.local/share/junest/bin/junest -- yay --noconfirm -U "$HOME"/mesa-2.x-x86_64.pkg.tar.zst 134 | ./.local/share/junest/bin/junest -- glib-compile-schemas /usr/share/glib-2.0/schemas/ 135 | else 136 | echo "No app found, exiting"; exit 1 137 | fi 138 | 139 | cd .. 140 | 141 | echo "" 142 | echo "-----------------------------------------------------------------------------" 143 | echo " CREATING THE APPDIR" 144 | echo "-----------------------------------------------------------------------------" 145 | echo "" 146 | 147 | # Set locale 148 | rm -f archlinux/.junest/etc/locale.conf 149 | sed -i 's/LANG=${LANG:-C}/LANG=$LANG/g' archlinux/.junest/etc/profile.d/locale.sh 150 | 151 | # Add launcher and icon 152 | rm -f ./*.desktop 153 | LAUNCHER=$(grep -iRl "$BIN" archlinux/.junest/usr/share/applications/* | grep ".desktop" | head -1) 154 | cp -r "$LAUNCHER" "$APP".AppDir/ 155 | ICON=$(cat "$LAUNCHER" | grep "Icon=" | cut -c 6-) 156 | [ -z "$ICON" ] && ICON="$BIN" 157 | cp -r archlinux/.junest/usr/share/icons/*"$ICON"* "$APP".AppDir/ 2>/dev/null 158 | cp -r archlinux/.junest/usr/share/icons/hicolor/22x22/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 159 | cp -r archlinux/.junest/usr/share/icons/hicolor/24x24/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 160 | cp -r archlinux/.junest/usr/share/icons/hicolor/32x32/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 161 | cp -r archlinux/.junest/usr/share/icons/hicolor/48x48/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 162 | cp -r archlinux/.junest/usr/share/icons/hicolor/64x64/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 163 | cp -r archlinux/.junest/usr/share/icons/hicolor/128x128/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 164 | cp -r archlinux/.junest/usr/share/icons/hicolor/192x192/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 165 | cp -r archlinux/.junest/usr/share/icons/hicolor/256x256/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 166 | cp -r archlinux/.junest/usr/share/icons/hicolor/512x512/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 167 | cp -r archlinux/.junest/usr/share/icons/hicolor/scalable/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 168 | cp -r archlinux/.junest/usr/share/pixmaps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 169 | 170 | # Test if the desktop file and the icon are in the root of the future appimage (./*appdir/*) 171 | if test -f "$APP".AppDir/*.desktop; then 172 | echo "◆ The .desktop file is available in $APP.AppDir/" 173 | elif test -f archlinux/.junest/usr/bin/"$BIN"; then 174 | echo "◆ No .desktop file available for $APP, creating a new one" 175 | cat <<-HEREDOC >> "$APP".AppDir/"$APP".desktop 176 | [Desktop Entry] 177 | Version=1.0 178 | Type=Application 179 | Name=$(echo "$APP" | tr '[:lower:]' '[:upper:]') 180 | Comment= 181 | Exec=$BIN 182 | Icon=tux 183 | Categories=Utility; 184 | Terminal=true 185 | StartupNotify=true 186 | HEREDOC 187 | curl -Lo "$APP".AppDir/tux.png https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/favicon.ico 2>/dev/null 188 | else 189 | echo "No binary in path... aborting all the processes." 190 | exit 0 191 | fi 192 | 193 | if [ ! -d "$APP".AppDir/.local ]; then 194 | mkdir -p "$APP".AppDir/.local 195 | rsync -av archlinux/.local/ "$APP".AppDir/.local/ | echo "◆ Rsync .local directory to the AppDir" 196 | # Made JuNest a portable app and remove "read-only file system" errors 197 | sed -i 's#${JUNEST_HOME}/usr/bin/junest_wrapper#${HOME}/.cache/junest_wrapper.old#g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 198 | 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 199 | sed -i 's/ln/#ln/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 200 | sed -i 's/rm -f "$file"/test -f "$file"/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 201 | 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 202 | fi 203 | 204 | echo "◆ Rsync .junest directories structure to the AppDir" 205 | rm -Rf "$APP".AppDir/.junest/* 206 | archdirs=$(find archlinux/.junest -type d | sed 's/^archlinux\///g') 207 | for d in $archdirs; do 208 | mkdir -p "$APP".AppDir/"$d" 209 | done 210 | symlink_dirs=" bin sbin lib lib64 usr/sbin usr/lib64" 211 | for l in $symlink_dirs; do 212 | cp -r archlinux/.junest/"$l" "$APP".AppDir/.junest/"$l" 213 | done 214 | 215 | rsync -av archlinux/.junest/usr/bin_wrappers/ "$APP".AppDir/.junest/usr/bin_wrappers/ | echo "◆ Rsync bin_wrappers to the AppDir" 216 | rsync -av archlinux/.junest/etc/* "$APP".AppDir/.junest/etc/ | echo "◆ Rsync /etc" 217 | 218 | ############################################################################# 219 | # APPRUN 220 | ############################################################################# 221 | 222 | rm -f "$APP".AppDir/AppRun 223 | cat <<-'HEREDOC' >> "$APP".AppDir/AppRun 224 | #!/bin/sh 225 | HERE="$(dirname "$(readlink -f "$0")")" 226 | export UNION_PRELOAD="$HERE" 227 | export JUNEST_HOME="$HERE"/.junest 228 | 229 | if command -v unshare >/dev/null 2>&1 && ! unshare --user -p /bin/true >/dev/null 2>&1; then 230 | PROOT_ON=1 231 | export PATH="$HERE"/.local/share/junest/bin/:"$PATH" 232 | mkdir -p "$HOME"/.cache 233 | else 234 | export PATH="$PATH":"$HERE"/.local/share/junest/bin 235 | fi 236 | 237 | [ -z "$NVIDIA_ON" ] && NVIDIA_ON=1 238 | if [ "$NVIDIA_ON" = 1 ]; then 239 | DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}" 240 | CONTY_DIR="${DATADIR}/Conty/overlayfs_shared" 241 | [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)" 242 | if [ -n "$nvidia_driver_version" ]; then 243 | mkdir -p "${CONTY_DIR}"/nvidia "${CONTY_DIR}"/up/usr/lib "${CONTY_DIR}"/up/usr/share 244 | nvidia_data_dirs="egl glvnd nvidia vulkan" 245 | 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 246 | [ ! -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 247 | [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty=$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version) 248 | if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then 249 | rm -f "${CONTY_DIR}"/up/usr/lib/*; echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 250 | fi 251 | /sbin/ldconfig -p > "${CONTY_DIR}"/nvidia/host_libs 252 | grep -i "nvidia\|libcuda" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2 > "${CONTY_DIR}"/nvidia/host_nvidia_libs 253 | libnv_paths=$(grep "libnv" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2) 254 | for f in $libnv_paths; do strings "${f}" | grep -qi -m 1 "nvidia" && echo "${f}" >> "${CONTY_DIR}"/nvidia/host_nvidia_libs; done 255 | nvidia_libs=$(cat "${CONTY_DIR}"/nvidia/host_nvidia_libs) 256 | 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 257 | libvdpau_nvidia="${CONTY_DIR}/up/usr/lib/libvdpau_nvidia.so" 258 | 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 259 | [ -f "${libvdpau_nvidia}"."${nvidia_driver_version}" ] && [ ! -f "${libvdpau_nvidia}" ] && ln -s "${libvdpau_nvidia}"."${nvidia_driver_version}" "${libvdpau_nvidia}" 260 | [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}" 261 | [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}" 262 | fi 263 | fi 264 | 265 | PROOT_BINDINGS="" 266 | BWRAP_BINDINGS="" 267 | 268 | bind_files="/etc/resolv.conf /etc/hosts /etc/nsswitch.conf /etc/passwd /etc/group /etc/machine-id /etc/asound.conf /etc/localtime " 269 | for f in $bind_files; do [ -f "$f" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$f" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --ro-bind-try $f $f"; done 270 | 271 | bind_dirs=" /media /mnt /opt /run/media /usr/lib/locale /usr/share/fonts /usr/share/themes /var" 272 | for d in $bind_dirs; do [ -d "$d" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$d" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --bind-try $d $d"; done 273 | 274 | PROOT_BINDS=" --bind=/dev --bind=/sys --bind=/tmp --bind=/proc $PROOT_BINDINGS --bind=/home --bind=/home/$USER " 275 | BWRAP_BINDS=" --dev-bind /dev /dev --ro-bind /sys /sys --bind-try /tmp /tmp --proc /proc $BWRAP_BINDINGS --cap-add CAP_SYS_ADMIN " 276 | 277 | _JUNEST_CMD() { 278 | if [ "$PROOT_ON" = 1 ]; then 279 | "$HERE"/.local/share/junest/bin/junest proot -n -b "$PROOT_BINDS" "$@" 280 | else 281 | "$HERE"/.local/share/junest/bin/junest -n -b "$BWRAP_BINDS" "$@" 282 | fi 283 | } 284 | 285 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 286 | if ! echo "$EXEC" | grep -q "/usr/bin"; then EXEC="/usr/bin/$EXEC"; fi 287 | 288 | _JUNEST_CMD -- $EXEC "$@" 289 | 290 | HEREDOC 291 | chmod a+x "$APP".AppDir/AppRun 292 | 293 | ############################################################################# 294 | # EXTRACT PACKAGES 295 | ############################################################################# 296 | 297 | [ -z "$extraction_count" ] && extraction_count=0 298 | [ ! -f ./autodeps ] && echo "$extraction_count" > ./autodeps 299 | [ -f ./autodeps ] && autodeps=$(cat ./autodeps) 300 | [ "$autodeps" != "$extraction_count" ] && rm -Rf ./deps ./packages && echo "$extraction_count" > ./autodeps 301 | 302 | [ ! -f ./userdeps ] && echo "$DEPENDENCES" > ./userdeps 303 | [ -f ./userdeps ] && userdeps=$(cat ./userdeps) 304 | [ "$userdeps" != "$DEPENDENCES" ] && rm -Rf ./deps ./packages && echo "$DEPENDENCES" > ./userdeps 305 | 306 | _extract_main_package() { 307 | mkdir -p base 308 | rm -Rf ./base/* 309 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 310 | if [ "$(echo "$pkg_full_path" | wc -l)" = 1 ]; then 311 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 312 | else 313 | for p in $pkg_full_path; do 314 | if tar fx "$p" .PKGINFO -O | grep -q "pkgname = $APP$"; then 315 | pkg_full_path="$p" 316 | fi 317 | done 318 | fi 319 | [ -z "$pkg_full_path" ] && echo "💀 ERROR: no package found for \"$APP\", operation aborted!" && exit 0 320 | tar fx "$pkg_full_path" -C ./base/ 321 | VERSION=$(cat ./base/.PKGINFO | grep pkgver | cut -c 10- | sed 's@.*:@@') 322 | mkdir -p deps 323 | } 324 | 325 | _download_missing_packages() { 326 | localpackage=$(find ./archlinux -name "$arg-[0-9]*zst") 327 | if ! test -f "$localpackage"; then 328 | ./archlinux/.local/share/junest/bin/junest -- yay --noconfirm -Sw "$arg" 329 | fi 330 | } 331 | 332 | _extract_package() { 333 | _download_missing_packages &> /dev/null 334 | pkg_full_path=$(find ./archlinux -name "$arg-[0-9]*zst") 335 | pkgname=$(echo "$pkg_full_path" | sed 's:.*/::') 336 | [ ! -f ./packages ] && rm -Rf ./deps/* && touch ./packages 337 | if [ -z "$( ls -A './deps' )" ]; then 338 | rm -f ./packages 339 | echo "" 340 | echo "-----------------------------------------------------------------------------" 341 | echo " EXTRACTING PACKAGES" 342 | echo "-----------------------------------------------------------------------------" 343 | echo "" 344 | fi 345 | if test -f "$pkg_full_path"; then 346 | if ! grep -q "$pkgname" ./packages 2>/dev/null;then 347 | echo "◆ Extracting $pkgname" 348 | tar fx "$pkg_full_path" -C ./deps/ --warning=no-unknown-keyword 349 | echo "$pkgname" >> ./packages 350 | fi 351 | [ -n "$lib_browser_launcher" ] && [[ "$arg" =~ (hicolor-icon-theme|xapp) ]] && tar fx "$pkg_full_path" -C ./base/ --warning=no-unknown-keyword --exclude='.PKGINFO' 352 | fi 353 | } 354 | 355 | _determine_packages_and_libraries() { 356 | if echo "$arg" | grep -q "\.so"; then 357 | LIBSAVED="$LIBSAVED $arg" 358 | 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 359 | _extract_package 360 | cat ./deps/.PKGINFO 2>/dev/null | grep "^depend = " | cut -c 10- | sed 's/=.*//' >> depdeps 361 | rm -f ./deps/.* 362 | fi 363 | } 364 | 365 | _extract_deps() { 366 | DEPS=$(sort -u ./depdeps) 367 | for arg in $DEPS; do 368 | _determine_packages_and_libraries 369 | done 370 | } 371 | 372 | _extract_all_dependences() { 373 | rm -f ./depdeps 374 | 375 | OPTDEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^optdepend = " | sed 's/optdepend = //g' | sed 's/=.*//' | sed 's/:.*//') 376 | for arg in $OPTDEPS; do 377 | _determine_packages_and_libraries 378 | done 379 | [ -f ./depdeps ] && _extract_deps 380 | rm -f ./depdeps 381 | 382 | ARGS=$(echo "$DEPENDENCES" | tr " " "\n") 383 | for arg in $ARGS; do 384 | _determine_packages_and_libraries 385 | done 386 | 387 | DEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^depend = " | sed 's/depend = //g' | sed 's/=.*//') 388 | for arg in $DEPS; do 389 | _determine_packages_and_libraries 390 | done 391 | 392 | # Set the level of sub-dependencies extraction, the higher the number, the bigger the AppImage will be 393 | if [ "$extraction_count" != 0 ]; then 394 | for e in $(seq "$extraction_count"); do _extract_deps; done 395 | fi 396 | } 397 | 398 | _extract_main_package 399 | _extract_all_dependences 400 | 401 | echo "" 402 | echo "-----------------------------------------------------------------------------" 403 | echo " IMPLEMENTING NECESSARY LIBRARIES (MAY TAKE SEVERAL MINUTES)" 404 | echo "-----------------------------------------------------------------------------" 405 | echo "" 406 | 407 | # Save files in /usr/bin 408 | _savebins() { 409 | echo "◆ Saving files in /usr/bin" 410 | cp -r ./archlinux/.junest/usr/bin/bwrap ./"$APP".AppDir/.junest/usr/bin/ 411 | cp -r ./archlinux/.junest/usr/bin/proot* ./"$APP".AppDir/.junest/usr/bin/ 412 | cp -r ./archlinux/.junest/usr/bin/*$BIN* ./"$APP".AppDir/.junest/usr/bin/ 413 | 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" 414 | utils_bin="awk bash $coreutils gawk gio grep ld ldd sed sh strings xdg-open" 415 | for b in $utils_bin; do 416 | cp -r ./archlinux/.junest/usr/bin/"$b" ./"$APP".AppDir/.junest/usr/bin/ 417 | done 418 | for arg in $BINSAVED; do 419 | cp -r ./archlinux/.junest/usr/bin/*"$arg"* ./"$APP".AppDir/.junest/usr/bin/ 420 | done 421 | } 422 | 423 | # Save files in /usr/lib 424 | _savelibs() { 425 | echo "◆ Detect libraries related to /usr/bin files" 426 | libs4bin=$(readelf -d ./"$APP".AppDir/.junest/usr/bin/* 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so") 427 | 428 | echo "◆ Saving JuNest core libraries" 429 | cp -r ./archlinux/.junest/usr/lib/ld-linux-x86-64.so* ./"$APP".AppDir/.junest/usr/lib/ 430 | lib_preset="$APP $BIN gconv libdw libelf libresolv.so libtinfo.so $libs4bin" 431 | LIBSAVED="$lib_preset $LIBSAVED $SHARESAVED" 432 | for arg in $LIBSAVED; do 433 | LIBPATHS="$LIBPATHS $(find ./archlinux/.junest/usr/lib -maxdepth 20 -wholename "*$arg*" | sed 's/\.\/archlinux\///g')" 434 | done 435 | for arg in $LIBPATHS; do 436 | [ ! -d "$APP".AppDir/"$arg" ] && cp -r ./archlinux/"$arg" "$APP".AppDir/"$arg" & 437 | done 438 | wait 439 | core_libs=$(find ./"$APP".AppDir -type f) 440 | lib_core=$(for c in $core_libs; do readelf -d "$c" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 441 | 442 | echo "◆ Detect libraries of the main package" 443 | base_libs=$(find ./base -type f | uniq) 444 | lib_base_0=$(for b in $base_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 445 | 446 | echo "◆ Detect libraries of the dependencies" 447 | dep_libs=$(find ./deps -executable -name "*.so*") 448 | lib_deps=$(for d in $dep_libs; do readelf -d "$d" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 449 | 450 | echo "◆ Detect and copy base libs" 451 | basebin_libs=$(find ./base -executable -name "*.so*") 452 | lib_base_1=$(for b in $basebin_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 453 | lib_base_1=$(echo "$lib_base_1" | tr ' ' '\n' | sort -u | xargs) 454 | 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) 455 | lib_base_2=$(echo "$lib_base_2" | tr ' ' '\n' | sort -u | xargs) 456 | 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) 457 | lib_base_3=$(echo "$lib_base_3" | tr ' ' '\n' | sort -u | xargs) 458 | 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) 459 | lib_base_4=$(echo "$lib_base_4" | tr ' ' '\n' | sort -u | xargs) 460 | 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) 461 | lib_base_5=$(echo "$lib_base_5" | tr ' ' '\n' | sort -u | xargs) 462 | 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) 463 | lib_base_6=$(echo "$lib_base_6" | tr ' ' '\n' | sort -u | xargs) 464 | 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) 465 | lib_base_7=$(echo "$lib_base_7" | tr ' ' '\n' | sort -u | xargs) 466 | 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) 467 | lib_base_8=$(echo "$lib_base_8" | tr ' ' '\n' | sort -u | xargs) 468 | 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) 469 | lib_base_9=$(echo "$lib_base_9" | tr ' ' '\n' | sort -u | xargs) 470 | 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" 471 | lib_base_libs=$(echo "$lib_base_libs" | tr ' ' '\n' | sort -u | sed 's/.so.*/.so/' | xargs) 472 | for l in $lib_base_libs; do 473 | rsync -av ./archlinux/.junest/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 474 | done 475 | wait 476 | for l in $lib_base_libs; do 477 | rsync -av ./deps/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 478 | done 479 | wait 480 | } 481 | 482 | # Save files in /usr/share 483 | _saveshare() { 484 | echo "◆ Saving directories in /usr/share" 485 | SHARESAVED="$SHARESAVED $APP $BIN fontconfig glib- locale mime wayland X11" 486 | for arg in $SHARESAVED; do 487 | cp -r ./archlinux/.junest/usr/share/*"$arg"* ./"$APP".AppDir/.junest/usr/share/ 488 | done 489 | } 490 | 491 | _savebins 2>/dev/null 492 | _savelibs 2>/dev/null 493 | _saveshare 2>/dev/null 494 | 495 | echo "" 496 | echo "-----------------------------------------------------------------------------" 497 | echo " ASSEMBLING THE APPIMAGE" 498 | echo "-----------------------------------------------------------------------------" 499 | echo "" 500 | 501 | _rsync_main_package() { 502 | rm -Rf ./base/.* 503 | rsync -av ./base/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync the content of the \"$APP\" package" 504 | } 505 | 506 | _rsync_dependences() { 507 | rm -Rf ./deps/.* 508 | chmod -R 777 ./deps/* 509 | rsync -av ./deps/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync all dependencies, please wait" 510 | } 511 | 512 | _rsync_main_package 513 | _rsync_dependences 514 | 515 | ############################################################################# 516 | # REMOVE BLOATWARES, ENABLE MOUNTPOINTS 517 | ############################################################################# 518 | 519 | _remove_more_bloatwares() { 520 | etc_remove="makepkg.conf pacman" 521 | for r in $etc_remove; do 522 | rm -Rf ./"$APP".AppDir/.junest/etc/"$r"* 523 | done 524 | bin_remove="gcc" 525 | for r in $bin_remove; do 526 | rm -Rf ./"$APP".AppDir/.junest/usr/bin/"$r"* 527 | done 528 | lib_remove="cmake d3d gcc gconv libgphobos libOSMesa libxatracker" 529 | for r in $lib_remove; do 530 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/"$r"* 531 | done 532 | share_remove="gcc gir hwdata i18n terminfo vulkan z" 533 | for r in $share_remove; do 534 | rm -Rf ./"$APP".AppDir/.junest/usr/share/"$r"* 535 | done 536 | echo Y | rm -Rf ./"$APP".AppDir/.cache/yay/* 537 | 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 538 | find ./"$APP".AppDir/.junest/usr/share/locale/*/*/* -not -iname "*$BIN*" -a -not -name "." -delete 2> /dev/null #REMOVE ALL ADDITIONAL LOCALE FILES 539 | rm -Rf ./"$APP".AppDir/.junest/home # remove the inbuilt home 540 | rm -Rf ./"$APP".AppDir/.junest/usr/include # files related to the compiler 541 | rm -Rf ./"$APP".AppDir/.junest/usr/share/man # AppImages are not ment to have man command 542 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/python*/__pycache__/* # if python is installed, removing this directory can save several megabytes 543 | #rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgallium* 544 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgo.so* 545 | #rm -Rf ./"$APP".AppDir/.junest/usr/lib/libLLVM* # included in the compilation phase, can sometimes be excluded for daily use 546 | rm -Rf ./"$APP".AppDir/.junest/var/* # remove all packages downloaded with the package manager 547 | } 548 | 549 | _enable_mountpoints_for_the_inbuilt_bubblewrap() { 550 | mkdir -p ./"$APP".AppDir/.junest/home 551 | mkdir -p ./"$APP".AppDir/.junest/media 552 | mkdir -p ./"$APP".AppDir/.junest/usr/lib/locale 553 | mkdir -p ./"$APP".AppDir/.junest/usr/share/fonts 554 | mkdir -p ./"$APP".AppDir/.junest/usr/share/themes 555 | mkdir -p ./"$APP".AppDir/.junest/run/media 556 | mkdir -p ./"$APP".AppDir/.junest/run/user 557 | rm -f ./"$APP".AppDir/.junest/etc/localtime && touch ./"$APP".AppDir/.junest/etc/localtime 558 | [ ! -f ./"$APP".AppDir/.junest/etc/asound.conf ] && touch ./"$APP".AppDir/.junest/etc/asound.conf 559 | [ ! -e ./"$APP".AppDir/.junest/usr/share/X11/xkb ] && rm -f ./"$APP".AppDir/.junest/usr/share/X11/xkb && mkdir -p ./"$APP".AppDir/.junest/usr/share/X11/xkb && sed -i -- 's# /var"$# /usr/share/X11/xkb /var"#g' ./"$APP".AppDir/AppRun 560 | } 561 | 562 | # Fix libcurl 563 | if test -f ./"$APP".AppDir/.junest/usr/lib/libcurl*; then 564 | rm -f ./"$APP".AppDir/.junest/usr/lib/libcurl* && cp -r ./archlinux/.junest/usr/lib/libcurl* ./"$APP".AppDir/.junest/usr/lib/ 565 | fi 566 | 567 | _remove_more_bloatwares 568 | find ./"$APP".AppDir/.junest/usr/lib ./"$APP".AppDir/.junest/usr/lib32 -type f -regex '.*\.a' -exec rm -f {} \; 2>/dev/null 569 | find ./"$APP".AppDir/.junest/usr -type f -regex '.*\.so.*' -exec strip --strip-debug {} \; 570 | find ./"$APP".AppDir/.junest/usr/bin -type f ! -regex '.*\.so.*' -exec strip --strip-unneeded {} \; 571 | find ./"$APP".AppDir/.junest/usr -type d -empty -delete 572 | _enable_mountpoints_for_the_inbuilt_bubblewrap 573 | 574 | ############################################################################# 575 | # CREATE THE APPIMAGE 576 | ############################################################################# 577 | 578 | if test -f ./*.AppImage; then rm -Rf ./*archimage*.AppImage; fi 579 | 580 | APPNAME=$(cat ./"$APP".AppDir/*.desktop | grep 'Name=' | head -1 | cut -c 6- | sed 's/ /-/g') 581 | REPO="OBS-Studio-appimage" 582 | TAG="latest" 583 | VERSION="$VERSION" 584 | UPINFO="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|$REPO|$TAG|*x86_64.AppImage.zsync" 585 | 586 | ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ 587 | -u "$UPINFO" \ 588 | ./"$APP".AppDir "$APPNAME"_"$VERSION"-archimage4.3-x86_64.AppImage 589 | -------------------------------------------------------------------------------- /legacy/junest-based/obs-full-junest.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | APP=obs-studio-stable 4 | BIN="obs" #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="v4l" 14 | SHARESAVED="glvnd" 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="EGL libDeckLinkAPI libdrm libedit libfdk libFLAC.so libglslang-default-resource-limits.so libLLVM libluajit libpxbackend libsensors \ 18 | libSM.so libsodium.so libsoxr.so libva libwayland xcb libxshmfence qt v4l libSDL libuuid libxkb libcjson libavahi $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 | ./.local/share/junest/bin/junest -- yay --noconfirm -S python # to force one Python version and prevent modules from being installed in different directories (e.g. "mesonbuild") 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 | curl -#Lo gdk-pixbuf2-2.x-x86_64.pkg.tar.zst https://github.com/pkgforge-dev/archlinux-pkgs-debloated/releases/download/continuous/gdk-pixbuf2-mini-x86_64.pkg.tar.zst || exit 1 129 | ./.local/share/junest/bin/junest -- yay --noconfirm -U "$HOME"/gdk-pixbuf2-2.x-x86_64.pkg.tar.zst 130 | curl -#Lo llvm-libs-2.x-x86_64.pkg.tar.zst https://github.com/pkgforge-dev/archlinux-pkgs-debloated/releases/download/continuous/llvm-libs-nano-x86_64.pkg.tar.zst || exit 1 131 | ./.local/share/junest/bin/junest -- yay --noconfirm -U "$HOME"/llvm-libs-2.x-x86_64.pkg.tar.zst 132 | curl -#Lo mesa-2.x-x86_64.pkg.tar.zst https://github.com/pkgforge-dev/archlinux-pkgs-debloated/releases/download/continuous/mesa-nano-x86_64.pkg.tar.zst || exit 1 133 | ./.local/share/junest/bin/junest -- yay --noconfirm -U "$HOME"/mesa-2.x-x86_64.pkg.tar.zst 134 | ./.local/share/junest/bin/junest -- glib-compile-schemas /usr/share/glib-2.0/schemas/ 135 | else 136 | echo "No app found, exiting"; exit 1 137 | fi 138 | 139 | cd .. 140 | 141 | echo "" 142 | echo "-----------------------------------------------------------------------------" 143 | echo " CREATING THE APPDIR" 144 | echo "-----------------------------------------------------------------------------" 145 | echo "" 146 | 147 | # Set locale 148 | rm -f archlinux/.junest/etc/locale.conf 149 | sed -i 's/LANG=${LANG:-C}/LANG=$LANG/g' archlinux/.junest/etc/profile.d/locale.sh 150 | 151 | # Add launcher and icon 152 | rm -f ./*.desktop 153 | LAUNCHER=$(grep -iRl "$BIN" archlinux/.junest/usr/share/applications/* | grep ".desktop" | head -1) 154 | cp -r "$LAUNCHER" "$APP".AppDir/ 155 | ICON=$(cat "$LAUNCHER" | grep "Icon=" | cut -c 6-) 156 | [ -z "$ICON" ] && ICON="$BIN" 157 | cp -r archlinux/.junest/usr/share/icons/*"$ICON"* "$APP".AppDir/ 2>/dev/null 158 | cp -r archlinux/.junest/usr/share/icons/hicolor/22x22/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 159 | cp -r archlinux/.junest/usr/share/icons/hicolor/24x24/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 160 | cp -r archlinux/.junest/usr/share/icons/hicolor/32x32/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 161 | cp -r archlinux/.junest/usr/share/icons/hicolor/48x48/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 162 | cp -r archlinux/.junest/usr/share/icons/hicolor/64x64/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 163 | cp -r archlinux/.junest/usr/share/icons/hicolor/128x128/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 164 | cp -r archlinux/.junest/usr/share/icons/hicolor/192x192/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 165 | cp -r archlinux/.junest/usr/share/icons/hicolor/256x256/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 166 | cp -r archlinux/.junest/usr/share/icons/hicolor/512x512/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 167 | cp -r archlinux/.junest/usr/share/icons/hicolor/scalable/apps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 168 | cp -r archlinux/.junest/usr/share/pixmaps/*"$ICON"* "$APP".AppDir/ 2>/dev/null 169 | 170 | # Test if the desktop file and the icon are in the root of the future appimage (./*appdir/*) 171 | if test -f "$APP".AppDir/*.desktop; then 172 | echo "◆ The .desktop file is available in $APP.AppDir/" 173 | elif test -f archlinux/.junest/usr/bin/"$BIN"; then 174 | echo "◆ No .desktop file available for $APP, creating a new one" 175 | cat <<-HEREDOC >> "$APP".AppDir/"$APP".desktop 176 | [Desktop Entry] 177 | Version=1.0 178 | Type=Application 179 | Name=$(echo "$APP" | tr '[:lower:]' '[:upper:]') 180 | Comment= 181 | Exec=$BIN 182 | Icon=tux 183 | Categories=Utility; 184 | Terminal=true 185 | StartupNotify=true 186 | HEREDOC 187 | curl -Lo "$APP".AppDir/tux.png https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/favicon.ico 2>/dev/null 188 | else 189 | echo "No binary in path... aborting all the processes." 190 | exit 0 191 | fi 192 | 193 | if [ ! -d "$APP".AppDir/.local ]; then 194 | mkdir -p "$APP".AppDir/.local 195 | rsync -av archlinux/.local/ "$APP".AppDir/.local/ | echo "◆ Rsync .local directory to the AppDir" 196 | # Made JuNest a portable app and remove "read-only file system" errors 197 | sed -i 's#${JUNEST_HOME}/usr/bin/junest_wrapper#${HOME}/.cache/junest_wrapper.old#g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 198 | 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 199 | sed -i 's/ln/#ln/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 200 | sed -i 's/rm -f "$file"/test -f "$file"/g' "$APP".AppDir/.local/share/junest/lib/core/wrappers.sh 201 | 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 202 | fi 203 | 204 | echo "◆ Rsync .junest directories structure to the AppDir" 205 | rm -Rf "$APP".AppDir/.junest/* 206 | archdirs=$(find archlinux/.junest -type d | sed 's/^archlinux\///g') 207 | for d in $archdirs; do 208 | mkdir -p "$APP".AppDir/"$d" 209 | done 210 | symlink_dirs=" bin sbin lib lib64 usr/sbin usr/lib64" 211 | for l in $symlink_dirs; do 212 | cp -r archlinux/.junest/"$l" "$APP".AppDir/.junest/"$l" 213 | done 214 | 215 | rsync -av archlinux/.junest/usr/bin_wrappers/ "$APP".AppDir/.junest/usr/bin_wrappers/ | echo "◆ Rsync bin_wrappers to the AppDir" 216 | rsync -av archlinux/.junest/etc/* "$APP".AppDir/.junest/etc/ | echo "◆ Rsync /etc" 217 | 218 | ############################################################################# 219 | # APPRUN 220 | ############################################################################# 221 | 222 | rm -f "$APP".AppDir/AppRun 223 | cat <<-'HEREDOC' >> "$APP".AppDir/AppRun 224 | #!/bin/sh 225 | HERE="$(dirname "$(readlink -f "$0")")" 226 | export UNION_PRELOAD="$HERE" 227 | export JUNEST_HOME="$HERE"/.junest 228 | 229 | if command -v unshare >/dev/null 2>&1 && ! unshare --user -p /bin/true >/dev/null 2>&1; then 230 | PROOT_ON=1 231 | export PATH="$HERE"/.local/share/junest/bin/:"$PATH" 232 | mkdir -p "$HOME"/.cache 233 | else 234 | export PATH="$PATH":"$HERE"/.local/share/junest/bin 235 | fi 236 | 237 | [ -z "$NVIDIA_ON" ] && NVIDIA_ON=1 238 | if [ "$NVIDIA_ON" = 1 ]; then 239 | DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}" 240 | CONTY_DIR="${DATADIR}/Conty/overlayfs_shared" 241 | [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)" 242 | if [ -n "$nvidia_driver_version" ]; then 243 | mkdir -p "${CONTY_DIR}"/nvidia "${CONTY_DIR}"/up/usr/lib "${CONTY_DIR}"/up/usr/share 244 | nvidia_data_dirs="egl glvnd nvidia vulkan" 245 | 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 246 | [ ! -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 247 | [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty=$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version) 248 | if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then 249 | rm -f "${CONTY_DIR}"/up/usr/lib/*; echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version 250 | fi 251 | /sbin/ldconfig -p > "${CONTY_DIR}"/nvidia/host_libs 252 | grep -i "nvidia\|libcuda" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2 > "${CONTY_DIR}"/nvidia/host_nvidia_libs 253 | libnv_paths=$(grep "libnv" "${CONTY_DIR}"/nvidia/host_libs | cut -d ">" -f 2) 254 | for f in $libnv_paths; do strings "${f}" | grep -qi -m 1 "nvidia" && echo "${f}" >> "${CONTY_DIR}"/nvidia/host_nvidia_libs; done 255 | nvidia_libs=$(cat "${CONTY_DIR}"/nvidia/host_nvidia_libs) 256 | 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 257 | libvdpau_nvidia="${CONTY_DIR}/up/usr/lib/libvdpau_nvidia.so" 258 | 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 259 | [ -f "${libvdpau_nvidia}"."${nvidia_driver_version}" ] && [ ! -f "${libvdpau_nvidia}" ] && ln -s "${libvdpau_nvidia}"."${nvidia_driver_version}" "${libvdpau_nvidia}" 260 | [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}" 261 | [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}" 262 | fi 263 | fi 264 | 265 | PROOT_BINDINGS="" 266 | BWRAP_BINDINGS="" 267 | 268 | bind_files="/etc/resolv.conf /etc/hosts /etc/nsswitch.conf /etc/passwd /etc/group /etc/machine-id /etc/asound.conf /etc/localtime " 269 | for f in $bind_files; do [ -f "$f" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$f" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --ro-bind-try $f $f"; done 270 | 271 | bind_dirs=" /media /mnt /opt /run/media /usr/lib/locale /usr/share/fonts /usr/share/themes /var" 272 | for d in $bind_dirs; do [ -d "$d" ] && PROOT_BINDINGS=" $PROOT_BINDINGS --bind=$d" && BWRAP_BINDINGS=" $BWRAP_BINDINGS --bind-try $d $d"; done 273 | 274 | PROOT_BINDS=" --bind=/dev --bind=/sys --bind=/tmp --bind=/proc $PROOT_BINDINGS --bind=/home --bind=/home/$USER " 275 | BWRAP_BINDS=" --dev-bind /dev /dev --ro-bind /sys /sys --bind-try /tmp /tmp --proc /proc $BWRAP_BINDINGS --cap-add CAP_SYS_ADMIN " 276 | 277 | _JUNEST_CMD() { 278 | if [ "$PROOT_ON" = 1 ]; then 279 | "$HERE"/.local/share/junest/bin/junest proot -n -b "$PROOT_BINDS" "$@" 280 | else 281 | "$HERE"/.local/share/junest/bin/junest -n -b "$BWRAP_BINDS" "$@" 282 | fi 283 | } 284 | 285 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 286 | if ! echo "$EXEC" | grep -q "/usr/bin"; then EXEC="/usr/bin/$EXEC"; fi 287 | 288 | _JUNEST_CMD -- $EXEC "$@" 289 | 290 | HEREDOC 291 | chmod a+x "$APP".AppDir/AppRun 292 | 293 | ############################################################################# 294 | # EXTRACT PACKAGES 295 | ############################################################################# 296 | 297 | [ -z "$extraction_count" ] && extraction_count=0 298 | [ ! -f ./autodeps ] && echo "$extraction_count" > ./autodeps 299 | [ -f ./autodeps ] && autodeps=$(cat ./autodeps) 300 | [ "$autodeps" != "$extraction_count" ] && rm -Rf ./deps ./packages && echo "$extraction_count" > ./autodeps 301 | 302 | [ ! -f ./userdeps ] && echo "$DEPENDENCES" > ./userdeps 303 | [ -f ./userdeps ] && userdeps=$(cat ./userdeps) 304 | [ "$userdeps" != "$DEPENDENCES" ] && rm -Rf ./deps ./packages && echo "$DEPENDENCES" > ./userdeps 305 | 306 | _extract_main_package() { 307 | mkdir -p base 308 | rm -Rf ./base/* 309 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 310 | if [ "$(echo "$pkg_full_path" | wc -l)" = 1 ]; then 311 | pkg_full_path=$(find ./archlinux -type f -name "$APP-*zst") 312 | else 313 | for p in $pkg_full_path; do 314 | if tar fx "$p" .PKGINFO -O | grep -q "pkgname = $APP$"; then 315 | pkg_full_path="$p" 316 | fi 317 | done 318 | fi 319 | [ -z "$pkg_full_path" ] && echo "💀 ERROR: no package found for \"$APP\", operation aborted!" && exit 0 320 | tar fx "$pkg_full_path" -C ./base/ 321 | VERSION=$(cat ./base/.PKGINFO | grep pkgver | cut -c 10- | sed 's@.*:@@') 322 | mkdir -p deps 323 | } 324 | 325 | _download_missing_packages() { 326 | localpackage=$(find ./archlinux -name "$arg-[0-9]*zst") 327 | if ! test -f "$localpackage"; then 328 | ./archlinux/.local/share/junest/bin/junest -- yay --noconfirm -Sw "$arg" 329 | fi 330 | } 331 | 332 | _extract_package() { 333 | _download_missing_packages &> /dev/null 334 | pkg_full_path=$(find ./archlinux -name "$arg-[0-9]*zst") 335 | pkgname=$(echo "$pkg_full_path" | sed 's:.*/::') 336 | [ ! -f ./packages ] && rm -Rf ./deps/* && touch ./packages 337 | if [ -z "$( ls -A './deps' )" ]; then 338 | rm -f ./packages 339 | echo "" 340 | echo "-----------------------------------------------------------------------------" 341 | echo " EXTRACTING PACKAGES" 342 | echo "-----------------------------------------------------------------------------" 343 | echo "" 344 | fi 345 | if test -f "$pkg_full_path"; then 346 | if ! grep -q "$pkgname" ./packages 2>/dev/null;then 347 | echo "◆ Extracting $pkgname" 348 | tar fx "$pkg_full_path" -C ./deps/ --warning=no-unknown-keyword 349 | echo "$pkgname" >> ./packages 350 | fi 351 | [ -n "$lib_browser_launcher" ] && [[ "$arg" =~ (hicolor-icon-theme|xapp) ]] && tar fx "$pkg_full_path" -C ./base/ --warning=no-unknown-keyword --exclude='.PKGINFO' 352 | fi 353 | } 354 | 355 | _determine_packages_and_libraries() { 356 | if echo "$arg" | grep -q "\.so"; then 357 | LIBSAVED="$LIBSAVED $arg" 358 | 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 359 | _extract_package 360 | cat ./deps/.PKGINFO 2>/dev/null | grep "^depend = " | cut -c 10- | sed 's/=.*//' >> depdeps 361 | rm -f ./deps/.* 362 | fi 363 | } 364 | 365 | _extract_deps() { 366 | DEPS=$(sort -u ./depdeps) 367 | for arg in $DEPS; do 368 | _determine_packages_and_libraries 369 | done 370 | } 371 | 372 | _extract_all_dependences() { 373 | rm -f ./depdeps 374 | 375 | OPTDEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^optdepend = " | sed 's/optdepend = //g' | sed 's/=.*//' | sed 's/:.*//') 376 | for arg in $OPTDEPS; do 377 | _determine_packages_and_libraries 378 | done 379 | [ -f ./depdeps ] && _extract_deps 380 | rm -f ./depdeps 381 | 382 | ARGS=$(echo "$DEPENDENCES" | tr " " "\n") 383 | for arg in $ARGS; do 384 | _determine_packages_and_libraries 385 | done 386 | 387 | DEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "^depend = " | sed 's/depend = //g' | sed 's/=.*//') 388 | for arg in $DEPS; do 389 | _determine_packages_and_libraries 390 | done 391 | 392 | # Set the level of sub-dependencies extraction, the higher the number, the bigger the AppImage will be 393 | if [ "$extraction_count" != 0 ]; then 394 | for e in $(seq "$extraction_count"); do _extract_deps; done 395 | fi 396 | } 397 | 398 | _extract_main_package 399 | _extract_all_dependences 400 | 401 | echo "" 402 | echo "-----------------------------------------------------------------------------" 403 | echo " IMPLEMENTING NECESSARY LIBRARIES (MAY TAKE SEVERAL MINUTES)" 404 | echo "-----------------------------------------------------------------------------" 405 | echo "" 406 | 407 | # Save files in /usr/bin 408 | _savebins() { 409 | echo "◆ Saving files in /usr/bin" 410 | cp -r ./archlinux/.junest/usr/bin/bwrap ./"$APP".AppDir/.junest/usr/bin/ 411 | cp -r ./archlinux/.junest/usr/bin/proot* ./"$APP".AppDir/.junest/usr/bin/ 412 | cp -r ./archlinux/.junest/usr/bin/*$BIN* ./"$APP".AppDir/.junest/usr/bin/ 413 | 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" 414 | utils_bin="awk bash $coreutils gawk gio grep ld ldd sed sh strings xdg-open" 415 | for b in $utils_bin; do 416 | cp -r ./archlinux/.junest/usr/bin/"$b" ./"$APP".AppDir/.junest/usr/bin/ 417 | done 418 | for arg in $BINSAVED; do 419 | cp -r ./archlinux/.junest/usr/bin/*"$arg"* ./"$APP".AppDir/.junest/usr/bin/ 420 | done 421 | } 422 | 423 | # Save files in /usr/lib 424 | _savelibs() { 425 | echo "◆ Detect libraries related to /usr/bin files" 426 | libs4bin=$(readelf -d ./"$APP".AppDir/.junest/usr/bin/* 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so") 427 | 428 | echo "◆ Saving JuNest core libraries" 429 | cp -r ./archlinux/.junest/usr/lib/ld-linux-x86-64.so* ./"$APP".AppDir/.junest/usr/lib/ 430 | lib_preset="$APP $BIN gconv libdw libelf libresolv.so libtinfo.so $libs4bin" 431 | LIBSAVED="$lib_preset $LIBSAVED $SHARESAVED" 432 | for arg in $LIBSAVED; do 433 | LIBPATHS="$LIBPATHS $(find ./archlinux/.junest/usr/lib -maxdepth 20 -wholename "*$arg*" | sed 's/\.\/archlinux\///g')" 434 | done 435 | for arg in $LIBPATHS; do 436 | [ ! -d "$APP".AppDir/"$arg" ] && cp -r ./archlinux/"$arg" "$APP".AppDir/"$arg" & 437 | done 438 | wait 439 | core_libs=$(find ./"$APP".AppDir -type f) 440 | lib_core=$(for c in $core_libs; do readelf -d "$c" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 441 | 442 | echo "◆ Detect libraries of the main package" 443 | base_libs=$(find ./base -type f | uniq) 444 | lib_base_0=$(for b in $base_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 445 | 446 | echo "◆ Detect libraries of the dependencies" 447 | dep_libs=$(find ./deps -executable -name "*.so*") 448 | lib_deps=$(for d in $dep_libs; do readelf -d "$d" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 449 | 450 | echo "◆ Detect and copy base libs" 451 | basebin_libs=$(find ./base -executable -name "*.so*") 452 | lib_base_1=$(for b in $basebin_libs; do readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so"; done) 453 | lib_base_1=$(echo "$lib_base_1" | tr ' ' '\n' | sort -u | xargs) 454 | 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) 455 | lib_base_2=$(echo "$lib_base_2" | tr ' ' '\n' | sort -u | xargs) 456 | 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) 457 | lib_base_3=$(echo "$lib_base_3" | tr ' ' '\n' | sort -u | xargs) 458 | 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) 459 | lib_base_4=$(echo "$lib_base_4" | tr ' ' '\n' | sort -u | xargs) 460 | 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) 461 | lib_base_5=$(echo "$lib_base_5" | tr ' ' '\n' | sort -u | xargs) 462 | 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) 463 | lib_base_6=$(echo "$lib_base_6" | tr ' ' '\n' | sort -u | xargs) 464 | 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) 465 | lib_base_7=$(echo "$lib_base_7" | tr ' ' '\n' | sort -u | xargs) 466 | 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) 467 | lib_base_8=$(echo "$lib_base_8" | tr ' ' '\n' | sort -u | xargs) 468 | 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) 469 | lib_base_9=$(echo "$lib_base_9" | tr ' ' '\n' | sort -u | xargs) 470 | 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" 471 | lib_base_libs=$(echo "$lib_base_libs" | tr ' ' '\n' | sort -u | sed 's/.so.*/.so/' | xargs) 472 | for l in $lib_base_libs; do 473 | rsync -av ./archlinux/.junest/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 474 | done 475 | wait 476 | for l in $lib_base_libs; do 477 | rsync -av ./deps/usr/lib/"$l"* ./"$APP".AppDir/.junest/usr/lib/ & 478 | done 479 | wait 480 | } 481 | 482 | # Save files in /usr/share 483 | _saveshare() { 484 | echo "◆ Saving directories in /usr/share" 485 | SHARESAVED="$SHARESAVED $APP $BIN fontconfig glib- locale mime wayland X11" 486 | for arg in $SHARESAVED; do 487 | cp -r ./archlinux/.junest/usr/share/*"$arg"* ./"$APP".AppDir/.junest/usr/share/ 488 | done 489 | } 490 | 491 | _savebins 2>/dev/null 492 | _savelibs 2>/dev/null 493 | _saveshare 2>/dev/null 494 | 495 | echo "" 496 | echo "-----------------------------------------------------------------------------" 497 | echo " ASSEMBLING THE APPIMAGE" 498 | echo "-----------------------------------------------------------------------------" 499 | echo "" 500 | 501 | _rsync_main_package() { 502 | rm -Rf ./base/.* 503 | rsync -av ./base/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync the content of the \"$APP\" package" 504 | } 505 | 506 | _rsync_dependences() { 507 | rm -Rf ./deps/.* 508 | chmod -R 777 ./deps/* 509 | rsync -av ./deps/ ./"$APP".AppDir/.junest/ | echo "◆ Rsync all dependencies, please wait" 510 | } 511 | 512 | _rsync_main_package 513 | _rsync_dependences 514 | 515 | ############################################################################# 516 | # REMOVE BLOATWARES, ENABLE MOUNTPOINTS 517 | ############################################################################# 518 | 519 | _remove_more_bloatwares() { 520 | etc_remove="makepkg.conf pacman" 521 | for r in $etc_remove; do 522 | rm -Rf ./"$APP".AppDir/.junest/etc/"$r"* 523 | done 524 | bin_remove="gcc" 525 | for r in $bin_remove; do 526 | rm -Rf ./"$APP".AppDir/.junest/usr/bin/"$r"* 527 | done 528 | lib_remove="cmake d3d gcc gconv libgphobos libOSMesa libxatracker" 529 | for r in $lib_remove; do 530 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/"$r"* 531 | done 532 | share_remove="gcc gir hwdata i18n terminfo vulkan z" 533 | for r in $share_remove; do 534 | rm -Rf ./"$APP".AppDir/.junest/usr/share/"$r"* 535 | done 536 | echo Y | rm -Rf ./"$APP".AppDir/.cache/yay/* 537 | 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 538 | find ./"$APP".AppDir/.junest/usr/share/locale/*/*/* -not -iname "*$BIN*" -a -not -name "." -delete 2> /dev/null #REMOVE ALL ADDITIONAL LOCALE FILES 539 | rm -Rf ./"$APP".AppDir/.junest/home # remove the inbuilt home 540 | rm -Rf ./"$APP".AppDir/.junest/usr/include # files related to the compiler 541 | rm -Rf ./"$APP".AppDir/.junest/usr/share/man # AppImages are not ment to have man command 542 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/python*/__pycache__/* # if python is installed, removing this directory can save several megabytes 543 | #rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgallium* 544 | rm -Rf ./"$APP".AppDir/.junest/usr/lib/libgo.so* 545 | #rm -Rf ./"$APP".AppDir/.junest/usr/lib/libLLVM* # included in the compilation phase, can sometimes be excluded for daily use 546 | rm -Rf ./"$APP".AppDir/.junest/var/* # remove all packages downloaded with the package manager 547 | } 548 | 549 | _enable_mountpoints_for_the_inbuilt_bubblewrap() { 550 | mkdir -p ./"$APP".AppDir/.junest/home 551 | mkdir -p ./"$APP".AppDir/.junest/media 552 | mkdir -p ./"$APP".AppDir/.junest/usr/lib/locale 553 | mkdir -p ./"$APP".AppDir/.junest/usr/share/fonts 554 | mkdir -p ./"$APP".AppDir/.junest/usr/share/themes 555 | mkdir -p ./"$APP".AppDir/.junest/run/media 556 | mkdir -p ./"$APP".AppDir/.junest/run/user 557 | rm -f ./"$APP".AppDir/.junest/etc/localtime && touch ./"$APP".AppDir/.junest/etc/localtime 558 | [ ! -f ./"$APP".AppDir/.junest/etc/asound.conf ] && touch ./"$APP".AppDir/.junest/etc/asound.conf 559 | [ ! -e ./"$APP".AppDir/.junest/usr/share/X11/xkb ] && rm -f ./"$APP".AppDir/.junest/usr/share/X11/xkb && mkdir -p ./"$APP".AppDir/.junest/usr/share/X11/xkb && sed -i -- 's# /var"$# /usr/share/X11/xkb /var"#g' ./"$APP".AppDir/AppRun 560 | } 561 | 562 | # Fix libcurl 563 | if test -f ./"$APP".AppDir/.junest/usr/lib/libcurl*; then 564 | rm -f ./"$APP".AppDir/.junest/usr/lib/libcurl* && cp -r ./archlinux/.junest/usr/lib/libcurl* ./"$APP".AppDir/.junest/usr/lib/ 565 | fi 566 | 567 | _remove_more_bloatwares 568 | find ./"$APP".AppDir/.junest/usr/lib ./"$APP".AppDir/.junest/usr/lib32 -type f -regex '.*\.a' -exec rm -f {} \; 2>/dev/null 569 | find ./"$APP".AppDir/.junest/usr -type f -regex '.*\.so.*' -exec strip --strip-debug {} \; 570 | find ./"$APP".AppDir/.junest/usr/bin -type f ! -regex '.*\.so.*' -exec strip --strip-unneeded {} \; 571 | find ./"$APP".AppDir/.junest/usr -type d -empty -delete 572 | _enable_mountpoints_for_the_inbuilt_bubblewrap 573 | 574 | ############################################################################# 575 | # CREATE THE APPIMAGE 576 | ############################################################################# 577 | 578 | if test -f ./*.AppImage; then rm -Rf ./*archimage*.AppImage; fi 579 | 580 | APPNAME=$(cat ./"$APP".AppDir/*.desktop | grep 'Name=' | head -1 | cut -c 6- | sed 's/ /-/g') 581 | REPO="OBS-Studio-appimage" 582 | TAG="continuous-full" 583 | VERSION="$VERSION" 584 | UPINFO="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|$REPO|$TAG|*x86_64.AppImage.zsync" 585 | 586 | ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ 587 | -u "$UPINFO" \ 588 | ./"$APP".AppDir "$APPNAME"-FULL_"$VERSION"-archimage4.3-x86_64.AppImage 589 | --------------------------------------------------------------------------------