mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-07-10 05:28:43 +08:00
41 lines
1.1 KiB
TOML
41 lines
1.1 KiB
TOML
#TODO compiling, not tested further
|
|
[source]
|
|
git = "https://github.com/willnode/go"
|
|
branch = "go-1.25-redox"
|
|
shallow_clone = true
|
|
|
|
[build]
|
|
template = "custom"
|
|
script = """
|
|
export PATH=$HOME/go/bin:$PATH
|
|
|
|
rm -rf $HOME/.cache/go-build
|
|
export GOPATH=${COOKBOOK_BUILD}/gopath
|
|
if ! command -v go &> /dev/null; then
|
|
GO_TARBALL=go1.24.6.linux-$( [ "$(uname -m)" = "aarch64" ] && echo "arm64" || echo "amd64" ).tar.gz
|
|
GO_DOWNLOAD_URL="https://dl.google.com/go/${GO_TARBALL}"
|
|
echo "Installing Go..."
|
|
wget -q --show-progress "${GO_DOWNLOAD_URL}"
|
|
tar -C "$HOME" -xzf "${GO_TARBALL}"
|
|
fi
|
|
|
|
# Go does not support out-of-tree builds :(
|
|
rsync -a --delete "${COOKBOOK_SOURCE}/" ./
|
|
|
|
export GOOS=redox
|
|
case "${TARGET}" in
|
|
x86-unknown-redox) export GOARCH=386;;
|
|
x86_64-unknown-redox) export GOARCH=amd64;;
|
|
aarch64-unknown-redox) export GOARCH=arm64;;
|
|
riscv64-unknown-redox) export GOARCH=riscv64;;
|
|
esac
|
|
|
|
export CGO_ENABLED=1
|
|
export CC=x86_64-unknown-redox-gcc
|
|
export CCX=x86_64-unknown-redox-g++
|
|
(cd ./src && bash ./make.bash)
|
|
|
|
mkdir -p ${COOKBOOK_STAGE}/bin
|
|
rsync -a --delete "bin/redox_${GOARCH}/" ${COOKBOOK_STAGE}/bin
|
|
"""
|