Skip to content

Commit

Permalink
+
Browse files Browse the repository at this point in the history
  • Loading branch information
Azathothas committed Sep 19, 2024
1 parent 45324ed commit cd89728
Show file tree
Hide file tree
Showing 11 changed files with 351 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/scripts/aarch64_Linux/bins/intermodal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/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
#intermodal : A CLI utility for BitTorrent torrent file creation, verification, and more
export BIN="intermodal"
export SOURCE_URL="https://github.com/casey/intermodal"
echo -e "\n\n [+] (Building | Fetching) $BIN :: $SOURCE_URL\n"
#Fetch
eval "$EGET_TIMEOUT" eget "$SOURCE_URL" --asset "linux" --asset "aarch64" --asset "musl" --asset "tar.gz" --file "imdl" "$EGET_EXCLUDE" --to "$BINDIR/imdl"
objcopy --remove-section=".comment" --remove-section=".note.*" "$BINDIR/imdl"
strip --strip-debug --strip-dwo --strip-unneeded --preserve-dates "$BINDIR/imdl"
cp "$BINDIR/imdl" "$BINDIR/intermodal" ; file "$BINDIR/imdl" && du -sh "$BINDIR/imdl"
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
#-------------------------------------------------------#
8 changes: 8 additions & 0 deletions .github/scripts/aarch64_Linux/bins/intermodal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: "intermodal"
description: "A CLI utility for BitTorrent torrent file creation, verification, and more"
web_url: "https://github.com/casey/intermodal"
repo_url: "https://github.com/casey/intermodal"
path: "/"
bins:
- "imdl"
- "intermodal"
65 changes: 65 additions & 0 deletions .github/scripts/aarch64_Linux/bins/tget.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/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
#tget : wget but for torrents
export BIN="tget"
export SOURCE_URL="https://github.com/sweetbbak/tget"
echo -e "\n\n [+] (Building | Fetching) $BIN :: $SOURCE_URL\n"
#Build (alpine-musl)
pushd "$($TMPDIRS)" >/dev/null 2>&1
docker stop "alpine-builder" 2>/dev/null ; docker rm "alpine-builder" 2>/dev/null
docker run --privileged --net="host" --name "alpine-builder" "azathothas/alpine-builder:latest" \
bash -c '
#Setup ENV
mkdir -p "/build-bins" && pushd "$(mktemp -d)" >/dev/null 2>&1
#Build
git clone --quiet --filter "blob:none" "https://github.com/sweetbbak/tget" && cd "./tget"
GOOS="linux" GOARCH="arm64" CGO_ENABLED="1" CGO_CFLAGS="-O2 -flto=auto -fPIE -fpie -static -w -pipe" go build -v -trimpath -buildmode="pie" -ldflags="-s -w -buildid= -linkmode=external -extldflags '\''-s -w -static-pie -Wl,--build-id=none'\''" "./cmd/tget"
#strip & info
find "." -maxdepth 1 -type f -exec file -i "{}" \; | grep "application/.*executable" | cut -d":" -f1 | xargs realpath | xargs -I {} rsync -av --copy-links --exclude="*/" "{}" "/build-bins/"
find "/build-bins/" -type f -exec objcopy --remove-section=".comment" --remove-section=".note.*" "{}" \;
find "/build-bins/" -type f ! -name "*.AppImage" -exec strip --strip-debug --strip-dwo --strip-unneeded --preserve-dates "{}" \; 2>/dev/null
file "/build-bins/"* && du -sh "/build-bins/"*
popd >/dev/null 2>&1
'
#Copy
docker cp "alpine-builder:/build-bins/." "$(pwd)/" ; find "." -maxdepth 1 -type f -exec file -i "{}" \; | grep "application/.*executable" | cut -d":" -f1 | xargs realpath
#Meta
find "." -maxdepth 1 -type f -exec sh -c 'file "{}"; du -sh "{}"' \;
sudo rsync -av --copy-links --exclude="*/" "./." "$BINDIR"
#Delete Containers
docker stop "alpine-builder" 2>/dev/null ; docker rm "alpine-builder"
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
#-------------------------------------------------------#
7 changes: 7 additions & 0 deletions .github/scripts/aarch64_Linux/bins/tget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: "tget"
description: "wget but for torrents"
web_url: "https://github.com/sweetbbak/tget"
repo_url: "https://github.com/sweetbbak/tget"
path: "/"
bins:
- "tget"
5 changes: 4 additions & 1 deletion .github/scripts/aarch64_Linux/bins/toru.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ if [ "$SKIP_BUILD" == "NO" ]; then
git clone --quiet --filter "blob:none" "https://github.com/sweetbbak/toru" && cd "./toru"
GOOS="linux" GOARCH="arm64" CGO_ENABLED="1" CGO_CFLAGS="-O2 -flto=auto -fPIE -fpie -static -w -pipe" go build -v -trimpath -buildmode="pie" -ldflags="-s -w -buildid= -linkmode=external -extldflags '\''-s -w -static-pie -Wl,--build-id=none'\''" "./cmd/toru"
#strip & info
find "." -maxdepth 1 -type f -exec file -i "{}" \; | grep "application/.*executable" | cut -d":" -f1 | xargs realpath | xargs -I {} cp --force {} /build-bins/
find "." -maxdepth 1 -type f -exec file -i "{}" \; | grep "application/.*executable" | cut -d":" -f1 | xargs realpath | xargs -I {} rsync -av --copy-links --exclude="*/" "{}" "/build-bins/"
find "/build-bins/" -type f -exec objcopy --remove-section=".comment" --remove-section=".note.*" "{}" \;
find "/build-bins/" -type f ! -name "*.AppImage" -exec strip --strip-debug --strip-dwo --strip-unneeded --preserve-dates "{}" \; 2>/dev/null
file "/build-bins/"* && du -sh "/build-bins/"*
popd >/dev/null 2>&1
'
#Copy
Expand Down
45 changes: 45 additions & 0 deletions .github/scripts/x86_64_Linux/bins/intermodal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/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
#intermodal : A CLI utility for BitTorrent torrent file creation, verification, and more
export BIN="intermodal"
export SOURCE_URL="https://github.com/casey/intermodal"
echo -e "\n\n [+] (Building | Fetching) $BIN :: $SOURCE_URL\n"
#Fetch
eval "$EGET_TIMEOUT" eget "$SOURCE_URL" --asset "linux" --asset "x86_64" --asset "musl" --asset "tar.gz" --file "imdl" "$EGET_EXCLUDE" --to "$BINDIR/imdl"
objcopy --remove-section=".comment" --remove-section=".note.*" "$BINDIR/imdl"
strip --strip-debug --strip-dwo --strip-unneeded --preserve-dates "$BINDIR/imdl"
cp "$BINDIR/imdl" "$BINDIR/intermodal" ; file "$BINDIR/imdl" && du -sh "$BINDIR/imdl"
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
#-------------------------------------------------------#
8 changes: 8 additions & 0 deletions .github/scripts/x86_64_Linux/bins/intermodal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: "intermodal"
description: "A CLI utility for BitTorrent torrent file creation, verification, and more"
web_url: "https://github.com/casey/intermodal"
repo_url: "https://github.com/casey/intermodal"
path: "/"
bins:
- "imdl"
- "intermodal"
93 changes: 93 additions & 0 deletions .github/scripts/x86_64_Linux/bins/simplex-chat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/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
SKIP_BUILD="YES" #WIP
if [ "$SKIP_BUILD" == "NO" ]; then
#simplex-chat : SimpleX Chat terminal (console) app
export BIN="simplex-chat"
export SOURCE_URL="https://github.com/simplex-chat/simplex-chat"
echo -e "\n\n [+] (Building | Fetching) $BIN :: $SOURCE_URL\n"
##Build (alpine-musl)
pushd "$($TMPDIRS)" >/dev/null 2>&1
docker stop "alpine-builder" 2>/dev/null ; docker rm "alpine-builder" 2>/dev/null
docker run --privileged --net="host" --name "alpine-builder" "alpine:latest" \
sh -c '
#Setup ENV
mkdir -p "/build-bins" && cd "$(mktemp -d)" >/dev/null 2>&1
apk update && apk upgrade --no-interactive 2>/dev/null
#CoreUtils
apk add alpine-sdk alpine-base coreutils croc curl file git grep jq moreutils nano ncdu rsync sudo tar util-linux xz 7zip --latest --upgrade --no-interactive 2>/dev/null
#Deps
apk add ghc-dev gmp-dev openssl-dev openssl-libs-static zlib-dev zlib-static --latest --upgrade --no-interactive 2>/dev/null
ln -s "/usr/lib/libncursesw.so.6" "/usr/lib/libtinfow.so.6"
#Install ghcup: https://github.com/simplex-chat/simplex-chat/blob/stable/Dockerfile
export BOOTSTRAP_HASKELL_GHC_VERSION="9.6.3"
export BOOTSTRAP_HASKELL_CABAL_VERSION="3.10.1.0"
curl -qfsSL "https://get-ghcup.haskell.org" | BOOTSTRAP_HASKELL_NONINTERACTIVE="1" sh
export PATH="/root/.cabal/bin:/root/.ghcup/bin:${PATH}" ; ghcup --version
#ghcup install ghc "latest" ; ghcup set ghc "latest"
#ghcup install cabal "latest" ; ghcup set cabal "latest"
ghcup set ghc "${BOOTSTRAP_HASKELL_GHC_VERSION}"
ghcup set cabal "${BOOTSTRAP_HASKELL_CABAL_VERSION}"
cabal install hpack --install-method="copy" --installdir="/usr/local/bin"
#Build
cd "$(mktemp -d)" >/dev/null 2>&1 && git clone --filter "blob:none" --quiet "https://github.com/simplex-chat/simplex-chat" && cd "./simplex-chat"
cp "./scripts/cabal.project.local.linux" "./cabal.project.local"
sed '\''/- -Wunused-type-patterns/a\ - -O2\n\ - -split-sections\n\ - -with-rtsopts=-N\n\ - -static\n\cc-options: -static -w -pipe\n\ld-options: -static -pthread -s -Wl,-S -Wl,--build-id=none'\'' -i "./package.yaml"
sed '/- -Wunused-type-patterns/a\ - -O2\n\ - -split-sections\n\ - -with-rtsopts=-N\n\ - -static\n\cc-options: -static -w -pipe\n\ld-options: -static -pthread -s -Wl,-S -Wl,--build-id=none' -i "./package.yaml"
#Reconfigure cabal project
cabal clean ; hpack ; cabal update
cabal build "exe:simplex-chat" --allow-newer --jobs="$(($(nproc)+1))" --keep-going
find /project/dist-newstyle -name "simplex-chat" -type f -executable
#Copy
#cp "./simplex-chat" "/build-bins/simplex-chat"
find "." -maxdepth 1 -type f -exec file -i "{}" \; | grep "application/.*executable" | cut -d":" -f1 | xargs realpath | xargs -I {} cp --force {} /build-bins/
#strip & info
find "/build-bins/" -type f -exec objcopy --remove-section=".comment" --remove-section=".note.*" "{}" \;
find "/build-bins/" -type f ! -name "*.AppImage" -exec strip --strip-debug --strip-dwo --strip-unneeded --preserve-dates "{}" \; 2>/dev/null
file "/build-bins/"* && du -sh "/build-bins/"*
'
#Copy & Meta
docker cp "alpine-builder:/build-bins/." "$(pwd)/"
find "." -maxdepth 1 -type f -exec file -i "{}" \; | grep "application/.*executable" | cut -d":" -f1 | xargs realpath
#Meta
find "." -maxdepth 1 -type f -exec sh -c 'file "{}"; du -sh "{}"' \;
sudo rsync -av --copy-links --exclude="*/" "./." "$BINDIR"
#Delete Containers
docker stop "alpine-builder" 2>/dev/null ; docker rm "alpine-builder"
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
#-------------------------------------------------------#
65 changes: 65 additions & 0 deletions .github/scripts/x86_64_Linux/bins/tget.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/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
#tget : wget but for torrents
export BIN="tget"
export SOURCE_URL="https://github.com/sweetbbak/tget"
echo -e "\n\n [+] (Building | Fetching) $BIN :: $SOURCE_URL\n"
#Build (alpine-musl)
pushd "$($TMPDIRS)" >/dev/null 2>&1
docker stop "alpine-builder" 2>/dev/null ; docker rm "alpine-builder" 2>/dev/null
docker run --privileged --net="host" --name "alpine-builder" "azathothas/alpine-builder:latest" \
bash -c '
#Setup ENV
mkdir -p "/build-bins" && pushd "$(mktemp -d)" >/dev/null 2>&1
#Build
git clone --quiet --filter "blob:none" "https://github.com/sweetbbak/tget" && cd "./tget"
GOOS="linux" GOARCH="amd64" CGO_ENABLED="1" CGO_CFLAGS="-O2 -flto=auto -fPIE -fpie -static -w -pipe" go build -v -trimpath -buildmode="pie" -ldflags="-s -w -buildid= -linkmode=external -extldflags '\''-s -w -static-pie -Wl,--build-id=none'\''" "./cmd/tget"
#strip & info
find "." -maxdepth 1 -type f -exec file -i "{}" \; | grep "application/.*executable" | cut -d":" -f1 | xargs realpath | xargs -I {} rsync -av --copy-links --exclude="*/" "{}" "/build-bins/"
find "/build-bins/" -type f -exec objcopy --remove-section=".comment" --remove-section=".note.*" "{}" \;
find "/build-bins/" -type f ! -name "*.AppImage" -exec strip --strip-debug --strip-dwo --strip-unneeded --preserve-dates "{}" \; 2>/dev/null
file "/build-bins/"* && du -sh "/build-bins/"*
popd >/dev/null 2>&1
'
#Copy
docker cp "alpine-builder:/build-bins/." "$(pwd)/" ; find "." -maxdepth 1 -type f -exec file -i "{}" \; | grep "application/.*executable" | cut -d":" -f1 | xargs realpath
#Meta
find "." -maxdepth 1 -type f -exec sh -c 'file "{}"; du -sh "{}"' \;
sudo rsync -av --copy-links --exclude="*/" "./." "$BINDIR"
#Delete Containers
docker stop "alpine-builder" 2>/dev/null ; docker rm "alpine-builder"
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
#-------------------------------------------------------#
7 changes: 7 additions & 0 deletions .github/scripts/x86_64_Linux/bins/tget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: "tget"
description: "wget but for torrents"
web_url: "https://github.com/sweetbbak/tget"
repo_url: "https://github.com/sweetbbak/tget"
path: "/"
bins:
- "tget"
5 changes: 4 additions & 1 deletion .github/scripts/x86_64_Linux/bins/toru.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ if [ "$SKIP_BUILD" == "NO" ]; then
git clone --quiet --filter "blob:none" "https://github.com/sweetbbak/toru" && cd "./toru"
GOOS="linux" GOARCH="amd64" CGO_ENABLED="1" CGO_CFLAGS="-O2 -flto=auto -fPIE -fpie -static -w -pipe" go build -v -trimpath -buildmode="pie" -ldflags="-s -w -buildid= -linkmode=external -extldflags '\''-s -w -static-pie -Wl,--build-id=none'\''" "./cmd/toru"
#strip & info
find "." -maxdepth 1 -type f -exec file -i "{}" \; | grep "application/.*executable" | cut -d":" -f1 | xargs realpath | xargs -I {} cp --force {} /build-bins/
find "." -maxdepth 1 -type f -exec file -i "{}" \; | grep "application/.*executable" | cut -d":" -f1 | xargs realpath | xargs -I {} rsync -av --copy-links --exclude="*/" "{}" "/build-bins/"
find "/build-bins/" -type f -exec objcopy --remove-section=".comment" --remove-section=".note.*" "{}" \;
find "/build-bins/" -type f ! -name "*.AppImage" -exec strip --strip-debug --strip-dwo --strip-unneeded --preserve-dates "{}" \; 2>/dev/null
file "/build-bins/"* && du -sh "/build-bins/"*
popd >/dev/null 2>&1
'
#Copy
Expand Down

0 comments on commit cd89728

Please sign in to comment.