Files
stfs/Hydrunfile

40 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
set -e
# Install native dependencies
apt update
apt install -y curl
# Go
if [ "$1" = "go" ]; then
# Install bagop
curl -L -o /tmp/bagop "https://github.com/pojntfx/bagop/releases/latest/download/bagop.linux-$(uname -m)"
install /tmp/bagop /usr/local/bin
# Generate dependencies
make depend
# Build
CGO_ENABLED=0 bagop -j "$(nproc)" -b stfs -x '(android/*|ios/*|aix/*|plan9/*|illumos/*|dragonfly/*|netbsd/*|openbsd/*|solaris/*|freebsd/(386|arm)|js/wasm|linux/(mips|ppc64|riscv64)|windows/arm)' -p 'make build/stfs DST=$DST' -d out
exit 0
exit 0
fi
# gccgo
if [ "$1" = "gccgo" ]; then
# Install bagccgop
curl -L -o /tmp/bagccgop "https://github.com/pojntfx/bagccgop/releases/latest/download/bagccgop.linux-$(uname -m)"
install /tmp/bagccgop /usr/local/bin
# Generate dependencies
make depend
# Build
GOFLAGS='-gccgoflags=-static' bagccgop -x '(linux/alpha|linux/mipsle|linux/arm$|linux/arm64|linux/386|linux/amd64|linux/s390x)' -j1 -b stfs -n -r 'make depend' -s 'build-essential,automake' -m 'libsqlite3-dev' -p 'chmod +w /root/go/pkg/mod/google.golang.org/grpc@*/internal/channelz/types_linux.go && sed -i "s/SO_SNDTIMEO/SO_RCVTIMEO/" /root/go/pkg/mod/google.golang.org/grpc@*/internal/channelz/types_linux.go && make build/stfs DST=$DST' -d out
exit 0
fi