ivan-hc / ArchImage

Build AppImage packages for all distributions but including Arch Linux packages. Powered by JuNest.
GNU General Public License v3.0
112 stars 1 forks source link

I can't build an appimage of infra-arcana #22

Closed vinniec2 closed 3 months ago

vinniec2 commented 5 months ago

I have done several trials without success, I am doing the trial with infra-arcana, I am on alpine linux and I had to install git and bash to start archimage-cli.

  1. I ran the script "archimage-cli -b infra-arcana" responding: nothing, nothing, y, y (same name, no optional dep, include dep, standard conf).
  2. after that I opened the generated script and uncommented #BASICSTUFF #COMPILERS (not sure if I need to compile for this package, though BASICSTUFF is necessary otherwise at startup I get these two errors returned)
    ==> ERROR: Cannot find the gzip binary required for compressing man and info pages.
    ==> ERROR: Cannot find the strip binary required for object file stripping.
  3. I added -c to the first two wgets to avoid downloading appimagetool and junest each time (I did a lot of testing, I didn't want to always re-download everything, so I would pass the pre-downloaded files to the script)

The log is too long and I can't attach text files to issues (!) so i created some gists. This is the editet infra-arcana script: https://gist.githubusercontent.com/vinniec2/154bb0a3e5bd17d4e8ed8068faaa3142/raw/9a7ae1d98543c524979a2df1a9b6bed2d35b4701/gistfile2.txt

And this is the full log: https://gist.githubusercontent.com/vinniec2/154bb0a3e5bd17d4e8ed8068faaa3142/raw/9a7ae1d98543c524979a2df1a9b6bed2d35b4701/gistfile1.txt

ivan-hc commented 5 months ago

In my case the AppImageis created, steps to create it: Istantanea_2024-05-06_16-02-53 png

The sequence is: blank, blank, Y, Y

Be sure you have imagemagick and tar installed on your host.

The AppImage for me is 72,6 MB

Istantanea_2024-05-06_16-05-44 png

but it didn't work because the files are installed in .junest/opt , one of the directories mounted in the JuNest container

Istantanea_2024-05-06_16-07-43 png

this is the root of the AppDir

Istantanea_2024-05-06_16-08-03 png

and this is the error messafe I've got by running the app

/usr/bin/infra-arcana: line 2: cd: /opt/infra-arcana: No such file or directory
/usr/bin/infra-arcana: line 3: /home/ivan/Scrivania/tmp/ia: No such file or directory
/tmp/.mount_Infra-LcmCEm/.local/share/junest/lib/core/wrappers.sh: riga 30: /home/ivan/Scrivania/tmp/Infra-Arcana_22.1.0-1-archimage3.4-x86_64.AppImage.home/.cache/junest_wrapper.old: File o directory non esistente

which means that you need to add manually extra steps to move the content of /opt to /usr/share, for example, and also you need to let the AppRun script point to the "ia" binary using JuNest, like this, change:

$HERE/.local/share/junest/bin/junest -n -b "$BINDS" -- $EXEC "$@"

with

$HERE/.local/share/junest/bin/junest -n -b "$BINDS" -- /usr/share/infra-arcana/ia "$@"

you can take my ocenaudio Archimage as an example

mine contains an additional step like, lines 113/114

# MOVE OCENAUDIO TO /usr/share
mv ./.junest/opt/ocenaudio ./.junest/usr/share/ocenaudio

the change in my AppRun is this (lines 106 to 109)

case "$1" in
    '') $HERE/.local/share/junest/bin/junest -n -b "$ETC_RESOLV" -- /usr/share/ocenaudio/bin/ocenaudio "$@";;
    *) $HERE/.local/share/junest/bin/junest -n -b "$ETC_RESOLV" -- /usr/share/ocenaudio/bin/ocenvst "$@";;
esac

you only need one line there instead, ocenaudio have two binaries, so I had to do so.

And that is.

vinniec2 commented 5 months ago

I tried but it still fails to build the appimage, this is my edited infra-arcana-junest.sh

https://gist.github.com/vinniec2/154bb0a3e5bd17d4e8ed8068faaa3142/raw/ec6addbc7cee4a16b5a58b265e672918dd9541d4/gistfile3.txt

the edited parts are:

  1. line 7 decommented
  2. lines 12, 26 added -c (to not download junest and appimagetool again)
  3. line 166 replaced with yours $HERE/.local/share/junest/bin/junest -n -b "$BINDS" -- /usr/share/infra-arcana/ia "$@"
  4. line 170-171 added for moving to /usr/share mv ./.junest/opt/infra-arcana ./.junest/usr/share/infra-arcana

somehow toward the end it doesn't create the appimage so that the script can't rename it in the last instruction that fails.

The dependencies I provide before trying the script are these: apk add tar imagemagick bash fuse3 git rsync wget xdg-user-dirs

ivan-hc commented 5 months ago

strange, I suggest to take track of the commands used in this script (not the ones used inside JuNest) and install them on your host.

Now I'll try to buid it for you, if I reach I'll share the script here, so you can see the differences between yours and mine.

Again, if you can't built the AppImage, you may have some missing dependences on the host, not in JuNest.

In the meantime see if your app's structure is the same as mine in the screenshots.

ivan-hc commented 5 months ago

@vinniec2 this is the one I've built with the changes I suggested above:

