From 63c8a6d173aa461a22f8ba4b04e91ebe9c0aede3 Mon Sep 17 00:00:00 2001 From: nasso Date: Sun, 11 May 2025 01:26:02 +0200 Subject: [PATCH] add build script --- build.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..52afa350 --- /dev/null +++ b/build.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -ex + +export CGO_ENABLED=1 +export GOARCH=arm64 +export GOOS=linux +export CC=aarch64-linux-musl-gcc +export CXX=aarch64-linux-musl-g++ + +# /usr/local/bin/knot +go build \ + --ldflags '-linkmode external -extldflags "-static"' \ + -o .bin/knot ./cmd/knot + +# install script helper +cat << EOF > .bin/install.sh +#!/bin/sh + +set -ex + +install -g root -o root knot /usr/local/bin/knot +EOF +chmod +x .bin/install.sh -- 2.51.2