Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Sep 2019 12:18:47 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r511569 - head/sysutils/consul
Message-ID:  <201909081218.x88CIliP037642@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Sun Sep  8 12:18:47 2019
New Revision: 511569
URL: https://svnweb.freebsd.org/changeset/ports/511569

Log:
  sysutils/consul: Switch to USES=go:modules, fix build with go1.13
  
  ===>  Building for consul-1.5.1
  $GOPATH/go.mod exists but should not
  *** Error code 1
  
  - Remove custom build and install targets
  
  PR:		240313
  Submitted by:	Dmitri Goutnik <dg@syrec.org>
  Pointy hat:	jlaffaye

Modified:
  head/sysutils/consul/Makefile

Modified: head/sysutils/consul/Makefile
==============================================================================
--- head/sysutils/consul/Makefile	Sun Sep  8 12:13:40 2019	(r511568)
+++ head/sysutils/consul/Makefile	Sun Sep  8 12:18:47 2019	(r511569)
@@ -11,14 +11,17 @@ COMMENT=	Service discovery and configuration made easy
 LICENSE=	MPL20
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-BROKEN=		fails to build
+USES=		go:modules
 
-USES=		compiler go
-
 USE_GITHUB=	yes
 GH_ACCOUNT=	hashicorp
-GH_SUBDIR=	src/github.com/${GH_ACCOUNT}/${PORTNAME}
 
+GO_BUILDFLAGS=	-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} \
+		"
+
 USE_RC_SUBR=	consul
 
 PLIST_FILES=	bin/consul
@@ -27,26 +30,8 @@ USERS=		consul
 GROUPS=		consul
 
 post-extract:
-	@${MV} ${WRKSRC}/vendor/ ${WRKSRC}/src/
+	${MKDIR} ${WRKSRC}/vendor/github.com/${GH_ACCOUNT}/${PORTNAME}
+	${LN} -s ${WRKSRC}/api ${WRKSRC}/vendor/github.com/${GH_ACCOUNT}/${PORTNAME}/api
+	${LN} -s ${WRKSRC}/sdk ${WRKSRC}/vendor/github.com/${GH_ACCOUNT}/${PORTNAME}/sdk
 
-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>
+.include <bsd.port.mk>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909081218.x88CIliP037642>