Click here ``` #!/usr/bin/env bash # NAME OF THE APP BY REPLACING "SAMPLE" APP=infra-arcana BIN="$APP" #CHANGE THIS IF THE NAME OF THE BINARY IS DIFFERENT FROM "$APP" (for example, the binary of "obs-studio" is "obs") DEPENDENCES="ca-certificates " BASICSTUFF="binutils debugedit gzip" COMPILERS="base-devel" # CREATE THE APPDIR (DON'T TOUCH THIS)... if ! test -f ./appimagetool; then wget -q "$(wget -q https://api.github.com/repos/probonopd/go-appimage/releases -O - | sed 's/"/ /g; s/ /\n/g' | grep -o 'https.*continuous.*tool.*86_64.*mage$')" -O appimagetool chmod a+x appimagetool fi mkdir -p $APP.AppDir # ENTER THE APPDIR cd $APP.AppDir || return # SET APPDIR AS A TEMPORARY $HOME DIRECTORY, THIS WILL DO ALL WORK INTO THE APPDIR HOME="$(dirname "$(readlink -f $0)")" # DOWNLOAD AND INSTALL JUNEST (DON'T TOUCH THIS) if ! test -d "$HOME/.local/share/junest"; then git clone https://github.com/fsquillace/junest.git ./.local/share/junest wget -q --show-progress https://github.com/ivan-hc/junest/releases/download/continuous/junest-x86_64.tar.gz ./.local/share/junest/bin/junest setup -i junest-x86_64.tar.gz rm -f junest-x86_64.tar.gz # ENABLE MULTILIB (optional) echo -e "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> ./.junest/etc/pacman.conf # ENABLE LIBSELINUX FROM THIRD PARTY REPOSITORY if [[ $DEPENDENCES = *"libselinux"* ]]; then echo -e "\n[selinux]\nServer = https://github.com/archlinuxhardened/selinux/releases/download/ArchLinux-SELinux\nSigLevel = Never" >> ./.junest/etc/pacman.conf fi # ENABLE CHAOTIC-AUR function _enable_chaoticaur(){ ./.local/share/junest/bin/junest -- sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com ./.local/share/junest/bin/junest -- sudo pacman-key --lsign-key 3056513887B78AEB ./.local/share/junest/bin/junest -- sudo pacman-key --populate chaotic ./.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' echo -e "\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist" >> ./.junest/etc/pacman.conf } ###_enable_chaoticaur # CUSTOM MIRRORLIST, THIS SHOULD SPEEDUP THE INSTALLATION OF THE PACKAGES IN PACMAN (COMMENT EVERYTHING TO USE THE DEFAULT MIRROR) function _custom_mirrorlist(){ #COUNTRY=$(curl -i ipinfo.io | grep country | cut -c 15- | cut -c -2) rm -R ./.junest/etc/pacman.d/mirrorlist wget -q https://archlinux.org/mirrorlist/all/ -O - | awk NR==2 RS= | sed 's/#Server/Server/g' >> ./.junest/etc/pacman.d/mirrorlist # ENABLES WORLDWIDE MIRRORS #wget -q https://archlinux.org/mirrorlist/?country="$(echo $COUNTRY)" -O - | sed 's/#Server/Server/g' >> ./.junest/etc/pacman.d/mirrorlist # ENABLES MIRRORS OF YOUR COUNTY } _custom_mirrorlist # BYPASS SIGNATURE CHECK LEVEL sed -i 's/#SigLevel/SigLevel/g' ./.junest/etc/pacman.conf sed -i 's/Required DatabaseOptional/Never/g' ./.junest/etc/pacman.conf # UPDATE ARCH LINUX IN JUNEST ./.local/share/junest/bin/junest -- sudo pacman -Syy ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -Syu else cd .. rsync -av ./junest-backups/* ./$APP.AppDir/.junest/ rsync -av ./stock-cache/* ./$APP.AppDir/.cache/ rsync -av ./stock-local/* ./$APP.AppDir/.local/ cd ./$APP.AppDir || return fi # INSTALL THE PROGRAM USING YAY ./.local/share/junest/bin/junest -- yay -Syy ./.local/share/junest/bin/junest -- gpg --keyserver keyserver.ubuntu.com --recv-key C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF # UNCOMMENT IF YOU USE THE AUR ./.local/share/junest/bin/junest -- yay --noconfirm -S gnu-free-fonts $(echo "$BASICSTUFF $COMPILERS") ./.local/share/junest/bin/junest -- yay --noconfirm -S $(echo "$DEPENDENCES $APP") # DO A BACKUP OF THE CURRENT STATE OF JUNEST cd .. mkdir -p ./junest-backups mkdir -p ./stock-cache mkdir -p ./stock-local rsync -av --ignore-existing ./$APP.AppDir/.junest/* ./junest-backups/ rsync -av --ignore-existing ./$APP.AppDir/.cache/* ./stock-cache/ rsync -av --ignore-existing ./$APP.AppDir/.local/* ./stock-local/ cd ./$APP.AppDir || return # SET THE LOCALE (DON'T TOUCH THIS) #sed "s/# /#>/g" ./.junest/etc/locale.gen | sed "s/#//g" | sed "s/>/#/g" >> ./locale.gen # UNCOMMENT TO ENABLE ALL THE LANGUAGES #sed "s/#$(echo $LANG)/$(echo $LANG)/g" ./.junest/etc/locale.gen >> ./locale.gen # ENABLE ONLY YOUR LANGUAGE, COMMENT IF YOU NEED MORE THAN ONE #rm ./.junest/etc/locale.gen #mv ./locale.gen ./.junest/etc/locale.gen rm ./.junest/etc/locale.conf #echo "LANG=$LANG" >> ./.junest/etc/locale.conf sed -i 's/LANG=${LANG:-C}/LANG=$LANG/g' ./.junest/etc/profile.d/locale.sh #./.local/share/junest/bin/junest -- sudo pacman --noconfirm -S glibc gzip #./.local/share/junest/bin/junest -- sudo locale-gen # ...ADD THE ICON AND THE DESKTOP FILE AT THE ROOT OF THE APPDIR... rm -R -f ./*.desktop LAUNCHER=$(grep -iRl $BIN ./.junest/usr/share/applications/* | grep ".desktop" | head -1) cp -r "$LAUNCHER" ./ ICON=$(cat $LAUNCHER | grep "Icon=" | cut -c 6-) cp -r ./.junest/usr/share/icons/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/22x22/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/24x24/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/32x32/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/48x48/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/64x64/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/128x128/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/192x192/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/256x256/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/512x512/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/scalable/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/pixmaps/*"$ICON"* ./ 2>/dev/null # MOVE OCENAUDIO TO /usr/share mv ./.junest/opt/$APP ./.junest/usr/share/$APP # TEST IF THE DESKTOP FILE AND THE ICON ARE IN THE ROOT OF THE FUTURE APPIMAGE (./*AppDir/*) if test -f ./*.desktop; then echo "The .desktop file is available in $APP.AppDir/" else if test -f ./.junest/usr/bin/$BIN; then echo "No .desktop file available for $APP, creating a new one..." cat <<-HEREDOC >> "./$APP.desktop" [Desktop Entry] Version=1.0 Type=Application Name=NAME Comment= Exec=BINARY Icon=tux Categories=Utility; Terminal=true StartupNotify=true HEREDOC sed -i "s#BINARY#$BIN#g" ./$APP.desktop sed -i "s#Name=NAME#Name=$(echo $APP | tr a-z A-Z)#g" ./$APP.desktop wget https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/favicon.ico -O ./tux.png else echo "No binary in path... aborting all the processes." exit fi fi # ...AND FINALLY CREATE THE APPRUN, IE THE MAIN SCRIPT TO RUN THE APPIMAGE! # EDIT THE FOLLOWING LINES IF YOU THINK SOME ENVIRONMENT VARIABLES ARE MISSING rm -R -f ./AppRun cat >> ./AppRun << 'EOF' #!/bin/sh HERE="$(dirname "$(readlink -f $0)")" export UNION_PRELOAD=$HERE export JUNEST_HOME=$HERE/.junest export PATH=$PATH:$HERE/.local/share/junest/bin if test -d /media; then MNT_MEDIA=' --bind /media /media ' fi if test -f /etc/resolv.conf; then ETC_RESOLV=' --bind /etc/resolv.conf /etc/resolv.conf ' # NEEDED TO CONNECT THE INTERNET fi BINDS=" $MNT_MEDIA $ETC_RESOLV " if test -f $JUNEST_HOME/usr/lib/libselinux.so; then export LD_LIBRARY_PATH=/lib/:/lib64/:/lib/x86_64-linux-gnu/:/usr/lib/:"${LD_LIBRARY_PATH}" fi EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') $HERE/.local/share/junest/bin/junest -n -b "$BINDS" -- /usr/share/infra-arcana/ia "$@" EOF chmod a+x ./AppRun # REMOVE "READ-ONLY FILE SYSTEM" ERRORS sed -i 's#${JUNEST_HOME}/usr/bin/junest_wrapper#${HOME}/.cache/junest_wrapper.old#g' ./.local/share/junest/lib/core/wrappers.sh 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 sed -i 's/ln/#ln/g' ./.local/share/junest/lib/core/wrappers.sh sed -i 's#--bind "$HOME" "$HOME"#--bind /opt /opt --bind /usr/lib/locale /usr/lib/locale --bind /usr/share/fonts /usr/share/fonts --bind /usr/share/themes /usr/share/themes --bind /mnt /mnt --bind /home /home --bind /run/user /run/user#g' .local/share/junest/lib/core/namespace.sh sed -i 's/rm -f "$file"/test -f "$file"/g' ./.local/share/junest/lib/core/wrappers.sh # EXIT THE APPDIR cd .. # EXTRACT PACKAGE CONTENT mkdir -p base rm -R -f ./base/* tar fx "$(find ./$APP.AppDir -name "$APP-[0-9]*zst" | head -1)" -C ./base/ VERSION=$(cat ./base/.PKGINFO | grep pkgver | cut -c 10- | sed 's@.*:@@') mkdir -p deps rm -R -f ./deps/* ARGS=$(echo "$DEPENDENCES" | tr " " "\n") for arg in $ARGS; do tar fx "$(find ./$APP.AppDir -name "$arg-[0-9]*zst")" -C ./deps/ cat ./deps/.PKGINFO | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps done DEPS=$(cat ./base/.PKGINFO | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<") for arg in $DEPS; do tar fx "$(find ./$APP.AppDir -name "$arg-[0-9]*zst")" -C ./deps/ cat ./deps/.PKGINFO | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps done DEPS2=$(cat ./depdeps | uniq) for arg in $DEPS2; do tar fx "$(find ./$APP.AppDir -name "$arg-[0-9]*zst")" -C ./deps/ cat ./deps/.PKGINFO | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps2 done DEPS3=$(cat ./depdeps2 | uniq) for arg in $DEPS3; do tar fx "$(find ./$APP.AppDir -name "$arg-[0-9]*zst")" -C ./deps/ cat ./deps/.PKGINFO | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps3 done DEPS4=$(cat ./depdeps3 | uniq) for arg in $DEPS4; do tar fx "$(find ./$APP.AppDir -name "$arg-[0-9]*zst")" -C ./deps/ cat ./deps/.PKGINFO | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps4 done # REMOVE SOME BLOATWARES echo Y | rm -R -f ./$APP.AppDir/.cache/yay/* find ./$APP.AppDir/.junest/usr/share/doc/* -not -iname "*$BIN*" -a -not -name "." -delete #REMOVE ALL DOCUMENTATION NOT RELATED TO THE APP find ./$APP.AppDir/.junest/usr/share/locale/*/*/* -not -iname "*$BIN*" -a -not -name "." -delete #REMOVE ALL ADDITIONAL LOCALE FILES rm -R -f ./$APP.AppDir/.junest/etc/makepkg.conf rm -R -f ./$APP.AppDir/.junest/etc/pacman.conf rm -R -f ./$APP.AppDir/.junest/usr/include #FILES RELATED TO THE COMPILER rm -R -f ./$APP.AppDir/.junest/usr/man #APPIMAGES ARE NOT MENT TO HAVE MAN COMMAND rm -R -f ./$APP.AppDir/.junest/var/* #REMOVE ALL PACKAGES DOWNLOADED WITH THE PACKAGE MANAGER # SAVE FILES USING KEYWORDS BINSAVED="certificates SAVEBINSPLEASE" # Enter here keywords to find and save in /usr/bin SHARESAVED="certificates SAVESHAREPLEASE" # Enter here keywords or file/folder names to save in both /usr/share and /usr/lib LIBSAVED="pk p11 alsa jack pipewire pulse SAVELIBSPLEASE" # Enter here keywords or file/folder names to save in /usr/lib # STEP 2, FUNCTION TO SAVE THE BINARIES IN /usr/bin THAT ARE NEEDED TO MADE JUNEST WORK, PLUS THE MAIN BINARY/BINARIES OF THE APP # IF YOU NEED TO SAVE MORE BINARIES, LIST THEM IN THE "BINSAVED" VARIABLE. COMMENT THE LINE "_savebins" IF YOU ARE NOT SURE. function _savebins(){ mkdir save mv ./$APP.AppDir/.junest/usr/bin/*$BIN* ./save/ mv ./$APP.AppDir/.junest/usr/bin/bash ./save/ mv ./$APP.AppDir/.junest/usr/bin/bwrap ./save/ mv ./$APP.AppDir/.junest/usr/bin/env ./save/ mv ./$APP.AppDir/.junest/usr/bin/sh ./save/ mv ./$APP.AppDir/.junest/usr/bin/tr ./save/ mv ./$APP.AppDir/.junest/usr/bin/tty ./save/ for arg in $BINSAVED; do mv ./$APP.AppDir/.junest/usr/bin/*"$arg"* ./save/ done rm -R -f ./$APP.AppDir/.junest/usr/bin/* mv ./save/* ./$APP.AppDir/.junest/usr/bin/ rmdir save } _savebins 2> /dev/null # STEP 3, MOVE UNNECESSARY LIBRARIES TO A BACKUP FOLDER (FOR TESTING PURPOSES) mkdir save function _binlibs(){ readelf -d ./$APP.AppDir/.junest/usr/bin/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list mv ./$APP.AppDir/.junest/usr/lib/ld-linux-x86-64.so* ./save/ mv ./$APP.AppDir/.junest/usr/lib/*$APP* ./save/ mv ./$APP.AppDir/.junest/usr/lib/*$BIN* ./save/ mv ./$APP.AppDir/.junest/usr/lib/libdw* ./save/ mv ./$APP.AppDir/.junest/usr/lib/libelf* ./save/ for arg in $SHARESAVED; do mv ./$APP.AppDir/.junest/usr/lib/*"$arg"* ./save/ done ARGS=$(tail -n +2 ./list | sort -u | uniq) for arg in $ARGS; do mv ./$APP.AppDir/.junest/usr/lib/$arg* ./save/ find ./$APP.AppDir/.junest/usr/lib/ -name "$arg" -exec cp -r --parents -t save/ {} + done rm -R -f "$(find ./save/ | sort | grep ".AppDir" | head -1)" rm list } function _include_swrast_dri(){ mkdir ./save/dri mv ./$APP.AppDir/.junest/usr/lib/dri/swrast_dri.so ./save/dri/ } function _libkeywords(){ for arg in $LIBSAVED; do mv ./$APP.AppDir/.junest/usr/lib/*"$arg"* ./save/ done } function _liblibs(){ readelf -d ./save/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./save/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./save/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./save/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./save/*/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/*/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/*/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list ARGS=$(tail -n +2 ./list | sort -u | uniq) for arg in $ARGS; do mv ./$APP.AppDir/.junest/usr/lib/"$arg"* ./save/ find ./$APP.AppDir/.junest/usr/lib/ -name "$arg" -exec cp -r --parents -t save/ {} + done rsync -av ./save/$APP.AppDir/.junest/usr/lib/* ./save/ rm -R -f "$(find ./save/ | sort | grep ".AppDir" | head -1)" rm list } function _mvlibs(){ rm -R -f ./$APP.AppDir/.junest/usr/lib/* mv ./save/* ./$APP.AppDir/.junest/usr/lib/ } _binlibs 2> /dev/null #_include_swrast_dri 2> /dev/null _libkeywords 2> /dev/null _liblibs 2> /dev/null _liblibs 2> /dev/null _liblibs 2> /dev/null _liblibs 2> /dev/null _liblibs 2> /dev/null _mvlibs 2> /dev/null rmdir save # STEP 4, SAVE ONLY SOME DIRECTORIES CONTAINED IN /usr/share # IF YOU NEED TO SAVE MORE FOLDERS, LIST THEM IN THE "SHARESAVED" VARIABLE. COMMENT THE LINE "_saveshare" IF YOU ARE NOT SURE. function _saveshare(){ mkdir save mv ./$APP.AppDir/.junest/usr/share/*$APP* ./save/ mv ./$APP.AppDir/.junest/usr/share/*$BIN* ./save/ mv ./$APP.AppDir/.junest/usr/share/fontconfig ./save/ mv ./$APP.AppDir/.junest/usr/share/glib-* ./save/ mv ./$APP.AppDir/.junest/usr/share/locale ./save/ mv ./$APP.AppDir/.junest/usr/share/mime ./save/ mv ./$APP.AppDir/.junest/usr/share/wayland ./save/ mv ./$APP.AppDir/.junest/usr/share/X11 ./save/ for arg in $SHARESAVED; do mv ./$APP.AppDir/.junest/usr/share/*"$arg"* ./save/ done rm -R -f ./$APP.AppDir/.junest/usr/share/* mv ./save/* ./$APP.AppDir/.junest/usr/share/ rmdir save } _saveshare 2> /dev/null # RSYNC THE CONTENT OF THE APP'S PACKAGE rm -R -f ./base/.* rsync -av ./base/* ./$APP.AppDir/.junest/ # RSYNC DEPENDENCES rm -R -f ./deps/.* rsync -av ./deps/* ./$APP.AppDir/.junest/ # ADDITIONAL REMOVALS #rm -R -f ./$APP.AppDir/.junest/usr/lib/libLLVM-* #INCLUDED IN THE COMPILATION PHASE, CAN SOMETIMES BE EXCLUDED FOR DAILY USE rm -R -f ./$APP.AppDir/.junest/usr/lib/python*/__pycache__/* #IF PYTHON IS INSTALLED, REMOVING THIS DIRECTORY CAN SAVE SEVERAL MEGABYTES rm -R -f ./$APP.AppDir/.junest/opt/$APP # REMOVE THE INBUILT HOME rm -R -f ./$APP.AppDir/.junest/home # ENABLE MOUNTPOINTS mkdir -p ./$APP.AppDir/.junest/home mkdir -p ./$APP.AppDir/.junest/media mkdir -p ./$APP.AppDir/.junest/usr/lib/locale mkdir -p ./$APP.AppDir/.junest/usr/share/fonts mkdir -p ./$APP.AppDir/.junest/usr/share/themes mkdir -p ./$APP.AppDir/.junest/run/user # CREATE THE APPIMAGE if test -f ./*.AppImage; then rm -R -f ./*archimage*.AppImage fi ARCH=x86_64 VERSION=$(./appimagetool -v | grep -o '[[:digit:]]*') ./appimagetool -s ./$APP.AppDir mv ./*AppImage ./"$(cat ./$APP.AppDir/*.desktop | grep 'Name=' | head -1 | cut -c 6- | sed 's/ /-/g')"_"$VERSION"-archimage3.4-x86_64.AppImage ```

