From ebc5573e83fc97d2896a619af6a19d2981c8de74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Thu, 19 May 2022 21:59:58 +0200 Subject: [PATCH] Stop calling gpgme-config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As of the just-updated github.com/proglottis/gpgme 0.1.2, the gpgme subpackage uses CGo's native #cgo pkg-config support to find the relevant libraries, and we no longer need to manually set CGO_CFLAGS and CGO_LDFLAGS. So stop doing that. Note that the proglottis/gpgme update (implied by vendoring c/image) means the minimal supported version of GPGME is 1.13.0. Signed-off-by: Miloslav Trmač --- Makefile | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index d899c78a..04c3f97f 100644 --- a/Makefile +++ b/Makefile @@ -2,14 +2,6 @@ export GOPROXY=https://proxy.golang.org -# On some platforms (eg. macOS, FreeBSD) gpgme is installed in /usr/local/ but /usr/local/include/ is -# not in the default search path. Rather than hard-code this directory, use gpgme-config. -# Sadly that must be done at the top-level user instead of locally in the gpgme subpackage, because cgo -# supports only pkg-config, not general shell scripts, and gpgme does not install a pkg-config file. -# If gpgme is not installed or gpgme-config can’t be found for other reasons, the error is silently ignored -# (and the user will probably find out because the cgo compilation will fail). -GPGME_ENV := CGO_CFLAGS="$(shell gpgme-config --cflags 2>/dev/null)" CGO_LDFLAGS="$(shell gpgme-config --libs 2>/dev/null)" - # The following variables very roughly follow https://www.gnu.org/prep/standards/standards.html#Makefile-Conventions . DESTDIR ?= PREFIX ?= /usr/local @@ -141,7 +133,7 @@ binary: cmd/skopeo # Build w/o using containers .PHONY: bin/skopeo bin/skopeo: - $(GPGME_ENV) $(GO) build $(MOD_VENDOR) ${GO_DYN_FLAGS} ${SKOPEO_LDFLAGS} -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o $@ ./cmd/skopeo + $(GO) build $(MOD_VENDOR) ${GO_DYN_FLAGS} ${SKOPEO_LDFLAGS} -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o $@ ./cmd/skopeo bin/skopeo.%: GOOS=$(word 2,$(subst ., ,$@)) GOARCH=$(word 3,$(subst ., ,$@)) $(GO) build $(MOD_VENDOR) ${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 @@ -231,7 +223,7 @@ validate-docs: hack/xref-helpmsgs-manpages test-unit-local: bin/skopeo - $(GPGME_ENV) $(GO) test $(MOD_VENDOR) -tags "$(BUILDTAGS)" $$($(GO) list $(MOD_VENDOR) -tags "$(BUILDTAGS)" -e ./... | grep -v '^github\.com/containers/skopeo/\(integration\|vendor/.*\)$$') + $(GO) test $(MOD_VENDOR) -tags "$(BUILDTAGS)" $$($(GO) list $(MOD_VENDOR) -tags "$(BUILDTAGS)" -e ./... | grep -v '^github\.com/containers/skopeo/\(integration\|vendor/.*\)$$') vendor: $(GO) mod tidy