From 6224aeff3a056eb074b6be35dc765de66c71b250 Mon Sep 17 00:00:00 2001 From: Azathothas Date: Sat, 7 Sep 2024 15:33:11 +0545 Subject: [PATCH] [+] Bloat Removal by default? (40%) https://github.com/Azathothas/Toolpacks/issues/28 --- .github/scripts/aarch64_Linux/bins/firefox.sh | 17 +++ .github/scripts/aarch64_Linux/bins/helix.sh | 17 +++ .github/scripts/aarch64_Linux/bins/kitty.sh | 17 +++ .../scripts/aarch64_Linux/bins/ladybird.sh | 17 +++ .github/scripts/aarch64_Linux/bins/lorien.sh | 17 +++ .github/scripts/aarch64_Linux/bins/mpv.sh | 17 +++ .github/scripts/aarch64_Linux/bins/netsurf.sh | 17 +++ .../aarch64_Linux/bins/nicotine-plus.sh | 17 +++ .github/scripts/aarch64_Linux/bins/ppsspp.sh | 17 +++ .github/scripts/x86_64_Linux/bins/firefox.sh | 17 +++ .github/scripts/x86_64_Linux/bins/helix.sh | 17 +++ .github/scripts/x86_64_Linux/bins/kitty.sh | 17 +++ .github/scripts/x86_64_Linux/bins/ladybird.sh | 17 +++ .github/scripts/x86_64_Linux/bins/lorien.sh | 17 +++ .github/scripts/x86_64_Linux/bins/netsurf.sh | 17 +++ .../x86_64_Linux/bins/nicotine-plus.sh | 17 +++ .github/scripts/x86_64_Linux/bins/ppsspp.sh | 17 +++ .github/scripts/x86_64_Linux/bins/steam.sh | 135 ++++++++++-------- 18 files changed, 366 insertions(+), 58 deletions(-) diff --git a/.github/scripts/aarch64_Linux/bins/firefox.sh b/.github/scripts/aarch64_Linux/bins/firefox.sh index 7c60d3e13..0bb572db9 100644 --- a/.github/scripts/aarch64_Linux/bins/firefox.sh +++ b/.github/scripts/aarch64_Linux/bins/firefox.sh @@ -64,6 +64,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop find "." -path '*firefox*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./firefox.desktop"' sed 's/Icon=[^ ]*/Icon=firefox/' -i "./firefox.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*firefox*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*firefox*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*firefox*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/aarch64_Linux/bins/helix.sh b/.github/scripts/aarch64_Linux/bins/helix.sh index 04c1041a2..4aa30aa11 100644 --- a/.github/scripts/aarch64_Linux/bins/helix.sh +++ b/.github/scripts/aarch64_Linux/bins/helix.sh @@ -64,6 +64,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop find "." -path '*helix*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./helix.desktop"' sed 's/Icon=[^ ]*/Icon=helix/' -i "./helix.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*helix*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*helix*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*helix*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/aarch64_Linux/bins/kitty.sh b/.github/scripts/aarch64_Linux/bins/kitty.sh index 244b8ae9f..6b3515907 100644 --- a/.github/scripts/aarch64_Linux/bins/kitty.sh +++ b/.github/scripts/aarch64_Linux/bins/kitty.sh @@ -64,6 +64,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop find "." -path '*kitty*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./kitty.desktop"' sed 's/Icon=[^ ]*/Icon=kitty/' -i "./kitty.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*kitty*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*kitty*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*kitty*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/aarch64_Linux/bins/ladybird.sh b/.github/scripts/aarch64_Linux/bins/ladybird.sh index a14c716c5..cf0e12d42 100644 --- a/.github/scripts/aarch64_Linux/bins/ladybird.sh +++ b/.github/scripts/aarch64_Linux/bins/ladybird.sh @@ -52,6 +52,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop echo -e "[Desktop Entry]\nVersion=1.0\nName=Ladybird\nComment=Ladybird is an ongoing project to build an independent web browser from scratch\nExec=ladybird\nIcon=ladybird\nType=Application\nCategories=Network;WebBrowser;\nMimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;\nStartupNotify=true" > "./ladybird.desktop" sed 's/Icon=[^ ]*/Icon=ladybird/' -i "./ladybird.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*ladybird*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*ladybird*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*ladybird*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/aarch64_Linux/bins/lorien.sh b/.github/scripts/aarch64_Linux/bins/lorien.sh index b79a417a4..144eb01c1 100644 --- a/.github/scripts/aarch64_Linux/bins/lorien.sh +++ b/.github/scripts/aarch64_Linux/bins/lorien.sh @@ -64,6 +64,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop find "." -path '*lorien*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./lorien.desktop"' sed 's/Icon=[^ ]*/Icon=lorien/' -i "./lorien.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*lorien*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*lorien*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*lorien*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/aarch64_Linux/bins/mpv.sh b/.github/scripts/aarch64_Linux/bins/mpv.sh index 4774e425e..1f43ae9fc 100644 --- a/.github/scripts/aarch64_Linux/bins/mpv.sh +++ b/.github/scripts/aarch64_Linux/bins/mpv.sh @@ -64,6 +64,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop find "." -path '*mpv*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./mpv.desktop"' sed 's/Icon=[^ ]*/Icon=mpv/' -i "./mpv.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*mpv*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*mpv*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*mpv*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/aarch64_Linux/bins/netsurf.sh b/.github/scripts/aarch64_Linux/bins/netsurf.sh index 3fadeda66..24813efe4 100644 --- a/.github/scripts/aarch64_Linux/bins/netsurf.sh +++ b/.github/scripts/aarch64_Linux/bins/netsurf.sh @@ -52,6 +52,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop echo -e "[Desktop Entry]\nVersion=1.0\nName=netsurf-browser\nComment=Small as a mouse, fast as a cheetah and available for free. NetSurf is a multi-platform web browser for RISC OS, UNIX-like platforms (including Linux), Mac OS X, and more.\nExec=netsurf\nIcon=netsurf\nType=Application\nCategories=Network;WebBrowser;\nMimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;\nStartupNotify=true" > "./netsurf.desktop" sed 's/Icon=[^ ]*/Icon=netsurf/' -i "./netsurf.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*netsurf*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*netsurf*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*netsurf*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/aarch64_Linux/bins/nicotine-plus.sh b/.github/scripts/aarch64_Linux/bins/nicotine-plus.sh index 9ea8f2966..b88b7bdd5 100644 --- a/.github/scripts/aarch64_Linux/bins/nicotine-plus.sh +++ b/.github/scripts/aarch64_Linux/bins/nicotine-plus.sh @@ -62,6 +62,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop find "." -path '*nicotine*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./nicotine-plus.desktop"' sed 's/Icon=[^ ]*/Icon=nicotine-plus/' -i "./nicotine-plus.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*nicotine*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*nicotine*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*nicotine*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/aarch64_Linux/bins/ppsspp.sh b/.github/scripts/aarch64_Linux/bins/ppsspp.sh index 2baa82278..97a10b477 100644 --- a/.github/scripts/aarch64_Linux/bins/ppsspp.sh +++ b/.github/scripts/aarch64_Linux/bins/ppsspp.sh @@ -64,6 +64,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop find "." -path '*ppsspp*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./ppsspp.desktop"' sed 's/Icon=[^ ]*/Icon=ppsspp/' -i "./ppsspp.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*ppsspp*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*ppsspp*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*ppsspp*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/x86_64_Linux/bins/firefox.sh b/.github/scripts/x86_64_Linux/bins/firefox.sh index 7c60d3e13..0bb572db9 100644 --- a/.github/scripts/x86_64_Linux/bins/firefox.sh +++ b/.github/scripts/x86_64_Linux/bins/firefox.sh @@ -64,6 +64,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop find "." -path '*firefox*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./firefox.desktop"' sed 's/Icon=[^ ]*/Icon=firefox/' -i "./firefox.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*firefox*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*firefox*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*firefox*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/x86_64_Linux/bins/helix.sh b/.github/scripts/x86_64_Linux/bins/helix.sh index 04c1041a2..4aa30aa11 100644 --- a/.github/scripts/x86_64_Linux/bins/helix.sh +++ b/.github/scripts/x86_64_Linux/bins/helix.sh @@ -64,6 +64,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop find "." -path '*helix*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./helix.desktop"' sed 's/Icon=[^ ]*/Icon=helix/' -i "./helix.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*helix*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*helix*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*helix*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/x86_64_Linux/bins/kitty.sh b/.github/scripts/x86_64_Linux/bins/kitty.sh index 1ec8f509b..b13a179c9 100644 --- a/.github/scripts/x86_64_Linux/bins/kitty.sh +++ b/.github/scripts/x86_64_Linux/bins/kitty.sh @@ -64,6 +64,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop find "." -path '*kitty*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./kitty.desktop"' sed 's/Icon=[^ ]*/Icon=kitty/' -i "./kitty.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*kitty*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*kitty*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*kitty*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/x86_64_Linux/bins/ladybird.sh b/.github/scripts/x86_64_Linux/bins/ladybird.sh index a14c716c5..cf0e12d42 100644 --- a/.github/scripts/x86_64_Linux/bins/ladybird.sh +++ b/.github/scripts/x86_64_Linux/bins/ladybird.sh @@ -52,6 +52,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop echo -e "[Desktop Entry]\nVersion=1.0\nName=Ladybird\nComment=Ladybird is an ongoing project to build an independent web browser from scratch\nExec=ladybird\nIcon=ladybird\nType=Application\nCategories=Network;WebBrowser;\nMimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;\nStartupNotify=true" > "./ladybird.desktop" sed 's/Icon=[^ ]*/Icon=ladybird/' -i "./ladybird.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*ladybird*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*ladybird*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*ladybird*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/x86_64_Linux/bins/lorien.sh b/.github/scripts/x86_64_Linux/bins/lorien.sh index b79a417a4..b69b3723e 100644 --- a/.github/scripts/x86_64_Linux/bins/lorien.sh +++ b/.github/scripts/x86_64_Linux/bins/lorien.sh @@ -64,6 +64,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop find "." -path '*lorien*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./lorien.desktop"' sed 's/Icon=[^ ]*/Icon=lorien/' -i "./lorien.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*lorien*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*lorien*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*lorien*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/x86_64_Linux/bins/netsurf.sh b/.github/scripts/x86_64_Linux/bins/netsurf.sh index 3fadeda66..4a1597f54 100644 --- a/.github/scripts/x86_64_Linux/bins/netsurf.sh +++ b/.github/scripts/x86_64_Linux/bins/netsurf.sh @@ -52,6 +52,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop echo -e "[Desktop Entry]\nVersion=1.0\nName=netsurf-browser\nComment=Small as a mouse, fast as a cheetah and available for free. NetSurf is a multi-platform web browser for RISC OS, UNIX-like platforms (including Linux), Mac OS X, and more.\nExec=netsurf\nIcon=netsurf\nType=Application\nCategories=Network;WebBrowser;\nMimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;\nStartupNotify=true" > "./netsurf.desktop" sed 's/Icon=[^ ]*/Icon=netsurf/' -i "./netsurf.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*netsurf*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*netsurf*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*netsurf*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/x86_64_Linux/bins/nicotine-plus.sh b/.github/scripts/x86_64_Linux/bins/nicotine-plus.sh index 9ea8f2966..b88b7bdd5 100644 --- a/.github/scripts/x86_64_Linux/bins/nicotine-plus.sh +++ b/.github/scripts/x86_64_Linux/bins/nicotine-plus.sh @@ -62,6 +62,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop find "." -path '*nicotine*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./nicotine-plus.desktop"' sed 's/Icon=[^ ]*/Icon=nicotine-plus/' -i "./nicotine-plus.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*nicotine*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*nicotine*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*nicotine*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/x86_64_Linux/bins/ppsspp.sh b/.github/scripts/x86_64_Linux/bins/ppsspp.sh index 2baa82278..97a10b477 100644 --- a/.github/scripts/x86_64_Linux/bins/ppsspp.sh +++ b/.github/scripts/x86_64_Linux/bins/ppsspp.sh @@ -64,6 +64,23 @@ if [ "$SKIP_BUILD" == "NO" ]; then ##Desktop find "." -path '*ppsspp*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./ppsspp.desktop"' sed 's/Icon=[^ ]*/Icon=ppsspp/' -i "./ppsspp.desktop" 2>/dev/null + ##Purge Bloatware + echo -e "\n[+] Purging Bloatware...\n" + O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + #Headers + find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #docs & manpages + find "." -type d -path "*doc/share*" ! -name "*ppsspp*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/docs*" ! -name "*ppsspp*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + find "." -type d -path "*/share/man*" ! -name "*ppsspp*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + #static libs + find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + #systemd (need .so) + find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + #Strip (this breaks things) + #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" diff --git a/.github/scripts/x86_64_Linux/bins/steam.sh b/.github/scripts/x86_64_Linux/bins/steam.sh index 2ecb7642e..c430f9398 100644 --- a/.github/scripts/x86_64_Linux/bins/steam.sh +++ b/.github/scripts/x86_64_Linux/bins/steam.sh @@ -23,65 +23,84 @@ export SKIP_BUILD="NO" #YES, in case of deleted repos, broken builds etc if [ "$SKIP_BUILD" == "NO" ]; then #steam : A video game digital distribution service and storefront from Valve. export BIN="steam" - export SOURCE_URL="https://store.steampowered.com/about/" + export SOURCE_URL="https://github.com/ivan-hc/Steam-appimage" echo -e "\n\n [+] (Building | Fetching) $BIN :: $SOURCE_URL\n" - ##Build - pushd "$($TMPDIRS)" >/dev/null 2>&1 - NIXPKGS_ALLOW_UNFREE=1 nix bundle --bundler "github:ralismark/nix-appimage" "nixpkgs#steam" --log-format bar-with-logs --impure - ##Copy - sudo rsync -av --copy-links "./steam.AppImage" "./steam.AppImage.tmp" - sudo chown -R "$(whoami):$(whoami)" "./steam.AppImage.tmp" && chmod -R 755 "./steam.AppImage.tmp" - du -sh "./steam.AppImage.tmp" && file "./steam.AppImage.tmp" - ##Extract - APPIMAGE="$(realpath .)/steam.AppImage.tmp" && export APPIMAGE="${APPIMAGE}" - OFFSET="$(${APPIMAGE} --appimage-offset)" && export OFFSET="${OFFSET}" - tail -c +"$(($OFFSET + 1))" "${APPIMAGE}" > "./squash.tmp" - #unsquashfs -force -dest "./squash_tmp/" "./squash.tmp" - "${APPIMAGE}" --appimage-extract >/dev/null && rm -f "${APPIMAGE}" - OWD="$(realpath .)" && export OWD="${OWD}" - APPIMAGE_EXTRACT="$(realpath "./squashfs-root")" && export APPIMAGE_EXTRACT="${APPIMAGE_EXTRACT}" - ##Patch - if [ -d "${APPIMAGE_EXTRACT}" ] && [ "$(find "${APPIMAGE_EXTRACT}" -mindepth 1 -print -quit 2>/dev/null)" ]; then - #Media - cd "${APPIMAGE_EXTRACT}" - mkdir -p "./usr/share/applications" && mkdir -p "./usr/share/metainfo" - SHARE_DIR="$(find "." -path '*share/*steam*' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | awk -F'/share/' '{print $1}')/share" && export SHARE_DIR="${SHARE_DIR}" - #usr/{applications,bash-completion,icons,metainfo,steam,zsh} - rsync -av --copy-links \ - --include="*/" \ - --include="*.desktop" \ - --include="*.png" \ - --include="*.svg" \ - --include="*.xml" \ - --exclude="*" \ - "${SHARE_DIR}/" "./usr/share/" && ls "./usr/share/" - ##Appdata/AppStream - # find "." -path '*share/*steam*' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./usr/share/metainfo/"' ; cp "./usr/share/metainfo/steam.metainfo.xml" "./usr/share/metainfo/steam.appdata.xml" - #Icon - find "." -path '*128x128/apps/*.png' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp "{}" ./steam.png' - find "." -maxdepth 1 -type f -name '*.svg' -exec sh -c 'convert "$0" "${0%.svg}.png"' {} \; 2>/dev/null - cp "./steam.png" "./.DirIcon" - ##Desktop - find "." -path '*steam*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./steam.desktop"' - sed 's/Icon=[^ ]*/Icon=steam/' -i "./steam.desktop" 2>/dev/null - #(Re)Pack - cd "${OWD}" - curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" - ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ - --mksquashfs-opt -root-owned \ - --mksquashfs-opt -no-xattrs \ - --mksquashfs-opt -noappend \ - --mksquashfs-opt -b --mksquashfs-opt "1M" \ - --mksquashfs-opt -mkfs-time --mksquashfs-opt "0" \ - --mksquashfs-opt -Xcompression-level --mksquashfs-opt "22" \ - "${APPIMAGE_EXTRACT}" "$BINDIR/steam.AppImage" - #Meta - du -sh "$BINDIR/steam.AppImage" && file "$BINDIR/steam.AppImage" - #clean - unset APPIMAGE APPIMAGE_EXTRACT OFFSET OWD SHARE_DIR - fi - #End - nix-collect-garbage >/dev/null 2>&1 ; popd >/dev/null 2>&1 + #Fetch + eval "$EGET_TIMEOUT" eget "$SOURCE_URL" --asset "x86_64" --asset "AppImage" --asset "^zsync" --to "$BINDIR/steam.AppImage" + ###Build + # pushd "$($TMPDIRS)" >/dev/null 2>&1 + # NIXPKGS_ALLOW_UNFREE=1 nix bundle --bundler "github:ralismark/nix-appimage" "nixpkgs#steam" --log-format bar-with-logs --impure + ###Copy + # sudo rsync -av --copy-links "./steam.AppImage" "./steam.AppImage.tmp" + # sudo chown -R "$(whoami):$(whoami)" "./steam.AppImage.tmp" && chmod -R 755 "./steam.AppImage.tmp" + # du -sh "./steam.AppImage.tmp" && file "./steam.AppImage.tmp" + ###Extract + # APPIMAGE="$(realpath .)/steam.AppImage.tmp" && export APPIMAGE="${APPIMAGE}" + # OFFSET="$(${APPIMAGE} --appimage-offset)" && export OFFSET="${OFFSET}" + # tail -c +"$(($OFFSET + 1))" "${APPIMAGE}" > "./squash.tmp" + # #unsquashfs -force -dest "./squash_tmp/" "./squash.tmp" + # "${APPIMAGE}" --appimage-extract >/dev/null && rm -f "${APPIMAGE}" + # OWD="$(realpath .)" && export OWD="${OWD}" + # APPIMAGE_EXTRACT="$(realpath "./squashfs-root")" && export APPIMAGE_EXTRACT="${APPIMAGE_EXTRACT}" + ###Patch + # if [ -d "${APPIMAGE_EXTRACT}" ] && [ "$(find "${APPIMAGE_EXTRACT}" -mindepth 1 -print -quit 2>/dev/null)" ]; then + # #Media + # cd "${APPIMAGE_EXTRACT}" + # mkdir -p "./usr/share/applications" && mkdir -p "./usr/share/metainfo" + # SHARE_DIR="$(find "." -path '*share/*steam*' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | awk -F'/share/' '{print $1}')/share" && export SHARE_DIR="${SHARE_DIR}" + # #usr/{applications,bash-completion,icons,metainfo,steam,zsh} + # rsync -av --copy-links \ + # --include="*/" \ + # --include="*.desktop" \ + # --include="*.png" \ + # --include="*.svg" \ + # --include="*.xml" \ + # --exclude="*" \ + # "${SHARE_DIR}/" "./usr/share/" && ls "./usr/share/" + # ##Appdata/AppStream + # # find "." -path '*share/*steam*' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./usr/share/metainfo/"' ; cp "./usr/share/metainfo/steam.metainfo.xml" "./usr/share/metainfo/steam.appdata.xml" + # #Icon + # find "." -path '*128x128/apps/*.png' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp "{}" ./steam.png' + # find "." -maxdepth 1 -type f -name '*.svg' -exec sh -c 'convert "$0" "${0%.svg}.png"' {} \; 2>/dev/null + # cp "./steam.png" "./.DirIcon" + # ##Desktop + # find "." -path '*steam*.desktop' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./steam.desktop"' + # sed 's/Icon=[^ ]*/Icon=steam/' -i "./steam.desktop" 2>/dev/null + # ##Purge Bloatware + # echo -e "\n[+] Purging Bloatware...\n" + # O_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}" + # #Headers + # find "." -type d -path "*/include*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + # #docs & manpages + # find "." -type d -path "*doc/share*" ! -name "*steam*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + # find "." -type d -path "*/share/docs*" ! -name "*steam*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + # find "." -type d -path "*/share/man*" ! -name "*steam*" -print -exec rm -rf {} 2>/dev/null \; 2>/dev/null + # #static libs + # find "." -type f -name "*.a" -print -exec rm -f {} 2>/dev/null \; 2>/dev/null + # #systemd (need .so) + # find "." -type d -name "*systemd*" -exec find {} -type f ! -name "*.so*" -delete \; + # #Strip (this breaks things) + # #find "." -type f -executable -exec file -i '{}' \; | grep "application/.*executable" | cut -d':' -f1 | xargs realpath | xargs sudo strip -R ".comment" -R ".gnu.version" --strip-unneeded 2>/dev/null + # P_SIZE="$(du -sh "${APPIMAGE_EXTRACT}" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}" + # echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n" + # #(Re)Pack + # cd "${OWD}" + # curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" + # ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ + # --mksquashfs-opt -root-owned \ + # --mksquashfs-opt -no-xattrs \ + # --mksquashfs-opt -noappend \ + # --mksquashfs-opt -b --mksquashfs-opt "1M" \ + # --mksquashfs-opt -mkfs-time --mksquashfs-opt "0" \ + # --mksquashfs-opt -Xcompression-level --mksquashfs-opt "22" \ + # "${APPIMAGE_EXTRACT}" "$BINDIR/steam.AppImage" + # #Meta + # du -sh "$BINDIR/steam.AppImage" && file "$BINDIR/steam.AppImage" + # #clean + # unset APPIMAGE APPIMAGE_EXTRACT OFFSET OWD SHARE_DIR + # fi + ##End + # nix-collect-garbage >/dev/null 2>&1 ; popd >/dev/null 2>&1 fi #-------------------------------------------------------#