freebsd-ports/sysutils/consul/Makefile
Tobias Kortkamp 3726f94254 Convert all Go ports to USES=go
This allows for port testing with lang/go-devel via GO_PORT, setting
up the Go build environment in a single place, and is step one in
simplifying Go ports that often define too complicated do-build
targets themselves.

USES=go gains new arguments 'run' to add lang/go to RUN_DEPENDS and
'no_targets' for ports with composite builds that call 'go' themselves
and do not need the do-build/do-install targets of USES=go.

PR:		238849
Submitted by:	dg@syrec.org (also D20745)
Reviewed by:	mat, tobik
Exp-run by:	antoine
Differential Revision:	https://reviews.freebsd.org/D20746
2019-06-29 03:51:13 +00:00

49 lines
1.1 KiB
Makefile

# $FreeBSD$
PORTNAME= consul
PORTVERSION= 1.5.1
DISTVERSIONPREFIX= v
CATEGORIES= sysutils
MAINTAINER= swills@FreeBSD.org
COMMENT= Service discovery and configuration made easy
LICENSE= MPL20
USES= compiler go
USE_GITHUB= yes
GH_ACCOUNT= hashicorp
GH_SUBDIR= src/github.com/${GH_ACCOUNT}/${PORTNAME}
USE_RC_SUBR= consul
PLIST_FILES= bin/consul
USERS= consul
GROUPS= consul
post-extract:
@${MV} ${WRKSRC}/vendor/ ${WRKSRC}/src/
do-build:
@cd ${WRKSRC}/src/github.com/hashicorp/consul; ${SETENV} ${MAKE_ENV} CGO_ENABLED=0 ${BUILD_ENV} GOPATH=${WRKSRC} go build \
-ldflags "\
-X github.com/hashicorp/consul/version.Version=${PORTVERSION} \
-X github.com/hashicorp/consul/version.VersionPrerelease= \
-X github.com/hashicorp/consul/version.GitDescribe=v${PORTVERSION} \
" \
-o bin/consul
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/hashicorp/consul/bin/consul ${STAGEDIR}${PREFIX}/bin/consul
.include <bsd.port.pre.mk>
# golang assumes that if clang is in use, it is called "clang" and not "cc". If
# it's called "cc", go fails.
.if ${COMPILER_TYPE} == clang
BUILD_ENV= CC=clang
.endif
.include <bsd.port.post.mk>