No need for a special MODGO_ENV for go.port.mk, just use normal MAKE_ENV

like the rest of the ports tree. This also allows removing a bunch of
manual setting of PATH="${PORTPATH}" HOME="${PORTHOME}" done in various
ports etc. This also makes sure CFLAGS is passed through (not everything
honours it but it does improve at least some ports).

Remove NO_CCACHE from www/honk that was added because the above problem
resulted in ccache variables not being passed through correctly breaking
the cc calls in this.

ok kmos@
This commit is contained in:
sthen 2019-05-04 21:46:16 +00:00
parent 4cf784fbaa
commit 4c9d7e6039
16 changed files with 34 additions and 52 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.8 2019/03/30 11:16:15 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.9 2019/05/04 21:46:16 sthen Exp $
COMMENT = time-series datastore for metrics, events, and analytics
@ -36,6 +36,8 @@ WRKDIST = ${WRKSRC}
USE_GMAKE = Yes
SUBST_VARS = VARBASE
NO_TEST = Yes
do-build:
cd ${WRKSRC} && ${MODGO_BUILD_CMD} ./...
cd ${WRKSRC}/man && ${MAKE_PROGRAM}
@ -53,7 +55,7 @@ tarball: clean distclean
ftp -o ${WRKDIR}/gpm https://raw.githubusercontent.com/pote/gpm/v1.4.0/bin/gpm
ftp -o ${WRKDIR}/${DISTFILES} https://github.com/influxdata/influxdb/archive/v${V}/${DISTFILES}
tar -s /influxdb-${V}/influxdb/ -C ${WRKDIR}/go/src/github.com/influxdata/ -xzf ${WRKDIR}/${DISTFILES}
${SETENV} ${MODGO_ENV} bash ${WRKDIR}/gpm get ${WRKSRC}/Godeps
${SETENV} ${MAKE_ENV} bash ${WRKDIR}/gpm get ${WRKSRC}/Godeps
find ${WRKDIR}/go -name .git -type d | xargs rm -Rf
cd ${WRKDIR} && tar -czf /usr/ports/distfiles/${DISTFILES} go

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.22 2019/04/24 16:26:55 sthen Exp $
# $OpenBSD: Makefile,v 1.23 2019/05/04 21:46:16 sthen Exp $
COMMENT = various tools for the Go programming language
GH_ACCOUNT = golang
GH_PROJECT = tools
GH_COMMIT = f727befe758c04ce68d52abc6e69ad111e2c6797
GH_COMMIT = f727befe758c04ce68d52abc6e69ad111e2c6797
DISTNAME = go-tools-1.12.20190226
CATEGORIES = devel
HOMEPAGE = https://godoc.org/golang.org/x/tools
@ -15,13 +15,12 @@ PERMIT_PACKAGE_CDROM = Yes
WANTLIB += c pthread
MODULES = lang/go
MODGO_ENV = PATH="${PORTPATH}"
MODGO_TYPE = bin
BUILD_DEPENDS = net/go-net
RUN_DEPENDS = ${MODGO_RUN_DEPENDS}
GODOC_TARGET = golang.org/x/tools/cmd/godoc
GODOC_TARGET = golang.org/x/tools/cmd/godoc
_MAIN = golang.org/x/tools
_SUBPKGS = benchcmp \

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.6 2018/04/14 22:53:54 sthen Exp $
# $OpenBSD: Makefile,v 1.7 2019/05/04 21:46:16 sthen Exp $
COMMENT = wraps git in order to extend it with extra features
@ -20,8 +20,6 @@ WANTLIB += c pthread
MODULES = lang/go
MODGO_ENV= PATH="${PORTPATH}" CFLAGS="${CFLAGS}"
RUN_DEPENDS = devel/git
post-install:

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.2 2018/04/14 22:53:54 sthen Exp $
# $OpenBSD: Makefile,v 1.3 2019/05/04 21:46:16 sthen Exp $
COMMENT = modern and intuitive terminal-based text editor
@ -22,7 +22,6 @@ MODULES = lang/go
MODGO_TYPE = bin
WRKDIST = ${WRKDIR}/micro
MAKE_ENV += MODGO_CMD="${MODGO_CMD}"
do-build:
cd ${WRKSRC} && ${MAKE_ENV} ${MAKE} build-quick ${MAKE_FLAGS}

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2016/12/10 16:48:07 edd Exp $
--- Makefile.orig Mon Nov 28 15:27:32 2016
+++ Makefile Mon Nov 28 15:27:45 2016
@@ -15,7 +15,7 @@ build-all: runtime build
# Builds micro without checking for dependencies
build-quick:
- go build -ldflags "-s -w -X main.Version=$(VERSION) -X main.CommitHash=$(HASH) -X 'main.CompileDate=$(DATE)'" ./cmd/micro
+ ${MODGO_CMD} build -ldflags "-s -w -X main.Version=$(VERSION) -X main.CommitHash=$(HASH) -X 'main.CompileDate=$(DATE)'" ./cmd/micro
# Same as 'build' but installs to $GOBIN afterward
install: deps

