Implement multi-platform build system with pure Go support
- Introduced a comprehensive build system that supports multiple platforms (Linux, macOS, Windows, Android) using pure Go builds (`CGO_ENABLED=0`). - Updated all build and test scripts to ensure compatibility with the new purego approach, allowing for dynamic loading of `libsecp256k1` at runtime. - Added detailed documentation on the build process, platform detection, and deployment options. - Enhanced CI/CD workflows to automate builds for all supported platforms and include necessary libraries in releases. - Updated `.gitignore` to exclude build output files. - Created new documentation files for deployment and multi-platform build summaries.
This commit is contained in:
@@ -159,9 +159,15 @@ build_application() {
|
||||
./scripts/update-embedded-web.sh
|
||||
|
||||
# Build the binary in the current directory
|
||||
log_info "Building binary in current directory..."
|
||||
log_info "Building binary in current directory (pure Go + purego)..."
|
||||
CGO_ENABLED=0 go build -o "$BINARY_NAME"
|
||||
|
||||
# Copy libsecp256k1.so next to the binary (optional, for runtime performance)
|
||||
if [[ -f "pkg/crypto/p8k/libsecp256k1.so" ]]; then
|
||||
cp pkg/crypto/p8k/libsecp256k1.so .
|
||||
log_info "Copied libsecp256k1.so next to binary (runtime optional)"
|
||||
fi
|
||||
|
||||
if [[ -f "./$BINARY_NAME" ]]; then
|
||||
log_success "ORLY relay built successfully"
|
||||
else
|
||||
@@ -190,10 +196,16 @@ install_binary() {
|
||||
# Ensure GOBIN directory exists
|
||||
mkdir -p "$GOBIN"
|
||||
|
||||
# Copy binary
|
||||
# Copy binary and library
|
||||
cp "./$BINARY_NAME" "$GOBIN/"
|
||||
chmod +x "$GOBIN/$BINARY_NAME"
|
||||
|
||||
# Copy library if it exists
|
||||
if [[ -f "./libsecp256k1.so" ]]; then
|
||||
cp "./libsecp256k1.so" "$GOBIN/"
|
||||
log_info "Copied libsecp256k1.so to $GOBIN/"
|
||||
fi
|
||||
|
||||
log_success "Binary installed to $GOBIN/$BINARY_NAME"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user