add template functions

This commit is contained in:
2026-06-03 00:23:08 +06:30
parent d7ffc17d71
commit d8781c3981
6 changed files with 146 additions and 10 deletions

View File

@@ -1,9 +1,9 @@
#!/bin/bash
APP_NAME="libgofunc"
VERSION="${1:-v0.1.3}"
OUTPUT_DIR="assets"
BUILD_DIR="build"
VERSION="${1:-v0.1.5}"
OUTPUT_DIR="../assets"
BUILD_DIR="../build"
# need Android NDK
NDK_HOME="$HOME/Android/Sdk/ndk/28.2.13676358" # <--- CHECK YOUR VERSION
@@ -11,7 +11,7 @@ API=21
TOOLCHAIN="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin"
OS="$(uname -s)"
cd cmd
if [ "$OS" = "Darwin" ]; then
export IOS_SDK=$(xcrun --sdk iphoneos --show-sdk-path)
export IOS_SIM_SDK=$(xcrun --sdk iphonesimulator --show-sdk-path)
@@ -27,7 +27,7 @@ if [ "$OS" = "Darwin" ]; then
CC="$(xcrun --sdk iphonesimulator --find clang)" \
CGO_CFLAGS="-isysroot $IOS_SIM_SDK -arch x86_64" \
CGO_LDFLAGS="-isysroot $IOS_SIM_SDK -arch x86_64" \
go build -buildmode=c-archive -o build/ios/sim/libgofunc_arm64_sim.a .
go build ./cmd -buildmode=c-archive -o build/ios/sim/libgofunc_arm64_sim.a .
# xcodebuild -create-xcframework \
# -library build/ios/device/libgofunc_arm64.a -headers build/ios/device/ \
@@ -74,7 +74,7 @@ elif [ "$OS" = "Linux" ]; then
tar -czf "${OUTPUT_DIR}/${VERSION}/${ARCHIVE_NAME}" -C "${BUILD_DIR}" ./${VERSION}/${ARCH}
export HTTPS_PROXY="socks5://localhost:8080"
rclone copy ./assets/${VERSION} s3:mokkon/libs/libgofunc/${VERSION}
rclone copy ../assets/${VERSION} s3:mokkon/libs/libgofunc/${VERSION}
else
echo "Unsupported OS: $OS"
exit 1