for now I only get an error about missing dsp device and failed to init SDL, I'll try to fix it. In the meantime, compare the two scripts, try to run this one on your PC and, if it fails, check what are the missing commands on your host system.

PS: is AppStream installed on your system? this new version on Appimagetool I use needs it to validate and bundle the AppImages.

ivan-hc commented 5 months ago

From LD_DEBUG=libs ./*AppImage:

     40835: find library=libpipewire-0.3.so.0 [0]; searching
     40835:  search cache=/etc/ld.so.cache
     40835:   trying file=/usr/lib/libpipewire-0.3.so.0
     40835: 
     40835: 
     40835: calling init: /usr/lib/libpipewire-0.3.so.0
     40835: 
[E] pw.loop [loop.c:67 pw_loop_new()] 0x2367ec0: can't make support.system handle: No such file or directory
     40835: 
     40835: calling fini: /usr/lib/libpipewire-0.3.so.0 [0]
     40835: 
ERROR: Failed to init SDL
dsp: No such audio device

also installing "libpipewire" does not solves the issue.

I don't know what "infra-arcana" is, but it seems to be dependent from a Pipewire-related dependence I don't know

ivan-hc commented 5 months ago

I've solved the above by changing DEPENDENCES like this:

DEPENDENCES="ca-certificates libpipewire pipewire"

however I get another error

     50469: calling fini: /usr/lib/pipewire-0.3/libpipewire-module-rt.so [0]
     50469: 
ERROR: Failed to init SDL_mixer
Pipewire: Failed to connect stream
ERROR: Failed to find or read xml file at: data/colors/colors.xml
tinyxml2 reported error: XML_ERROR_FILE_NOT_FOUND

that is related to a "colors.xml" file that should be in /opt, while we have moved all in /usr/share

I need to mount /opt because my package manager "AM" installs all apps there, so symlinks are not recognized if the directory on the host system is not detected. This is the bad of JuNest container into an AppImage.

ivan-hc commented 5 months ago

I've started a new test by removing /opt in the mountpoints and installing infra-arcana in /opt as it should be.

Also I added the following dependences listed on the AUR: " sdl2_image and sdl2_mixer"

So DEPENDENCES loks like this:

DEPENDENCES="ca-certificates libpipewire pipewire sdl2_image sdl2_mixer"

the result is the app is stuck with this message (without interrupting its running):

     87024: calling fini: /usr/lib/pipewire-0.3/libpipewire-module-rt.so [0]
     87024: 
ERROR: Failed to init SDL_mixer
Pipewire: Failed to connect stream

so the error related to "colors.xml" is disappeared.

You should investigate on why we have this SDL error. I'm not an expert about SDL, Pipewire and similar stuff.

I'll copy/paste the experimental script I used here:

Click here ``` #!/usr/bin/env bash # NAME OF THE APP BY REPLACING "SAMPLE" APP=infra-arcana BIN="$APP" #CHANGE THIS IF THE NAME OF THE BINARY IS DIFFERENT FROM "$APP" (for example, the binary of "obs-studio" is "obs") DEPENDENCES="ca-certificates libpipewire pipewire sdl2_image sdl2_mixer" BASICSTUFF="binutils debugedit gzip" COMPILERS="base-devel" # CREATE THE APPDIR (DON'T TOUCH THIS)... if ! test -f ./appimagetool; then wget -q "$(wget -q https://api.github.com/repos/probonopd/go-appimage/releases -O - | sed 's/"/ /g; s/ /\n/g' | grep -o 'https.*continuous.*tool.*86_64.*mage$')" -O appimagetool chmod a+x appimagetool fi mkdir -p $APP.AppDir # ENTER THE APPDIR cd $APP.AppDir || return # SET APPDIR AS A TEMPORARY $HOME DIRECTORY, THIS WILL DO ALL WORK INTO THE APPDIR HOME="$(dirname "$(readlink -f $0)")" # DOWNLOAD AND INSTALL JUNEST (DON'T TOUCH THIS) if ! test -d "$HOME/.local/share/junest"; then git clone https://github.com/fsquillace/junest.git ./.local/share/junest wget -q --show-progress https://github.com/ivan-hc/junest/releases/download/continuous/junest-x86_64.tar.gz ./.local/share/junest/bin/junest setup -i junest-x86_64.tar.gz rm -f junest-x86_64.tar.gz # ENABLE MULTILIB (optional) echo -e "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> ./.junest/etc/pacman.conf # ENABLE LIBSELINUX FROM THIRD PARTY REPOSITORY if [[ $DEPENDENCES = *"libselinux"* ]]; then echo -e "\n[selinux]\nServer = https://github.com/archlinuxhardened/selinux/releases/download/ArchLinux-SELinux\nSigLevel = Never" >> ./.junest/etc/pacman.conf fi # ENABLE CHAOTIC-AUR function _enable_chaoticaur(){ ./.local/share/junest/bin/junest -- sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com ./.local/share/junest/bin/junest -- sudo pacman-key --lsign-key 3056513887B78AEB ./.local/share/junest/bin/junest -- sudo pacman-key --populate chaotic ./.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' echo -e "\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist" >> ./.junest/etc/pacman.conf } ###_enable_chaoticaur # CUSTOM MIRRORLIST, THIS SHOULD SPEEDUP THE INSTALLATION OF THE PACKAGES IN PACMAN (COMMENT EVERYTHING TO USE THE DEFAULT MIRROR) function _custom_mirrorlist(){ #COUNTRY=$(curl -i ipinfo.io | grep country | cut -c 15- | cut -c -2) rm -R ./.junest/etc/pacman.d/mirrorlist wget -q https://archlinux.org/mirrorlist/all/ -O - | awk NR==2 RS= | sed 's/#Server/Server/g' >> ./.junest/etc/pacman.d/mirrorlist # ENABLES WORLDWIDE MIRRORS #wget -q https://archlinux.org/mirrorlist/?country="$(echo $COUNTRY)" -O - | sed 's/#Server/Server/g' >> ./.junest/etc/pacman.d/mirrorlist # ENABLES MIRRORS OF YOUR COUNTY } _custom_mirrorlist # BYPASS SIGNATURE CHECK LEVEL sed -i 's/#SigLevel/SigLevel/g' ./.junest/etc/pacman.conf sed -i 's/Required DatabaseOptional/Never/g' ./.junest/etc/pacman.conf # UPDATE ARCH LINUX IN JUNEST ./.local/share/junest/bin/junest -- sudo pacman -Syy ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -Syu else cd .. rsync -av ./junest-backups/* ./$APP.AppDir/.junest/ rsync -av ./stock-cache/* ./$APP.AppDir/.cache/ rsync -av ./stock-local/* ./$APP.AppDir/.local/ cd ./$APP.AppDir || return fi # INSTALL THE PROGRAM USING YAY ./.local/share/junest/bin/junest -- yay -Syy ./.local/share/junest/bin/junest -- gpg --keyserver keyserver.ubuntu.com --recv-key C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF # UNCOMMENT IF YOU USE THE AUR ./.local/share/junest/bin/junest -- yay --noconfirm -S gnu-free-fonts $(echo "$BASICSTUFF $COMPILERS") ./.local/share/junest/bin/junest -- yay --noconfirm -S $(echo "$DEPENDENCES $APP") # DO A BACKUP OF THE CURRENT STATE OF JUNEST cd .. mkdir -p ./junest-backups mkdir -p ./stock-cache mkdir -p ./stock-local rsync -av --ignore-existing ./$APP.AppDir/.junest/* ./junest-backups/ rsync -av --ignore-existing ./$APP.AppDir/.cache/* ./stock-cache/ rsync -av --ignore-existing ./$APP.AppDir/.local/* ./stock-local/ cd ./$APP.AppDir || return # SET THE LOCALE (DON'T TOUCH THIS) #sed "s/# /#>/g" ./.junest/etc/locale.gen | sed "s/#//g" | sed "s/>/#/g" >> ./locale.gen # UNCOMMENT TO ENABLE ALL THE LANGUAGES #sed "s/#$(echo $LANG)/$(echo $LANG)/g" ./.junest/etc/locale.gen >> ./locale.gen # ENABLE ONLY YOUR LANGUAGE, COMMENT IF YOU NEED MORE THAN ONE #rm ./.junest/etc/locale.gen #mv ./locale.gen ./.junest/etc/locale.gen rm ./.junest/etc/locale.conf #echo "LANG=$LANG" >> ./.junest/etc/locale.conf sed -i 's/LANG=${LANG:-C}/LANG=$LANG/g' ./.junest/etc/profile.d/locale.sh #./.local/share/junest/bin/junest -- sudo pacman --noconfirm -S glibc gzip #./.local/share/junest/bin/junest -- sudo locale-gen # ...ADD THE ICON AND THE DESKTOP FILE AT THE ROOT OF THE APPDIR... rm -R -f ./*.desktop LAUNCHER=$(grep -iRl $BIN ./.junest/usr/share/applications/* | grep ".desktop" | head -1) cp -r "$LAUNCHER" ./ ICON=$(cat $LAUNCHER | grep "Icon=" | cut -c 6-) cp -r ./.junest/usr/share/icons/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/22x22/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/24x24/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/32x32/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/48x48/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/64x64/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/128x128/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/192x192/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/256x256/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/512x512/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/scalable/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/pixmaps/*"$ICON"* ./ 2>/dev/null # MOVE OCENAUDIO TO /usr/share #mv ./.junest/opt/$APP ./.junest/usr/share/$APP # TEST IF THE DESKTOP FILE AND THE ICON ARE IN THE ROOT OF THE FUTURE APPIMAGE (./*AppDir/*) if test -f ./*.desktop; then echo "The .desktop file is available in $APP.AppDir/" else if test -f ./.junest/usr/bin/$BIN; then echo "No .desktop file available for $APP, creating a new one..." cat <<-HEREDOC >> "./$APP.desktop" [Desktop Entry] Version=1.0 Type=Application Name=NAME Comment= Exec=BINARY Icon=tux Categories=Utility; Terminal=true StartupNotify=true HEREDOC sed -i "s#BINARY#$BIN#g" ./$APP.desktop sed -i "s#Name=NAME#Name=$(echo $APP | tr a-z A-Z)#g" ./$APP.desktop wget https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/favicon.ico -O ./tux.png else echo "No binary in path... aborting all the processes." exit fi fi # ...AND FINALLY CREATE THE APPRUN, IE THE MAIN SCRIPT TO RUN THE APPIMAGE! # EDIT THE FOLLOWING LINES IF YOU THINK SOME ENVIRONMENT VARIABLES ARE MISSING rm -R -f ./AppRun cat >> ./AppRun << 'EOF' #!/bin/sh HERE="$(dirname "$(readlink -f $0)")" export UNION_PRELOAD=$HERE export JUNEST_HOME=$HERE/.junest export PATH=$PATH:$HERE/.local/share/junest/bin if test -d /media; then MNT_MEDIA=' --bind /media /media ' fi if test -f /etc/resolv.conf; then ETC_RESOLV=' --bind /etc/resolv.conf /etc/resolv.conf ' # NEEDED TO CONNECT THE INTERNET fi BINDS=" $MNT_MEDIA $ETC_RESOLV " if test -f $JUNEST_HOME/usr/lib/libselinux.so; then export LD_LIBRARY_PATH=/lib/:/lib64/:/lib/x86_64-linux-gnu/:/usr/lib/:"${LD_LIBRARY_PATH}" fi EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') $HERE/.local/share/junest/bin/junest -n -b "$BINDS" -- $EXEC "$@" EOF chmod a+x ./AppRun # REMOVE "READ-ONLY FILE SYSTEM" ERRORS sed -i 's#${JUNEST_HOME}/usr/bin/junest_wrapper#${HOME}/.cache/junest_wrapper.old#g' ./.local/share/junest/lib/core/wrappers.sh 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 sed -i 's/ln/#ln/g' ./.local/share/junest/lib/core/wrappers.sh sed -i 's#--bind "$HOME" "$HOME"#--bind /usr/lib/locale /usr/lib/locale --bind /usr/share/fonts /usr/share/fonts --bind /usr/share/themes /usr/share/themes --bind /mnt /mnt --bind /home /home --bind /run/user /run/user#g' .local/share/junest/lib/core/namespace.sh sed -i 's/rm -f "$file"/test -f "$file"/g' ./.local/share/junest/lib/core/wrappers.sh # EXIT THE APPDIR cd .. # EXTRACT PACKAGE CONTENT mkdir -p base rm -R -f ./base/* tar fx "$(find ./$APP.AppDir -name "$APP-[0-9]*zst" | head -1)" -C ./base/ VERSION=$(cat ./base/.PKGINFO | grep pkgver | cut -c 10- | sed 's@.*:@@') mkdir -p deps rm -R -f ./deps/* ARGS=$(echo "$DEPENDENCES" | tr " " "\n") for arg in $ARGS; do tar fx "$(find ./$APP.AppDir -name "$arg-[0-9]*zst")" -C ./deps/ cat ./deps/.PKGINFO | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps done DEPS=$(cat ./base/.PKGINFO | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<") for arg in $DEPS; do tar fx "$(find ./$APP.AppDir -name "$arg-[0-9]*zst")" -C ./deps/ cat ./deps/.PKGINFO | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps done DEPS2=$(cat ./depdeps | uniq) for arg in $DEPS2; do tar fx "$(find ./$APP.AppDir -name "$arg-[0-9]*zst")" -C ./deps/ cat ./deps/.PKGINFO | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps2 done DEPS3=$(cat ./depdeps2 | uniq) for arg in $DEPS3; do tar fx "$(find ./$APP.AppDir -name "$arg-[0-9]*zst")" -C ./deps/ cat ./deps/.PKGINFO | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps3 done DEPS4=$(cat ./depdeps3 | uniq) for arg in $DEPS4; do tar fx "$(find ./$APP.AppDir -name "$arg-[0-9]*zst")" -C ./deps/ cat ./deps/.PKGINFO | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps4 done # REMOVE SOME BLOATWARES echo Y | rm -R -f ./$APP.AppDir/.cache/yay/* find ./$APP.AppDir/.junest/usr/share/doc/* -not -iname "*$BIN*" -a -not -name "." -delete #REMOVE ALL DOCUMENTATION NOT RELATED TO THE APP find ./$APP.AppDir/.junest/usr/share/locale/*/*/* -not -iname "*$BIN*" -a -not -name "." -delete #REMOVE ALL ADDITIONAL LOCALE FILES rm -R -f ./$APP.AppDir/.junest/etc/makepkg.conf rm -R -f ./$APP.AppDir/.junest/etc/pacman.conf rm -R -f ./$APP.AppDir/.junest/usr/include #FILES RELATED TO THE COMPILER rm -R -f ./$APP.AppDir/.junest/usr/man #APPIMAGES ARE NOT MENT TO HAVE MAN COMMAND rm -R -f ./$APP.AppDir/.junest/var/* #REMOVE ALL PACKAGES DOWNLOADED WITH THE PACKAGE MANAGER # SAVE FILES USING KEYWORDS BINSAVED="certificates SAVEBINSPLEASE" # Enter here keywords to find and save in /usr/bin SHARESAVED="certificates SAVESHAREPLEASE" # Enter here keywords or file/folder names to save in both /usr/share and /usr/lib LIBSAVED="pk p11 alsa jack pipewire pulse SAVELIBSPLEASE" # Enter here keywords or file/folder names to save in /usr/lib # STEP 2, FUNCTION TO SAVE THE BINARIES IN /usr/bin THAT ARE NEEDED TO MADE JUNEST WORK, PLUS THE MAIN BINARY/BINARIES OF THE APP # IF YOU NEED TO SAVE MORE BINARIES, LIST THEM IN THE "BINSAVED" VARIABLE. COMMENT THE LINE "_savebins" IF YOU ARE NOT SURE. function _savebins(){ mkdir save mv ./$APP.AppDir/.junest/usr/bin/*$BIN* ./save/ mv ./$APP.AppDir/.junest/usr/bin/bash ./save/ mv ./$APP.AppDir/.junest/usr/bin/bwrap ./save/ mv ./$APP.AppDir/.junest/usr/bin/env ./save/ mv ./$APP.AppDir/.junest/usr/bin/sh ./save/ mv ./$APP.AppDir/.junest/usr/bin/tr ./save/ mv ./$APP.AppDir/.junest/usr/bin/tty ./save/ for arg in $BINSAVED; do mv ./$APP.AppDir/.junest/usr/bin/*"$arg"* ./save/ done rm -R -f ./$APP.AppDir/.junest/usr/bin/* mv ./save/* ./$APP.AppDir/.junest/usr/bin/ rmdir save } _savebins 2> /dev/null # STEP 3, MOVE UNNECESSARY LIBRARIES TO A BACKUP FOLDER (FOR TESTING PURPOSES) mkdir save function _binlibs(){ readelf -d ./$APP.AppDir/.junest/usr/bin/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list mv ./$APP.AppDir/.junest/usr/lib/ld-linux-x86-64.so* ./save/ mv ./$APP.AppDir/.junest/usr/lib/*$APP* ./save/ mv ./$APP.AppDir/.junest/usr/lib/*$BIN* ./save/ mv ./$APP.AppDir/.junest/usr/lib/libdw* ./save/ mv ./$APP.AppDir/.junest/usr/lib/libelf* ./save/ for arg in $SHARESAVED; do mv ./$APP.AppDir/.junest/usr/lib/*"$arg"* ./save/ done ARGS=$(tail -n +2 ./list | sort -u | uniq) for arg in $ARGS; do mv ./$APP.AppDir/.junest/usr/lib/$arg* ./save/ find ./$APP.AppDir/.junest/usr/lib/ -name "$arg" -exec cp -r --parents -t save/ {} + done rm -R -f "$(find ./save/ | sort | grep ".AppDir" | head -1)" rm list } function _include_swrast_dri(){ mkdir ./save/dri mv ./$APP.AppDir/.junest/usr/lib/dri/swrast_dri.so ./save/dri/ } function _libkeywords(){ for arg in $LIBSAVED; do mv ./$APP.AppDir/.junest/usr/lib/*"$arg"* ./save/ done } function _liblibs(){ readelf -d ./save/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./save/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./save/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./save/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./save/*/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/*/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/*/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list ARGS=$(tail -n +2 ./list | sort -u | uniq) for arg in $ARGS; do mv ./$APP.AppDir/.junest/usr/lib/"$arg"* ./save/ find ./$APP.AppDir/.junest/usr/lib/ -name "$arg" -exec cp -r --parents -t save/ {} + done rsync -av ./save/$APP.AppDir/.junest/usr/lib/* ./save/ rm -R -f "$(find ./save/ | sort | grep ".AppDir" | head -1)" rm list } function _mvlibs(){ rm -R -f ./$APP.AppDir/.junest/usr/lib/* mv ./save/* ./$APP.AppDir/.junest/usr/lib/ } _binlibs 2> /dev/null #_include_swrast_dri 2> /dev/null _libkeywords 2> /dev/null _liblibs 2> /dev/null _liblibs 2> /dev/null _liblibs 2> /dev/null _liblibs 2> /dev/null _liblibs 2> /dev/null _mvlibs 2> /dev/null rmdir save # STEP 4, SAVE ONLY SOME DIRECTORIES CONTAINED IN /usr/share # IF YOU NEED TO SAVE MORE FOLDERS, LIST THEM IN THE "SHARESAVED" VARIABLE. COMMENT THE LINE "_saveshare" IF YOU ARE NOT SURE. function _saveshare(){ mkdir save mv ./$APP.AppDir/.junest/usr/share/*$APP* ./save/ mv ./$APP.AppDir/.junest/usr/share/*$BIN* ./save/ mv ./$APP.AppDir/.junest/usr/share/fontconfig ./save/ mv ./$APP.AppDir/.junest/usr/share/glib-* ./save/ mv ./$APP.AppDir/.junest/usr/share/locale ./save/ mv ./$APP.AppDir/.junest/usr/share/mime ./save/ mv ./$APP.AppDir/.junest/usr/share/wayland ./save/ mv ./$APP.AppDir/.junest/usr/share/X11 ./save/ for arg in $SHARESAVED; do mv ./$APP.AppDir/.junest/usr/share/*"$arg"* ./save/ done rm -R -f ./$APP.AppDir/.junest/usr/share/* mv ./save/* ./$APP.AppDir/.junest/usr/share/ rmdir save } _saveshare 2> /dev/null # RSYNC THE CONTENT OF THE APP'S PACKAGE rm -R -f ./base/.* rsync -av ./base/* ./$APP.AppDir/.junest/ # RSYNC DEPENDENCES rm -R -f ./deps/.* rsync -av ./deps/* ./$APP.AppDir/.junest/ # ADDITIONAL REMOVALS #rm -R -f ./$APP.AppDir/.junest/usr/lib/libLLVM-* #INCLUDED IN THE COMPILATION PHASE, CAN SOMETIMES BE EXCLUDED FOR DAILY USE rm -R -f ./$APP.AppDir/.junest/usr/lib/python*/__pycache__/* #IF PYTHON IS INSTALLED, REMOVING THIS DIRECTORY CAN SAVE SEVERAL MEGABYTES #rm -R -f ./$APP.AppDir/.junest/opt/$APP # REMOVE THE INBUILT HOME rm -R -f ./$APP.AppDir/.junest/home # ENABLE MOUNTPOINTS mkdir -p ./$APP.AppDir/.junest/home mkdir -p ./$APP.AppDir/.junest/media mkdir -p ./$APP.AppDir/.junest/usr/lib/locale mkdir -p ./$APP.AppDir/.junest/usr/share/fonts mkdir -p ./$APP.AppDir/.junest/usr/share/themes mkdir -p ./$APP.AppDir/.junest/run/user # CREATE THE APPIMAGE if test -f ./*.AppImage; then rm -R -f ./*archimage*.AppImage fi ARCH=x86_64 VERSION=$(./appimagetool -v | grep -o '[[:digit:]]*') ./appimagetool -s ./$APP.AppDir mv ./*AppImage ./"$(cat ./$APP.AppDir/*.desktop | grep 'Name=' | head -1 | cut -c 6- | sed 's/ /-/g')"_"$VERSION"-archimage3.4-x86_64.AppImage ```

"experimental" because I don't think it would be suitable for AM Application Manager.

See if you figure out on how to made the AppImage work first.

And again, if you're unable to run this script correctly, take track of the commands used in the script, also install imagemagick and appstream.

Last and more important thing: for any compatibility test, I suggest to install your app inside a normal JuNest installation. From there you will see if it is only an issue related to the missing libraries or if it it the app itself that can't work into this kind of container.

See the original project on which this, Archimage, is based on, at https://github.com/fsquillace/junest

vinniec2 commented 5 months ago

In the meantime see if your app's structure is the same as mine in the screenshots.

/media/date/archimage/archimage/infra6 $ ls -Ax --group-directories-first ./
base                    deps                    infra-arcana.AppDir
junest-backups          stock-cache             stock-local
appimagetool            depdeps                 infra-arcana-junest.sh

In the main dir it seems that I don't have Infra-Arcana...Appimage and ...home

/media/date/archimage/archimage/infra6 $ ls -Ax --group-directories-first ./infr
a-arcana.AppDir/.junest/opt/

opt/ is empty, the infra-arcana dir is in ./junest-backups/opt/

/media/date/archimage/archimage/infra6 $ ls -Ax --group-directories-first ./infra-arcana.AppDir/
.cache                .config               .junest
.local                .wget-hsts            AppRun
infra-arcana.desktop  infra-arcana.png

in ./infra-arcana.AppDir are missing: .gnupg and .DirIcon I keep reading your next posts

vinniec2 commented 5 months ago

I am comparing my version of the generated script with your latest version, so far the differences are:

  1. More DEPENDECES
  2. COMPILERS uncommented
  3. wget -cq (irrelevant)
  4. ./.local/share/junest/bin/junest -- gpg --keyserver keyserver.ubuntu.com --recv-key C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF # UNCOMMENT IF YOU USE THE AUR uncommented .gnupg mentioned before
  5. #mv ./.junest/opt/$APP ./.junest/usr/share/$APP at line 118, I had put the equivalent at line 171 ( mv ./.junest/opt/infra-arcana ./.junest/usr/share/infra-arcana )
  6. You left line 169 unchanged ( $HERE/.local/share/junest/bin/junest -n -b "$BINDS" -- $EXEC "$@" ) instead of variation ( $HERE/.local/share/junest/bin/junest -n -b "$BINDS" -- /usr/share/infra-arcana/ia "$@")
  7. You have changed line 177 binding /usr/lib/locale /usr/lib/locale instead of /opt /opt
  8. canceled change at line 370

I'm going to try running your version now and see what happens. I had already tried junest a few years ago but didn't understand much about how it works.

ivan-hc commented 4 months ago

keep me updated

ivan-hc commented 3 months ago

Any news?

In the meantime I've built this script using the new template

Click here to expand ``` #!/usr/bin/env bash # NAME OF THE APP BY REPLACING "SAMPLE" APP=infra-arcana BIN="$APP" #CHANGE THIS IF THE NAME OF THE BINARY IS DIFFERENT FROM "$APP" (for example, the binary of "obs-studio" is "obs") DEPENDENCES="ca-certificates alsa-lib alsa-utils dbus libpipewire pipewire pipewire-alsa pipewire-audio pulseaudio sdl2 sdl2_image sdl2_mixer" BASICSTUFF="binutils debugedit gzip" COMPILERS="base-devel" # CREATE THE APPDIR (DON'T TOUCH THIS)... if ! test -f ./appimagetool; then wget -q "$(wget -q https://api.github.com/repos/probonopd/go-appimage/releases -O - | sed 's/"/ /g; s/ /\n/g' | grep -o 'https.*continuous.*tool.*86_64.*mage$')" -O appimagetool chmod a+x appimagetool fi mkdir -p "$APP".AppDir # ENTER THE APPDIR cd "$APP".AppDir || return # SET APPDIR AS A TEMPORARY $HOME DIRECTORY, THIS WILL DO ALL WORK INTO THE APPDIR HOME="$(dirname "$(readlink -f $0)")" # DOWNLOAD AND INSTALL JUNEST (DON'T TOUCH THIS) if ! test -d "$HOME/.local/share/junest"; then git clone https://github.com/fsquillace/junest.git ./.local/share/junest if wget --version | head -1 | grep -q ' 1.'; then wget -q --show-progress https://github.com/ivan-hc/junest/releases/download/continuous/junest-x86_64.tar.gz else wget https://github.com/ivan-hc/junest/releases/download/continuous/junest-x86_64.tar.gz fi ./.local/share/junest/bin/junest setup -i junest-x86_64.tar.gz rm -f junest-x86_64.tar.gz # ENABLE MULTILIB (optional) echo -e "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> ./.junest/etc/pacman.conf # ENABLE LIBSELINUX FROM THIRD PARTY REPOSITORY if [[ "$DEPENDENCES" = *"libselinux"* ]]; then echo -e "\n[selinux]\nServer = https://github.com/archlinuxhardened/selinux/releases/download/ArchLinux-SELinux\nSigLevel = Never" >> ./.junest/etc/pacman.conf fi # ENABLE CHAOTIC-AUR function _enable_chaoticaur(){ ./.local/share/junest/bin/junest -- sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com ./.local/share/junest/bin/junest -- sudo pacman-key --lsign-key 3056513887B78AEB ./.local/share/junest/bin/junest -- sudo pacman-key --populate chaotic ./.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' echo -e "\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist" >> ./.junest/etc/pacman.conf } ###_enable_chaoticaur # CUSTOM MIRRORLIST, THIS SHOULD SPEEDUP THE INSTALLATION OF THE PACKAGES IN PACMAN (COMMENT EVERYTHING TO USE THE DEFAULT MIRROR) function _custom_mirrorlist(){ #COUNTRY=$(curl -i ipinfo.io | grep country | cut -c 15- | cut -c -2) rm -R ./.junest/etc/pacman.d/mirrorlist wget -q https://archlinux.org/mirrorlist/all/ -O - | awk NR==2 RS= | sed 's/#Server/Server/g' >> ./.junest/etc/pacman.d/mirrorlist # ENABLES WORLDWIDE MIRRORS #wget -q https://archlinux.org/mirrorlist/?country="$(echo $COUNTRY)" -O - | sed 's/#Server/Server/g' >> ./.junest/etc/pacman.d/mirrorlist # ENABLES MIRRORS OF YOUR COUNTY } _custom_mirrorlist # BYPASS SIGNATURE CHECK LEVEL sed -i 's/#SigLevel/SigLevel/g' ./.junest/etc/pacman.conf sed -i 's/Required DatabaseOptional/Never/g' ./.junest/etc/pacman.conf # UPDATE ARCH LINUX IN JUNEST ./.local/share/junest/bin/junest -- sudo pacman -Syy ./.local/share/junest/bin/junest -- sudo pacman --noconfirm -Syu else cd .. echo "-------------------------------------" echo " RESTORATION OF BACKUPS IN PROGRESS" echo "-------------------------------------" rsync -av ./junest-backups/* ./"$APP".AppDir/.junest/ | echo -e "\n◆ Restore the content of the Arch Linux container, please wait" rsync -av ./stock-cache/* ./"$APP".AppDir/.cache/ | echo "◆ Restore the content of JuNest's ~/.cache directory" rsync -av ./stock-local/* ./"$APP".AppDir/.local/ | echo -e "◆ Restore the content of JuNest's ~/.local directory\n" echo -e "-----------------------------------------------------------\n" cd ./"$APP".AppDir || return fi # INSTALL THE PROGRAM USING YAY ./.local/share/junest/bin/junest -- yay -Syy ./.local/share/junest/bin/junest -- gpg --keyserver keyserver.ubuntu.com --recv-key C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF # UNCOMMENT IF YOU USE THE AUR if [ ! -z "$BASICSTUFF" ]; then ./.local/share/junest/bin/junest -- yay --noconfirm -S "$BASICSTUFF" fi if [ ! -z "$COMPILERS" ]; then ./.local/share/junest/bin/junest -- yay --noconfirm -S "$COMPILERS" fi if [ ! -z "$DEPENDENCES" ]; then ./.local/share/junest/bin/junest -- yay --noconfirm -S "$DEPENDENCES" fi if [ ! -z "$APP" ]; then ./.local/share/junest/bin/junest -- yay --noconfirm -S "$APP" else echo "No app found, exiting" exit 0 fi # DO A BACKUP OF THE CURRENT STATE OF JUNEST cd .. echo -e "\n-----------------------------------------------------------" echo " BACKUP OF JUNEST FOR FURTHER APPIMAGE BUILDING ATTEMPTS" echo "-----------------------------------------------------------" mkdir -p ./junest-backups mkdir -p ./stock-cache mkdir -p ./stock-local rsync -av --ignore-existing ./"$APP".AppDir/.junest/* ./junest-backups/ | echo -e "\n◆ Backup the content of the Arch Linux container, please wait" rsync -av --ignore-existing ./"$APP".AppDir/.cache/* ./stock-cache/ | echo "◆ Backup the content of JuNest's ~/.cache directory" rsync -av --ignore-existing ./"$APP".AppDir/.local/* ./stock-local/ | echo -e "◆ Backup the content of JuNest's ~/.local directory\n" echo -e "-----------------------------------------------------------\n" cd ./"$APP".AppDir || return # SET THE LOCALE (DON'T TOUCH THIS) #sed "s/# /#>/g" ./.junest/etc/locale.gen | sed "s/#//g" | sed "s/>/#/g" >> ./locale.gen # UNCOMMENT TO ENABLE ALL THE LANGUAGES #sed "s/#$(echo $LANG)/$(echo $LANG)/g" ./.junest/etc/locale.gen >> ./locale.gen # ENABLE ONLY YOUR LANGUAGE, COMMENT IF YOU NEED MORE THAN ONE #rm ./.junest/etc/locale.gen #mv ./locale.gen ./.junest/etc/locale.gen rm ./.junest/etc/locale.conf #echo "LANG=$LANG" >> ./.junest/etc/locale.conf sed -i 's/LANG=${LANG:-C}/LANG=$LANG/g' ./.junest/etc/profile.d/locale.sh #./.local/share/junest/bin/junest -- sudo pacman --noconfirm -S glibc gzip #./.local/share/junest/bin/junest -- sudo locale-gen # ...ADD THE ICON AND THE DESKTOP FILE AT THE ROOT OF THE APPDIR... rm -R -f ./*.desktop LAUNCHER=$(grep -iRl $BIN ./.junest/usr/share/applications/* | grep ".desktop" | head -1) cp -r "$LAUNCHER" ./ ICON=$(cat $LAUNCHER | grep "Icon=" | cut -c 6-) cp -r ./.junest/usr/share/icons/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/22x22/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/24x24/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/32x32/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/48x48/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/64x64/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/128x128/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/192x192/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/256x256/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/512x512/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/scalable/apps/*"$ICON"* ./ 2>/dev/null cp -r ./.junest/usr/share/pixmaps/*"$ICON"* ./ 2>/dev/null # TEST IF THE DESKTOP FILE AND THE ICON ARE IN THE ROOT OF THE FUTURE APPIMAGE (./*AppDir/*) if test -f ./*.desktop; then echo -e "◆ The .desktop file is available in $APP.AppDir/\n" elif test -f ./.junest/usr/bin/"$BIN"; then echo -e "◆ No .desktop file available for $APP, creating a new one...\n" cat <<-HEREDOC >> ./"$APP".desktop [Desktop Entry] Version=1.0 Type=Application Name=$(echo "$APP" | tr a-z A-Z) Comment= Exec=$BIN Icon=tux Categories=Utility; Terminal=true StartupNotify=true HEREDOC wget https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/favicon.ico -O ./tux.png else echo "No binary in path... aborting all the processes." exit 0 fi # ...AND FINALLY CREATE THE APPRUN, IE THE MAIN SCRIPT TO RUN THE APPIMAGE! # EDIT THE FOLLOWING LINES IF YOU THINK SOME ENVIRONMENT VARIABLES ARE MISSING rm -R -f ./AppRun cat >> ./AppRun << 'EOF' #!/bin/sh HERE="$(dirname "$(readlink -f $0)")" export UNION_PRELOAD=$HERE export JUNEST_HOME=$HERE/.junest export PATH=$PATH:$HERE/.local/share/junest/bin if test -f /etc/resolv.conf; then ETC_RESOLV=' --bind /etc/resolv.conf /etc/resolv.conf '; fi if test -d /media; then MNT_MEDIA_DIR=' --bind /media /media '; fi if test -d /mnt; then MNT_DIR=' --bind /mnt /mnt '; fi #if test -d /opt; then OPT_DIR=' --bind /opt /opt '; fi if test -d /run/user; then USR_LIB_LOCALE_DIR=' --bind /usr/lib/locale /usr/lib/locale '; fi if test -d /usr/share/fonts; then USR_SHARE_FONTS_DIR=' --bind /usr/share/fonts /usr/share/fonts '; fi if test -d /usr/share/themes; then USR_SHARE_THEMES_DIR=' --bind /usr/share/themes /usr/share/themes '; fi BINDS=" $ETC_RESOLV $MNT_MEDIA_DIR $MNT_DIR $OPT_DIR $USR_LIB_LOCALE_DIR $USR_SHARE_FONTS_DIR $USR_SHARE_THEMES_DIR " if test -f $JUNEST_HOME/usr/lib/libselinux.so; then export LD_LIBRARY_PATH=/lib/:/lib64/:/lib/x86_64-linux-gnu/:/usr/lib/:"${LD_LIBRARY_PATH}" fi EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') $HERE/.local/share/junest/bin/junest -n -b "$BINDS" -- $EXEC "$@" EOF chmod a+x ./AppRun # REMOVE "READ-ONLY FILE SYSTEM" ERRORS sed -i 's#${JUNEST_HOME}/usr/bin/junest_wrapper#${HOME}/.cache/junest_wrapper.old#g' ./.local/share/junest/lib/core/wrappers.sh 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 sed -i 's/ln/#ln/g' ./.local/share/junest/lib/core/wrappers.sh sed -i 's#--bind "$HOME" "$HOME"#--bind /home /home --bind-try /run/user /run/user#g' .local/share/junest/lib/core/namespace.sh sed -i 's/rm -f "$file"/test -f "$file"/g' ./.local/share/junest/lib/core/wrappers.sh # EXIT THE APPDIR cd .. # EXTRACT PACKAGE CONTENT echo "-----------------------------------------------------------" echo " EXTRACTING DEPENDENCES" echo -e "-----------------------------------------------------------\n" mkdir -p base rm -R -f ./base/* tar fx "$(find ./"$APP".AppDir -name "$APP-[0-9]*zst" | head -1)" -C ./base/ VERSION=$(cat ./base/.PKGINFO | grep pkgver | cut -c 10- | sed 's@.*:@@') mkdir -p deps rm -R -f ./deps/* function _download_missing_packages() { localpackage=$(find ./"$APP".AppDir -name "$arg-[0-9]*zst") if ! test -f "$localpackage"; then cd ./"$APP".AppDir ./.local/share/junest/bin/junest -- yay --noconfirm -Sw "$arg" cd .. fi } function _extract_package() { _download_missing_packages &> /dev/null pkgname=$(find ./"$APP".AppDir -name "$arg-[0-9]*zst") if test -f "$pkgname"; then if ! grep -q "$(echo "$pkgname" | sed 's:.*/::')" ./packages 2>/dev/null;then echo "◆ Extracting $(echo "$pkgname" | sed 's:.*/::')" tar fx "$pkgname" -C ./deps/ echo "$(echo "$pkgname" | sed 's:.*/::')" >> ./packages fi fi } ARGS=$(echo "$DEPENDENCES" | tr " " "\n") for arg in $ARGS; do _extract_package cat ./deps/.PKGINFO 2>/dev/null | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps done DEPS=$(cat ./base/.PKGINFO 2>/dev/null | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<") for arg in $DEPS; do _extract_package cat ./deps/.PKGINFO 2>/dev/null | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps done DEPS2=$(cat ./depdeps 2>/dev/null | uniq) for arg in $DEPS2; do _extract_package cat ./deps/.PKGINFO 2>/dev/null | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps2 done DEPS3=$(cat ./depdeps2 2>/dev/null | uniq) for arg in $DEPS3; do _extract_package cat ./deps/.PKGINFO 2>/dev/null | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps3 done DEPS4=$(cat ./depdeps3 2>/dev/null | uniq) for arg in $DEPS4; do _extract_package cat ./deps/.PKGINFO 2>/dev/null | grep "depend = " | grep -v "makedepend = " | cut -c 10- | grep -v "=\|>\|<" > depdeps4 done rm -f ./packages # REMOVE SOME BLOATWARES echo Y | rm -R -f ./"$APP".AppDir/.cache/yay/* find ./"$APP".AppDir/.junest/usr/share/doc/* -not -iname "*$BIN*" -a -not -name "." -delete #REMOVE ALL DOCUMENTATION NOT RELATED TO THE APP find ./"$APP".AppDir/.junest/usr/share/locale/*/*/* -not -iname "*$BIN*" -a -not -name "." -delete #REMOVE ALL ADDITIONAL LOCALE FILES rm -R -f ./"$APP".AppDir/.junest/etc/makepkg.conf rm -R -f ./"$APP".AppDir/.junest/etc/pacman.conf rm -R -f ./"$APP".AppDir/.junest/usr/include #FILES RELATED TO THE COMPILER rm -R -f ./"$APP".AppDir/.junest/usr/man #APPIMAGES ARE NOT MENT TO HAVE MAN COMMAND rm -R -f ./"$APP".AppDir/.junest/var/* #REMOVE ALL PACKAGES DOWNLOADED WITH THE PACKAGE MANAGER echo -e "\n-----------------------------------------------------------" echo " IMPLEMENTING NECESSARY LIBRARIES (MAY TAKE SEVERAL MINUTES)" echo -e "-----------------------------------------------------------\n" # SAVE FILES USING KEYWORDS BINSAVED="certificates pipewire pw-" # Enter here keywords to find and save in /usr/bin SHARESAVED="certificates SAVESHAREPLEASE" # Enter here keywords or file/folder names to save in both /usr/share and /usr/lib LIBSAVED="pk p11 alsa jack pipewire pulse SAVELIBSPLEASE" # Enter here keywords or file/folder names to save in /usr/lib # STEP 2, FUNCTION TO SAVE THE BINARIES IN /usr/bin THAT ARE NEEDED TO MADE JUNEST WORK, PLUS THE MAIN BINARY/BINARIES OF THE APP # IF YOU NEED TO SAVE MORE BINARIES, LIST THEM IN THE "BINSAVED" VARIABLE. COMMENT THE LINE "_savebins" IF YOU ARE NOT SURE. function _savebins(){ mkdir save mv ./"$APP".AppDir/.junest/usr/bin/*$BIN* ./save/ mv ./"$APP".AppDir/.junest/usr/bin/bash ./save/ mv ./"$APP".AppDir/.junest/usr/bin/bwrap ./save/ mv ./"$APP".AppDir/.junest/usr/bin/env ./save/ mv ./"$APP".AppDir/.junest/usr/bin/sh ./save/ mv ./"$APP".AppDir/.junest/usr/bin/tr ./save/ mv ./"$APP".AppDir/.junest/usr/bin/tty ./save/ for arg in $BINSAVED; do mv ./"$APP".AppDir/.junest/usr/bin/*"$arg"* ./save/ done rm -R -f ./"$APP".AppDir/.junest/usr/bin/* mv ./save/* ./"$APP".AppDir/.junest/usr/bin/ rmdir save } _savebins 2> /dev/null # STEP 3, MOVE UNNECESSARY LIBRARIES TO A BACKUP FOLDER (FOR TESTING PURPOSES) mkdir save function _binlibs(){ readelf -d ./"$APP".AppDir/.junest/usr/bin/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list mv ./"$APP".AppDir/.junest/usr/lib/ld-linux-x86-64.so* ./save/ mv ./"$APP".AppDir/.junest/usr/lib/*$APP* ./save/ mv ./"$APP".AppDir/.junest/usr/lib/*$BIN* ./save/ mv ./"$APP".AppDir/.junest/usr/lib/libdw* ./save/ mv ./"$APP".AppDir/.junest/usr/lib/libelf* ./save/ for arg in $SHARESAVED; do mv ./"$APP".AppDir/.junest/usr/lib/*"$arg"* ./save/ done ARGS=$(tail -n +2 ./list | sort -u | uniq) for arg in $ARGS; do mv ./"$APP".AppDir/.junest/usr/lib/$arg* ./save/ find ./"$APP".AppDir/.junest/usr/lib/ -name "$arg" -exec cp -r --parents -t save/ {} + done rm -R -f "$(find ./save/ | sort | grep ".AppDir" | head -1)" rm list } function _include_swrast_dri(){ mkdir ./save/dri mv ./"$APP".AppDir/.junest/usr/lib/dri/swrast_dri.so ./save/dri/ } function _libkeywords(){ for arg in $LIBSAVED; do mv ./"$APP".AppDir/.junest/usr/lib/*"$arg"* ./save/ done } function _liblibs(){ readelf -d ./save/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./save/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./save/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./save/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./save/*/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./base/*/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list readelf -d ./deps/*/*/*/*/* | grep .so | sed 's:.* ::' | cut -c 2- | sed 's/\(^.*so\).*$/\1/' | uniq >> ./list ARGS=$(tail -n +2 ./list | sort -u | uniq) for arg in $ARGS; do mv ./"$APP".AppDir/.junest/usr/lib/"$arg"* ./save/ find ./"$APP".AppDir/.junest/usr/lib/ -name "$arg" -exec cp -r --parents -t save/ {} + done rsync -av ./save/"$APP".AppDir/.junest/usr/lib/* ./save/ rm -R -f "$(find ./save/ | sort | grep ".AppDir" | head -1)" rm list } function _mvlibs(){ rm -R -f ./"$APP".AppDir/.junest/usr/lib/* mv ./save/* ./"$APP".AppDir/.junest/usr/lib/ } _binlibs 2> /dev/null #_include_swrast_dri 2> /dev/null _libkeywords 2> /dev/null _liblibs 2> /dev/null _liblibs 2> /dev/null _liblibs 2> /dev/null _liblibs 2> /dev/null _liblibs 2> /dev/null _mvlibs 2> /dev/null rmdir save # STEP 4, SAVE ONLY SOME DIRECTORIES CONTAINED IN /usr/share # IF YOU NEED TO SAVE MORE FOLDERS, LIST THEM IN THE "SHARESAVED" VARIABLE. COMMENT THE LINE "_saveshare" IF YOU ARE NOT SURE. function _saveshare(){ mkdir save mv ./"$APP".AppDir/.junest/usr/share/*$APP* ./save/ mv ./"$APP".AppDir/.junest/usr/share/*$BIN* ./save/ mv ./"$APP".AppDir/.junest/usr/share/fontconfig ./save/ mv ./"$APP".AppDir/.junest/usr/share/glib-* ./save/ mv ./"$APP".AppDir/.junest/usr/share/locale ./save/ mv ./"$APP".AppDir/.junest/usr/share/mime ./save/ mv ./"$APP".AppDir/.junest/usr/share/wayland ./save/ mv ./"$APP".AppDir/.junest/usr/share/X11 ./save/ for arg in $SHARESAVED; do mv ./"$APP".AppDir/.junest/usr/share/*"$arg"* ./save/ done rm -R -f ./"$APP".AppDir/.junest/usr/share/* mv ./save/* ./"$APP".AppDir/.junest/usr/share/ rmdir save } _saveshare 2> /dev/null # RSYNC THE CONTENT OF THE APP'S PACKAGE echo -e "\n-----------------------------------------------------------" rm -R -f ./base/.* rsync -av ./base/* ./"$APP".AppDir/.junest/ | echo -e "◆ Rsync the content of the \"$APP\" package" # RSYNC DEPENDENCES rm -R -f ./deps/.* rsync -av ./deps/* ./"$APP".AppDir/.junest/ | echo -e "◆ Rsync all dependeces, please wait..." echo -e "-----------------------------------------------------------\n" # ADDITIONAL REMOVALS #rm -R -f ./"$APP".AppDir/.junest/usr/lib/libLLVM-* #INCLUDED IN THE COMPILATION PHASE, CAN SOMETIMES BE EXCLUDED FOR DAILY USE rm -R -f ./"$APP".AppDir/.junest/usr/lib/python*/__pycache__/* #IF PYTHON IS INSTALLED, REMOVING THIS DIRECTORY CAN SAVE SEVERAL MEGABYTES # REMOVE THE INBUILT HOME rm -R -f ./"$APP".AppDir/.junest/home # ENABLE MOUNTPOINTS mkdir -p ./"$APP".AppDir/.junest/home mkdir -p ./"$APP".AppDir/.junest/media mkdir -p ./"$APP".AppDir/.junest/usr/lib/locale mkdir -p ./"$APP".AppDir/.junest/usr/share/fonts mkdir -p ./"$APP".AppDir/.junest/usr/share/themes mkdir -p ./"$APP".AppDir/.junest/run/user # CREATE THE APPIMAGE if test -f ./*.AppImage; then rm -R -f ./*archimage*.AppImage fi ARCH=x86_64 VERSION=$(./appimagetool -v | grep -o '[[:digit:]]*') ./appimagetool -s ./"$APP".AppDir mv ./*AppImage ./"$(cat ./"$APP".AppDir/*.desktop | grep 'Name=' | head -1 | cut -c 6- | sed 's/ /-/g')"_"$VERSION"-archimage3.4.2-x86_64.AppImage ```

all I've got is this error message and I'm stucl on it

[E] pw.loop [loop.c:67 pw_loop_new()] 0xf046a0: can't make support.system handle: No such file or directory
ERROR: Failed to init SDL_mixer

I've added the following dependences

DEPENDENCES="ca-certificates alsa-lib alsa-utils dbus libpipewire pipewire pipewire-alsa pipewire-audio pulseaudio sdl2 sdl2_image sdl2_mixer"

and these keywords

BINSAVED="certificates pipewire pw-" # Enter here keywords to find and save in /usr/bin
SHARESAVED="certificates SAVESHAREPLEASE" # Enter here keywords or file/folder names to save in both /usr/share and /usr/lib
LIBSAVED="pk p11 alsa jack pipewire pulse SAVELIBSPLEASE" # Enter here keywords or file/folder names to save in /usr/lib

also I've commented the line 177, in the AppRun

#if test -d /opt; then OPT_DIR=' --bind /opt /opt '; fi

so the AppImage is created, about 85 MB.

About the audio issue, this is another topic. If you know what happens, let me know here.

I close this issue.