linux joiner

This commit is contained in:
kulikov0 committed 2026-05-11 18:01:34 +02:00
1 parent 30ed29a161
commit 18358c8927
17 files changed
+185 -86

No files matched your search

+63
View File
@@ -0,0 +1,63 @@
#!/bin/sh
set -e
# Builds the desktop-joiner Go binary for Windows and Linux, plus
# fetches wintun.dll for Windows. Output lives next to the Go source
# in joiner-desktop-app/desktop-joiner/. Nothing is written to
# prebuilts/. Run ./build-joiner-app.sh afterwards to produce the
# Electron installers.
ROOT="$(cd "$(dirname "$0")" && pwd)"
JOINER_GO_DIR="$ROOT/joiner-desktop-app/desktop-joiner"
WINTUN_VERSION="0.14.1"
WINTUN_URL="https://www.wintun.net/builds/wintun-${WINTUN_VERSION}.zip"
build_windows() {
GOARCH_GO="$1"
OUT_TAG="$2"
WINTUN_ARCH="$3"
echo ""
echo "=== Building desktop-joiner windows-$OUT_TAG (GOARCH=$GOARCH_GO) ==="
cd "$JOINER_GO_DIR"
GOOS=windows GOARCH="$GOARCH_GO" go build \
-trimpath -ldflags="-s -w" \
-o "$JOINER_GO_DIR/desktop-joiner-windows-$OUT_TAG.exe" .
ls -lh "$JOINER_GO_DIR/desktop-joiner-windows-$OUT_TAG.exe"
if [ ! -f "$JOINER_GO_DIR/wintun-$OUT_TAG.dll" ]; then
if [ ! -f "$JOINER_GO_DIR/wintun.zip" ]; then
echo "[wintun] downloading $WINTUN_URL"
curl -L -o "$JOINER_GO_DIR/wintun.zip" "$WINTUN_URL"
fi
echo "[wintun] extracting $WINTUN_ARCH"
unzip -o -j "$JOINER_GO_DIR/wintun.zip" "wintun/bin/$WINTUN_ARCH/wintun.dll" \
-d "$JOINER_GO_DIR" >/dev/null
mv "$JOINER_GO_DIR/wintun.dll" "$JOINER_GO_DIR/wintun-$OUT_TAG.dll"
fi
ls -lh "$JOINER_GO_DIR/wintun-$OUT_TAG.dll"
}
build_linux() {
GOARCH_GO="$1"
OUT_TAG="$2"
echo ""
echo "=== Building desktop-joiner linux-$OUT_TAG (GOARCH=$GOARCH_GO) ==="
cd "$JOINER_GO_DIR"
GOOS=linux GOARCH="$GOARCH_GO" go build \
-trimpath -ldflags="-s -w" \
-o "$JOINER_GO_DIR/desktop-joiner-linux-$OUT_TAG" .
ls -lh "$JOINER_GO_DIR/desktop-joiner-linux-$OUT_TAG"
}
build_windows amd64 x64 amd64
build_windows arm64 arm64 arm64
build_windows 386 ia32 x86
build_linux amd64 x64
build_linux arm64 arm64
rm -f "$JOINER_GO_DIR/wintun.zip"
echo ""
echo "=== Done ==="
ls -lh "$JOINER_GO_DIR"/desktop-joiner-* "$JOINER_GO_DIR"/wintun-*.dll