View File

@ -1,4 +1,4 @@
# $OpenBSD: go.port.mk,v 1.21 2019/03/16 13:36:01 jsing Exp $
# $OpenBSD: go.port.mk,v 1.22 2019/05/04 21:46:16 sthen Exp $
ONLY_FOR_ARCHS ?= ${GO_ARCHS}
@ -23,8 +23,8 @@ MODGO_TYPE ?= bin
MODGO_WORKSPACE ?= ${WRKDIR}/go
MODGO_GOCACHE ?= ${WRKDIR}/go-cache
MODGO_GOPATH ?= ${MODGO_WORKSPACE}:${MODGO_PACKAGE_PATH}
MODGO_ENV += GOCACHE="${MODGO_GOCACHE}" GOPATH="${MODGO_GOPATH}" PATH="${PORTPATH}"
MODGO_CMD ?= ${SETENV} ${MODGO_ENV} go
MAKE_ENV += GOCACHE="${MODGO_GOCACHE}" GOPATH="${MODGO_GOPATH}"
MODGO_CMD ?= ${SETENV} ${MAKE_ENV} go
MODGO_BUILD_CMD = ${MODGO_CMD} install ${MODGO_FLAGS}
MODGO_TEST_CMD = ${MODGO_CMD} test ${MODGO_FLAGS} ${MODGO_TEST_FLAGS}

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.40 2019/04/30 08:51:13 sthen Exp $
# $OpenBSD: Makefile,v 1.41 2019/05/04 21:46:17 sthen Exp $
COMMENT = flexible DNS proxy with support for encrypted DNS protocols
@ -19,7 +19,7 @@ WANTLIB = c pthread
MODULES = lang/go
MODGO_TYPE = bin
MODGO_ENV = PATH="${PORTPATH}" HOME="${PORTHOME}"
NO_TEST = Yes
INSTDIR = ${PREFIX}/share/examples/dnscrypt-proxy

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.11 2019/03/21 11:36:24 pvk Exp $
# $OpenBSD: Makefile,v 1.12 2019/05/04 21:46:17 sthen Exp $
COMMENT = open source Slack-alternative
@ -11,7 +11,7 @@ MASTER_SITES0 = https://releases.mattermost.com/${V}/
DISTNAME = mattermost-server-${V}
DISTFILES += ${DISTNAME}${EXTRACT_SUFX} \
DISTFILES += ${DISTNAME}${EXTRACT_SUFX} \
mattermost-${V}-linux-amd64${EXTRACT_SUFX}:0
CATEGORIES = net
@ -25,7 +25,6 @@ PERMIT_PACKAGE_CDROM = Yes
WANTLIB += c pthread
MODULES = lang/go
MODGO_ENV = PATH="${PORTPATH}" HOME="${PORTHOME}"
MODGO_LDFLAGS = -X github.com/mattermost/mattermost-server/model.BuildNumber=${V}
NO_TEST = Yes

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.25 2019/05/03 12:58:59 edd Exp $
# $OpenBSD: Makefile,v 1.26 2019/05/04 21:46:17 sthen Exp $
COMMENT = open decentralized synchronization utility
@ -24,7 +24,6 @@ SUBST_VARS += VARBASE
MODULES = lang/go
MODGO_TYPE = bin
MODGO_ENV = PATH="${PORTPATH}" HOME="${PORTHOME}"
do-build:
cd ${WRKSRC} && ${MODGO_CMD} run build.go \

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.12 2019/01/23 00:56:46 abieber Exp $
# $OpenBSD: Makefile,v 1.13 2019/05/04 21:46:17 sthen Exp $
COMMENT = pass compatible password manager written in go
@ -26,7 +26,7 @@ RUN_DEPENDS = devel/git \
ALL_TARGET = github.com/gopasspw/gopass
# Tests require MODGO_ENV, but break in weird ways when it is set.
NO_TEST = Yes
# for tests; some still fail
PORTHOME = ${WRKDIR}
.include <bsd.port.mk>

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.14 2018/12/20 14:13:17 gonzalo Exp $
# $OpenBSD: Makefile,v 1.15 2019/05/04 21:46:17 sthen Exp $
# go-ps only supports amd64 on OpenBSD
# ../vendor/github.com/keybase/go-ps/process.go:39: undefined: processes
@ -31,7 +31,6 @@ WRKSRC = ${WRKDIR}/go/src/github.com/keybase/client
MODULES = lang/go
MODGO_TYPE = bin
MODGO_ENV = PATH="${PORTPATH}" HOME="${PORTHOME}"
NO_TEST = Yes

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.11 2018/09/04 12:46:22 espie Exp $
# $OpenBSD: Makefile,v 1.12 2019/05/04 21:46:17 sthen Exp $
COMMENT= template rendering and notifications with Consul
@ -19,6 +19,7 @@ PERMIT_PACKAGE_CDROM= Yes
WANTLIB += c pthread
MODULES= lang/go
TEST_DEPENDS= sysutils/consul
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/consul-template

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.3 2019/03/08 18:37:22 sthen Exp $
# $OpenBSD: Makefile,v 1.4 2019/05/04 21:46:17 sthen Exp $
COMMENT = systems monitoring and alerting toolkit
@ -20,13 +20,14 @@ WANTLIB = c pthread
BUILD_DEPENDS = devel/promu
USE_GMAKE = Yes
USE_GMAKE = Yes
MODULES= lang/go
MODGO_GOPATH= ${MODGO_WORKSPACE}
# promu doesn't like the default PREFIX
do-build:
cd ${WRKSRC} && GOMAXPROCS=${MAKE_JOBS} GOCACHE=${MODGO_GOCACHE} \
GOPATH=${MODGO_WORKSPACE} ${MAKE_PROGRAM} \
cd ${WRKSRC} && ${MAKE_ENV} GOMAXPROCS=${MAKE_JOBS} PREFIX=. ${MAKE_PROGRAM} \
PROMU="${LOCALBASE}/bin/promu -v" build
do-install:
@ -47,6 +48,6 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/NOTICE ${PREFIX}/share/doc/prometheus/
do-test:
cd ${WRKSRC} && GOPATH=${MODGO_WORKSPACE} ${MAKE_PROGRAM} test
cd ${WRKSRC} && ${MAKE_ENV} ${MAKE_PROGRAM} test
.include <bsd.port.mk>

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.2 2018/12/25 22:40:11 sthen Exp $
# $OpenBSD: Makefile,v 1.3 2019/05/04 21:46:17 sthen Exp $
COMMENT = plugin-driven server agent for collecting metrics
@ -40,8 +40,8 @@ tarball: clean distclean
mkdir -p ${WRKDIR}/go/src/github.com/influxdata/
ftp -o ${WRKDIR}/${DISTFILES} https://github.com/influxdata/telegraf/archive/${GH_TAGNAME}/${DISTFILES}
tar -C ${WRKDIR}/go/src/github.com/influxdata/ -xzf ${WRKDIR}/${DISTFILES}
${SETENV} ${MODGO_ENV} go get github.com/golang/dep/cmd/dep
cd ${WRKDIR}/go/src/github.com/influxdata/${DISTNAME} && ${SETENV} ${MODGO_ENV} ${WRKDIR}/go/bin/dep ensure
${SETENV} ${MAKE_ENV} go get github.com/golang/dep/cmd/dep
cd ${WRKDIR}/go/src/github.com/influxdata/${DISTNAME} && ${SETENV} ${MAKE_ENV} ${WRKDIR}/go/bin/dep ensure
rm -Rf ${WRKDIR}/go/{bin,pkg} ${WRKDIR}/go/src/github.com/influxdata/${DISTNAME}/vendor/github.com/influxdata/telegraf ${WRKDIR}/${DISTFILES}
cd ${WRKDIR}/go/src/github.com/influxdata/ && tar -czf /usr/ports/distfiles/${DISTFILES} ${DISTNAME}

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.19 2019/04/17 13:19:49 solene Exp $
# $OpenBSD: Makefile,v 1.20 2019/05/04 21:46:17 sthen Exp $
COMMENT = compact self-hosted Git service
@ -20,7 +20,6 @@ WANTLIB += c pthread
MODULES = lang/go
MODGO_ENV = PATH="${PORTPATH}" CFLAGS="${CFLAGS}"
MODGO_FLAGS += -tags "sqlite cert"
RUN_DEPENDS = devel/git

View File

@ -1,6 +1,4 @@
# $OpenBSD: Makefile,v 1.2 2019/05/02 05:03:07 bentley Exp $
NO_CCACHE = Yes
# $OpenBSD: Makefile,v 1.3 2019/05/04 21:46:17 sthen Exp $
COMMENT = federated status updater