Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to dwarfs thanks to uruntime #1

Merged
merged 7 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
if: always()
run: |
pacman -Syu --noconfirm base-devel curl desktop-file-utils git wget \
base-devel patchelf gtk3 strace gimp ffmpeg ghostscript
base-devel patchelf gtk3 strace gimp ffmpeg ghostscript llvm

# Artix repos don't have zsyc
wget https://london.mirror.pkgbuild.com/extra/os/x86_64/zsync-0.6.2-5-x86_64.pkg.tar.zst
Expand Down
33 changes: 24 additions & 9 deletions gimp-appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ ICON=gimp.png

export ARCH="$(uname -m)"
export APPIMAGE_EXTRACT_AND_RUN=1
export VERSION=$(pacman -Q $PACKAGE | awk 'NR==1 {print $2; exit}')
export VERSION="$(pacman -Q $PACKAGE | awk 'NR==1 {print $2; exit}')"

APPIMAGETOOL="https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$ARCH.AppImage"
UPINFO="gh-releases-zsync|$(echo $GITHUB_REPOSITORY | tr '/' '|')|continuous|*$ARCH.AppImage.zsync"
LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
URUNTIME="$(wget -q https://api.github.com/repos/VHSgunzo/uruntime/releases -O - \
| sed 's/[()",{} ]/\n/g' | grep -oi "https.*appimage.*dwarfs.*$ARCH$" | head -1)"

# Prepare AppDir
mkdir -p ./"$PACKAGE"/AppDir/shared/lib \
Expand Down Expand Up @@ -117,14 +118,28 @@ cp ./sharun ./shared/lib/gimp/2.0
ln -s ../../../ ./shared/lib/gimp/2.0/shared/lib
./sharun -g

# MAKE APPIAMGE WITH FUSE3 COMPATIBLE APPIMAGETOOL
# MAKE APPIMAGE WITH URUNTIME
cd ..
wget -q "$APPIMAGETOOL" -O ./appimagetool
chmod +x ./appimagetool

./appimagetool --comp zstd \
--mksquashfs-opt -Xcompression-level --mksquashfs-opt 22 \
-n -u "$UPINFO" "$PWD"/AppDir "$PWD"/"$PACKAGE"-"$VERSION"-"$ARCH".AppImage
wget -q "$URUNTIME" -O ./uruntime
chmod +x ./uruntime

#Add udpate info to runtime
echo "Adding update information \"$UPINFO\" to runtime..."
printf "$UPINFO" > data.upd_info
llvm-objcopy --update-section=.upd_info=data.upd_info \
--set-section-flags=.upd_info=noload,readonly ./uruntime
printf 'AI\x02' | dd of=./uruntime bs=1 count=3 seek=8 conv=notrunc

echo "Generating AppImage..."
./uruntime --appimage-mkdwarfs -f \
--set-owner 0 --set-group 0 \
--no-history --no-create-timestamp \
--compression zstd:level=22 -S26 -B16 \
--header uruntime \
-i ./AppDir -o "$PACKAGE"-"$VERSION"-"$ARCH"-anylinux.AppImage

echo "Generating zsync file..."
zsyncmake *.AppImage -u *.AppImage

mv ./*.AppImage* ../
cd ..
Expand Down
Loading