build_gitea: multi arch/cross-compile support

This commit is contained in:
minoplhy 2024-11-08 17:39:47 +07:00
parent c78984fcdd
commit 4838e809c6
Signed by: minoplhy
GPG Key ID: 41D406044E2434BF
2 changed files with 87 additions and 18 deletions

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@ while [ ${#} -gt 0 ]; do
esac esac
;; ;;
--patch=* ) --patch=* )
PATCH_FILES="${1#*=}" PATCH_FILES="${1#*=}"
case $PATCH_FILES in case $PATCH_FILES in
"") "")
echo "ERROR: --patch= is empty!" echo "ERROR: --patch= is empty!"
@ -55,8 +55,23 @@ while [ ${#} -gt 0 ]; do
;; ;;
*) *)
;; ;;
esac esac # Add Patches to your Gitea build. Format -> patch1.patch or patch1.patch,https://patch (Absolute path)
;; # Add Patches to your Gitea build. Format -> patch1.patch or patch1.patch,https://patch (Absolute path) ;;
--build-arch=* )
BUILD_ARCH="${1#*=}"
case $BUILD_ARCH in
"x86_64") BUILD_ARCH="x86_64" ;;
"aarch64") BUILD_ARCH="aarch64" ;;
"")
echo "ERROR : --build-arch= is empty!"
exit 1
;;
*)
echo "ERROR : Vaild values for --build-arch are -> x86_64, aarch64"
exit 1
;;
esac # Architect for your binary to be build. This is for Cross-compiling etc.
;;
*) *)
;; ;;
esac esac
@ -66,4 +81,5 @@ done
# Known Issues # Known Issues
- For Alpine Linux: to get `npm` installation working, please ensure community package is enable in `/etc/apk/repositories`
- This script required root privileges because of dependencies installation, which is hard to avoid. - This script required root privileges because of dependencies installation, which is hard to avoid.