Linux build stuff

This commit is contained in:
Andy Dixon
2026-04-28 14:56:13 +01:00
parent 88be0ceb41
commit 23aaa1b53e
5 changed files with 195 additions and 11 deletions
+20 -2
View File
@@ -16,6 +16,14 @@ log() { echo -e "${GREEN}[nexus]${NC} $1"; }
warn() { echo -e "${YELLOW}[nexus]${NC} $1"; }
err() { echo -e "${RED}[nexus]${NC} $1" >&2; }
build_tags() {
if command -v pkg-config >/dev/null 2>&1 \
&& pkg-config --exists webkit2gtk-4.1 \
&& ! pkg-config --exists webkit2gtk-4.0; then
echo "webkit2_41"
fi
}
build_version() {
local tag
local commit
@@ -100,6 +108,8 @@ build_target() {
local version="$4"
local ldflags
ldflags="$(build_ldflags "${version}")"
local tags
tags="$(build_tags)"
local platform="${target_os}/${target_arch}"
local cc=""
@@ -114,9 +124,17 @@ build_target() {
log "Building ${platform}…"
if [ -n "$cc" ]; then
CC="$cc" CGO_ENABLED=1 wails build -platform "$platform" -ldflags "$ldflags"
if [ -n "$tags" ]; then
CC="$cc" CGO_ENABLED=1 wails build -platform "$platform" -tags "$tags" -ldflags "$ldflags"
else
CC="$cc" CGO_ENABLED=1 wails build -platform "$platform" -ldflags "$ldflags"
fi
else
CGO_ENABLED=1 wails build -platform "$platform" -ldflags "$ldflags"
if [ -n "$tags" ]; then
CGO_ENABLED=1 wails build -platform "$platform" -tags "$tags" -ldflags "$ldflags"
else
CGO_ENABLED=1 wails build -platform "$platform" -ldflags "$ldflags"
fi
fi
}