From bb894f7f9404704f8098758319fb88f030f17d90 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 7 Oct 2025 07:13:19 -0500 Subject: fix darwin builds --- .gitignore | 2 +- Makefile | 16 ++++++++++++++++ tableRepos.go | 5 +++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 69c33cd..378b866 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ *.swp go.mod go.sum -wit +wit* wit-test /files/* *.deb diff --git a/Makefile b/Makefile index ab8cb2b..c85cc0d 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +.PHONY: build + VERSION = $(shell git describe --tags) GUIVERSION = $(shell git describe --tags) # BUILDTIME = $(shell date +%Y.%m.%d) @@ -5,6 +7,8 @@ BUILDTIME = $(shell date +%s) all: install +build-all-oses: go-build build-darwin build-windows + go-build: goimports GO111MODULE=off go build \ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" @@ -17,6 +21,18 @@ install: goimports GO111MODULE=off go install \ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" +build-darwin: + GOOS=darwin GOARCH=amd64 GO111MODULE=off go build -v -o wit-darwin.x86 \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + +build-darwin-arm64: + GOOS=darwin GOARCH=arm64 GO111MODULE=off go build -v -o wit-darwin.arm \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + +build-windows: + GOOS=windows GOARCH=amd64 GO111MODULE=off go build -v -o wit.exe \ + -ldflags "-X main.VERSION=v0.7.46 -X main.BUILDTIME=2025.02.22_0643 -X gui.GUIVERSION=v0.7.46" + vet: GO111MODULE=off go vet diff --git a/tableRepos.go b/tableRepos.go index 7d322fc..0b0b719 100644 --- a/tableRepos.go +++ b/tableRepos.go @@ -4,6 +4,8 @@ package main import ( + "fmt" + "go.wit.com/lib/protobuf/gitpb" ) @@ -24,6 +26,9 @@ func debianFilename(repo *gitpb.Repo) string { ver := trimNonNumericFromStart(manufactured) name := me.forge.Config.DebName(repo.Namespace) if actualp := me.machine.FindByVersion(name, ver); actualp != nil { + if actualp.PkgName == "" { + return fmt.Sprintf("%v", actualp) + } return actualp.PkgName } return "hmm" -- cgit v1.2.3