diff --git a/.github/scripts/aarch64_Linux/bins/firefox.sh b/.github/scripts/aarch64_Linux/bins/firefox.sh index 39e469e63..7c60d3e13 100644 --- a/.github/scripts/aarch64_Linux/bins/firefox.sh +++ b/.github/scripts/aarch64_Linux/bins/firefox.sh @@ -67,7 +67,7 @@ if [ "$SKIP_BUILD" == "NO" ]; then #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" - "./appimagetool" --comp "zstd" \ + ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ --mksquashfs-opt -root-owned \ --mksquashfs-opt -no-xattrs \ --mksquashfs-opt -noappend \ diff --git a/.github/scripts/aarch64_Linux/bins/helix.sh b/.github/scripts/aarch64_Linux/bins/helix.sh new file mode 100644 index 000000000..04c1041a2 --- /dev/null +++ b/.github/scripts/aarch64_Linux/bins/helix.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash + +#-------------------------------------------------------# +#Sanity Checks +if [ "$BUILD" != "YES" ] || \ + [ -z "$BINDIR" ] || \ + [ -z "$EGET_EXCLUDE" ] || \ + [ -z "$EGET_TIMEOUT" ] || \ + [ -z "$GIT_TERMINAL_PROMPT" ] || \ + [ -z "$GIT_ASKPASS" ] || \ + [ -z "$GITHUB_TOKEN" ] || \ + [ -z "$SYSTMP" ] || \ + [ -z "$TMPDIRS" ]; then + #exit + echo -e "\n[+]Skipping Builds...\n" + exit 1 +fi +#-------------------------------------------------------# + +#-------------------------------------------------------# +##Main +export SKIP_BUILD="NO" #YES, in case of deleted repos, broken builds etc +if [ "$SKIP_BUILD" == "NO" ]; then + #helix : A post-modern modal text editor + export BIN="helix" + export SOURCE_URL="https://github.com/helix-editor/helix" + 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#helix" --log-format bar-with-logs --impure + ##Copy + sudo rsync -av --copy-links "./hx.AppImage" "./helix.AppImage.tmp" + sudo chown -R "$(whoami):$(whoami)" "./helix.AppImage.tmp" && chmod -R 755 "./helix.AppImage.tmp" + du -sh "./helix.AppImage.tmp" && file "./helix.AppImage.tmp" + ##Extract + APPIMAGE="$(realpath .)/helix.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/*helix*' | 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,helix,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/*helix*' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./usr/share/metainfo/"' ; cp "./usr/share/metainfo/helix.metainfo.xml" "./usr/share/metainfo/helix.appdata.xml" + #Icon + find "." -path '*/apps/*.png' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp "{}" ./helix.png' + find "." -maxdepth 1 -type f -name '*.svg' -exec sh -c 'convert "$0" "${0%.svg}.png"' {} \; 2>/dev/null + cp "./helix.png" "./.DirIcon" + ##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 + #(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/helix.AppImage" + #Meta + du -sh "$BINDIR/helix.AppImage" && file "$BINDIR/helix.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 +#-------------------------------------------------------# + +#-------------------------------------------------------# +##Cleanup +unset SKIP_BUILD ; export BUILT="YES" +#In case of zig polluted env +unset AR CC CFLAGS CXX CPPFLAGS CXXFLAGS DLLTOOL HOST_CC HOST_CXX LDFLAGS LIBS OBJCOPY RANLIB +#In case of go polluted env +unset GOARCH GOOS CGO_ENABLED CGO_CFLAGS +#PKG Config +unset PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR PKG_CONFIG_SYSTEM_INCLUDE_PATH PKG_CONFIG_SYSTEM_LIBRARY_PATH +#-------------------------------------------------------# \ No newline at end of file diff --git a/.github/scripts/aarch64_Linux/bins/helix.yaml b/.github/scripts/aarch64_Linux/bins/helix.yaml new file mode 100644 index 000000000..a908e4627 --- /dev/null +++ b/.github/scripts/aarch64_Linux/bins/helix.yaml @@ -0,0 +1,7 @@ +name: "helix" +description: "A post-modern modal text editor (AppImage)" +web_url: "https://helix-editor.com" +repo_url: "https://github.com/helix-editor/helix" +path: "/" +bins: + - "helix.AppImage" \ No newline at end of file diff --git a/.github/scripts/aarch64_Linux/bins/ladybird.sh b/.github/scripts/aarch64_Linux/bins/ladybird.sh index 35eed02f0..a14c716c5 100644 --- a/.github/scripts/aarch64_Linux/bins/ladybird.sh +++ b/.github/scripts/aarch64_Linux/bins/ladybird.sh @@ -55,7 +55,7 @@ if [ "$SKIP_BUILD" == "NO" ]; then #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" - "./appimagetool" --comp "zstd" \ + ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ --mksquashfs-opt -root-owned \ --mksquashfs-opt -no-xattrs \ --mksquashfs-opt -noappend \ diff --git a/.github/scripts/aarch64_Linux/bins/mpv.sh b/.github/scripts/aarch64_Linux/bins/mpv.sh index 773cd5e7a..4774e425e 100644 --- a/.github/scripts/aarch64_Linux/bins/mpv.sh +++ b/.github/scripts/aarch64_Linux/bins/mpv.sh @@ -67,7 +67,7 @@ if [ "$SKIP_BUILD" == "NO" ]; then #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" - "./appimagetool" --comp "zstd" \ + ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ --mksquashfs-opt -root-owned \ --mksquashfs-opt -no-xattrs \ --mksquashfs-opt -noappend \ diff --git a/.github/scripts/aarch64_Linux/bins/netsurf.sh b/.github/scripts/aarch64_Linux/bins/netsurf.sh index 7e1f50fb6..3fadeda66 100644 --- a/.github/scripts/aarch64_Linux/bins/netsurf.sh +++ b/.github/scripts/aarch64_Linux/bins/netsurf.sh @@ -55,7 +55,7 @@ if [ "$SKIP_BUILD" == "NO" ]; then #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" - "./appimagetool" --comp "zstd" \ + ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ --mksquashfs-opt -root-owned \ --mksquashfs-opt -no-xattrs \ --mksquashfs-opt -noappend \ diff --git a/.github/scripts/aarch64_Linux/bins/nicotine-plus.sh b/.github/scripts/aarch64_Linux/bins/nicotine-plus.sh index bac64fe65..9ea8f2966 100644 --- a/.github/scripts/aarch64_Linux/bins/nicotine-plus.sh +++ b/.github/scripts/aarch64_Linux/bins/nicotine-plus.sh @@ -65,7 +65,7 @@ if [ "$SKIP_BUILD" == "NO" ]; then #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" - "./appimagetool" --comp "zstd" \ + ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ --mksquashfs-opt -root-owned \ --mksquashfs-opt -no-xattrs \ --mksquashfs-opt -noappend \ diff --git a/.github/scripts/aarch64_Linux/bins/ppsspp.sh b/.github/scripts/aarch64_Linux/bins/ppsspp.sh index 61cdbe26b..2baa82278 100644 --- a/.github/scripts/aarch64_Linux/bins/ppsspp.sh +++ b/.github/scripts/aarch64_Linux/bins/ppsspp.sh @@ -67,7 +67,7 @@ if [ "$SKIP_BUILD" == "NO" ]; then #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" - "./appimagetool" --comp "zstd" \ + ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ --mksquashfs-opt -root-owned \ --mksquashfs-opt -no-xattrs \ --mksquashfs-opt -noappend \ diff --git a/.github/scripts/x86_64_Linux/bins/firefox.sh b/.github/scripts/x86_64_Linux/bins/firefox.sh index 39e469e63..7c60d3e13 100644 --- a/.github/scripts/x86_64_Linux/bins/firefox.sh +++ b/.github/scripts/x86_64_Linux/bins/firefox.sh @@ -67,7 +67,7 @@ if [ "$SKIP_BUILD" == "NO" ]; then #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" - "./appimagetool" --comp "zstd" \ + ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ --mksquashfs-opt -root-owned \ --mksquashfs-opt -no-xattrs \ --mksquashfs-opt -noappend \ diff --git a/.github/scripts/x86_64_Linux/bins/helix.sh b/.github/scripts/x86_64_Linux/bins/helix.sh new file mode 100644 index 000000000..04c1041a2 --- /dev/null +++ b/.github/scripts/x86_64_Linux/bins/helix.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash + +#-------------------------------------------------------# +#Sanity Checks +if [ "$BUILD" != "YES" ] || \ + [ -z "$BINDIR" ] || \ + [ -z "$EGET_EXCLUDE" ] || \ + [ -z "$EGET_TIMEOUT" ] || \ + [ -z "$GIT_TERMINAL_PROMPT" ] || \ + [ -z "$GIT_ASKPASS" ] || \ + [ -z "$GITHUB_TOKEN" ] || \ + [ -z "$SYSTMP" ] || \ + [ -z "$TMPDIRS" ]; then + #exit + echo -e "\n[+]Skipping Builds...\n" + exit 1 +fi +#-------------------------------------------------------# + +#-------------------------------------------------------# +##Main +export SKIP_BUILD="NO" #YES, in case of deleted repos, broken builds etc +if [ "$SKIP_BUILD" == "NO" ]; then + #helix : A post-modern modal text editor + export BIN="helix" + export SOURCE_URL="https://github.com/helix-editor/helix" + 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#helix" --log-format bar-with-logs --impure + ##Copy + sudo rsync -av --copy-links "./hx.AppImage" "./helix.AppImage.tmp" + sudo chown -R "$(whoami):$(whoami)" "./helix.AppImage.tmp" && chmod -R 755 "./helix.AppImage.tmp" + du -sh "./helix.AppImage.tmp" && file "./helix.AppImage.tmp" + ##Extract + APPIMAGE="$(realpath .)/helix.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/*helix*' | 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,helix,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/*helix*' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp {} "./usr/share/metainfo/"' ; cp "./usr/share/metainfo/helix.metainfo.xml" "./usr/share/metainfo/helix.appdata.xml" + #Icon + find "." -path '*/apps/*.png' | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- | head -n 1 | xargs -I {} sh -c 'cp "{}" ./helix.png' + find "." -maxdepth 1 -type f -name '*.svg' -exec sh -c 'convert "$0" "${0%.svg}.png"' {} \; 2>/dev/null + cp "./helix.png" "./.DirIcon" + ##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 + #(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/helix.AppImage" + #Meta + du -sh "$BINDIR/helix.AppImage" && file "$BINDIR/helix.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 +#-------------------------------------------------------# + +#-------------------------------------------------------# +##Cleanup +unset SKIP_BUILD ; export BUILT="YES" +#In case of zig polluted env +unset AR CC CFLAGS CXX CPPFLAGS CXXFLAGS DLLTOOL HOST_CC HOST_CXX LDFLAGS LIBS OBJCOPY RANLIB +#In case of go polluted env +unset GOARCH GOOS CGO_ENABLED CGO_CFLAGS +#PKG Config +unset PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR PKG_CONFIG_SYSTEM_INCLUDE_PATH PKG_CONFIG_SYSTEM_LIBRARY_PATH +#-------------------------------------------------------# \ No newline at end of file diff --git a/.github/scripts/x86_64_Linux/bins/helix.yaml b/.github/scripts/x86_64_Linux/bins/helix.yaml new file mode 100644 index 000000000..a908e4627 --- /dev/null +++ b/.github/scripts/x86_64_Linux/bins/helix.yaml @@ -0,0 +1,7 @@ +name: "helix" +description: "A post-modern modal text editor (AppImage)" +web_url: "https://helix-editor.com" +repo_url: "https://github.com/helix-editor/helix" +path: "/" +bins: + - "helix.AppImage" \ No newline at end of file diff --git a/.github/scripts/x86_64_Linux/bins/ladybird.sh b/.github/scripts/x86_64_Linux/bins/ladybird.sh index 35eed02f0..a14c716c5 100644 --- a/.github/scripts/x86_64_Linux/bins/ladybird.sh +++ b/.github/scripts/x86_64_Linux/bins/ladybird.sh @@ -55,7 +55,7 @@ if [ "$SKIP_BUILD" == "NO" ]; then #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" - "./appimagetool" --comp "zstd" \ + ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ --mksquashfs-opt -root-owned \ --mksquashfs-opt -no-xattrs \ --mksquashfs-opt -noappend \ diff --git a/.github/scripts/x86_64_Linux/bins/mpv.sh b/.github/scripts/x86_64_Linux/bins/mpv.sh index 773cd5e7a..4774e425e 100644 --- a/.github/scripts/x86_64_Linux/bins/mpv.sh +++ b/.github/scripts/x86_64_Linux/bins/mpv.sh @@ -67,7 +67,7 @@ if [ "$SKIP_BUILD" == "NO" ]; then #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" - "./appimagetool" --comp "zstd" \ + ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ --mksquashfs-opt -root-owned \ --mksquashfs-opt -no-xattrs \ --mksquashfs-opt -noappend \ diff --git a/.github/scripts/x86_64_Linux/bins/netsurf.sh b/.github/scripts/x86_64_Linux/bins/netsurf.sh index 7e1f50fb6..3fadeda66 100644 --- a/.github/scripts/x86_64_Linux/bins/netsurf.sh +++ b/.github/scripts/x86_64_Linux/bins/netsurf.sh @@ -55,7 +55,7 @@ if [ "$SKIP_BUILD" == "NO" ]; then #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" - "./appimagetool" --comp "zstd" \ + ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ --mksquashfs-opt -root-owned \ --mksquashfs-opt -no-xattrs \ --mksquashfs-opt -noappend \ diff --git a/.github/scripts/x86_64_Linux/bins/nicotine-plus.sh b/.github/scripts/x86_64_Linux/bins/nicotine-plus.sh index bac64fe65..9ea8f2966 100644 --- a/.github/scripts/x86_64_Linux/bins/nicotine-plus.sh +++ b/.github/scripts/x86_64_Linux/bins/nicotine-plus.sh @@ -65,7 +65,7 @@ if [ "$SKIP_BUILD" == "NO" ]; then #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" - "./appimagetool" --comp "zstd" \ + ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ --mksquashfs-opt -root-owned \ --mksquashfs-opt -no-xattrs \ --mksquashfs-opt -noappend \ diff --git a/.github/scripts/x86_64_Linux/bins/ppsspp.sh b/.github/scripts/x86_64_Linux/bins/ppsspp.sh index 61cdbe26b..2baa82278 100644 --- a/.github/scripts/x86_64_Linux/bins/ppsspp.sh +++ b/.github/scripts/x86_64_Linux/bins/ppsspp.sh @@ -67,7 +67,7 @@ if [ "$SKIP_BUILD" == "NO" ]; then #(Re)Pack cd "${OWD}" curl -qfsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" -o "./appimagetool" && chmod +x "./appimagetool" - "./appimagetool" --comp "zstd" \ + ARCH="$(uname -m)" "./appimagetool" --comp "zstd" \ --mksquashfs-opt -root-owned \ --mksquashfs-opt -no-xattrs \ --mksquashfs-opt -noappend \ diff --git a/.github/scripts/x86_64_Linux/bins/steam.sh b/.github/scripts/x86_64_Linux/bins/steam.sh new file mode 100644 index 000000000..2ecb7642e --- /dev/null +++ b/.github/scripts/x86_64_Linux/bins/steam.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash + +#-------------------------------------------------------# +#Sanity Checks +if [ "$BUILD" != "YES" ] || \ + [ -z "$BINDIR" ] || \ + [ -z "$EGET_EXCLUDE" ] || \ + [ -z "$EGET_TIMEOUT" ] || \ + [ -z "$GIT_TERMINAL_PROMPT" ] || \ + [ -z "$GIT_ASKPASS" ] || \ + [ -z "$GITHUB_TOKEN" ] || \ + [ -z "$SYSTMP" ] || \ + [ -z "$TMPDIRS" ]; then + #exit + echo -e "\n[+]Skipping Builds...\n" + exit 1 +fi +#-------------------------------------------------------# + +#-------------------------------------------------------# +##Main +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/" + 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 +fi +#-------------------------------------------------------# + +#-------------------------------------------------------# +##Cleanup +unset SKIP_BUILD ; export BUILT="YES" +#In case of zig polluted env +unset AR CC CFLAGS CXX CPPFLAGS CXXFLAGS DLLTOOL HOST_CC HOST_CXX LDFLAGS LIBS OBJCOPY RANLIB +#In case of go polluted env +unset GOARCH GOOS CGO_ENABLED CGO_CFLAGS +#PKG Config +unset PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR PKG_CONFIG_SYSTEM_INCLUDE_PATH PKG_CONFIG_SYSTEM_LIBRARY_PATH +#-------------------------------------------------------# \ No newline at end of file diff --git a/.github/scripts/x86_64_Linux/bins/steam.yaml b/.github/scripts/x86_64_Linux/bins/steam.yaml new file mode 100644 index 000000000..721550e4f --- /dev/null +++ b/.github/scripts/x86_64_Linux/bins/steam.yaml @@ -0,0 +1,7 @@ +name: "steam" +description: "A video game digital distribution service and storefront from Valve (AppImage)" +web_url: "https://store.steampowered.com/about/" +repo_url: "NA" +path: "/" +bins: + - "steam.AppImage" \ No newline at end of file