git: 853fd2544f69 - main - sysutils/skopeo: fix source build when git binary is present
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 24 Oct 2025 22:58:39 UTC
The branch main has been updated by dch:
URL: https://cgit.FreeBSD.org/ports/commit/?id=853fd2544f696b59b7c622b560a41b3e2e8da88f
commit 853fd2544f696b59b7c622b560a41b3e2e8da88f
Author: Dave Cottlehuber <dch@FreeBSD.org>
AuthorDate: 2025-10-24 22:57:04 +0000
Commit: Dave Cottlehuber <dch@FreeBSD.org>
CommitDate: 2025-10-24 22:58:25 +0000
sysutils/skopeo: fix source build when git binary is present
If git is present, go will attempt to extract the version from the ports
git repo, which is not the git repo of skopeo itself. explicitly block
the discovery mechanism.
$ skopeo -v
skopeo version 1.20.0 commit: "unknown"
Sponsored by: SkunkWerks, GmbH
Reported by: Robert Gogolok mastodon.bsd.cafe/@gogo
---
sysutils/skopeo/files/patch-Makefile | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/sysutils/skopeo/files/patch-Makefile b/sysutils/skopeo/files/patch-Makefile
new file mode 100644
index 000000000000..9e47fcbdd889
--- /dev/null
+++ b/sysutils/skopeo/files/patch-Makefile
@@ -0,0 +1,23 @@
+--- Makefile.orig 2025-10-17 08:57:36 UTC
++++ Makefile
+@@ -84,7 +84,7 @@ EXTRA_LDFLAGS ?=
+ GIT_COMMIT := $(shell GIT_CEILING_DIRECTORIES=$$(cd ..; pwd) git rev-parse HEAD 2> /dev/null || true)
+
+ EXTRA_LDFLAGS ?=
+-SKOPEO_LDFLAGS := -ldflags '-X main.gitCommit=${GIT_COMMIT} $(EXTRA_LDFLAGS)'
++SKOPEO_LDFLAGS := -ldflags '-X main.gitCommit="unknown" $(EXTRA_LDFLAGS)'
+
+ MANPAGES_MD = $(wildcard docs/*.md)
+ MANPAGES ?= $(MANPAGES_MD:%.md=%)
+@@ -131,9 +131,9 @@ bin/skopeo:
+ # Build w/o using containers
+ .PHONY: bin/skopeo
+ bin/skopeo:
+- $(GO) build ${GO_DYN_FLAGS} ${SKOPEO_LDFLAGS} -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o $@ ./cmd/skopeo
++ $(GO) build -buildvcs=false ${GO_DYN_FLAGS} ${SKOPEO_LDFLAGS} -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o $@ ./cmd/skopeo
+ bin/skopeo.%:
+- GOOS=$(word 2,$(subst ., ,$@)) GOARCH=$(word 3,$(subst ., ,$@)) $(GO) build ${SKOPEO_LDFLAGS} -tags "containers_image_openpgp $(BUILDTAGS)" -o $@ ./cmd/skopeo
++ GOOS=$(word 2,$(subst ., ,$@)) GOARCH=$(word 3,$(subst ., ,$@)) $(GO) build -buildvcs=false ${SKOPEO_LDFLAGS} -tags "containers_image_openpgp $(BUILDTAGS)" -o $@ ./cmd/skopeo
+ local-cross: bin/skopeo.darwin.amd64 bin/skopeo.linux.arm bin/skopeo.linux.arm64 bin/skopeo.windows.386.exe bin/skopeo.windows.amd64.exe
+
+ $(MANPAGES): %: %.md