Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 2019 22:44:58 +0000 (UTC)
From:      Dmitri Goutnik <dmgk@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r517703 - head/lang/go-devel
Message-ID:  <201911152244.xAFMiw3B036313@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dmgk
Date: Fri Nov 15 22:44:58 2019
New Revision: 517703
URL: https://svnweb.freebsd.org/changeset/ports/517703

Log:
  lang/go-devel: Add support for aarch64
  
  AArch64 support was recently merged by the Go project and is slated to be in
  go1.14. This patch adds freebsd/arm64 support to lang/go-devel first, the
  intention is to similarly update lang/go when go1.14 is officially released.
  
  The most notable change is migration to the new bootstrap [1] because aarch64
  is not supported by go1.4.
  
  [1] https://github.com/dmgk/go-bootstrap
  
  Reviewed by:	tobik, Mikaƫl Urankar <mikael.urankar@gmail.com>
  Approved by:	tz (mentor, implicit)
  Differential Revision:	https://reviews.freebsd.org/D22316

Modified:
  head/lang/go-devel/Makefile
  head/lang/go-devel/distinfo

Modified: head/lang/go-devel/Makefile
==============================================================================
--- head/lang/go-devel/Makefile	Fri Nov 15 20:47:36 2019	(r517702)
+++ head/lang/go-devel/Makefile	Fri Nov 15 22:44:58 2019	(r517703)
@@ -2,27 +2,39 @@
 # $FreeBSD$
 
 PORTNAME=	go
-PORTVERSION=	g20191031
+PORTVERSION=	g20191113
 CATEGORIES=	lang
+MASTER_SITES=	https://github.com/dmgk/go-bootstrap/releases/download/${BOOTSTRAP_TAG}/:bootstrap \
+		LOCAL/dmgk:bootstrap
 PKGNAMESUFFIX=	-devel
+DISTFILES=	go-${OPSYS:tl}-${GOARCH_${ARCH}}${GOARM_${ARCH}}-${BOOTSTRAP_TAG}.tar.xz:bootstrap
 
 MAINTAINER=	dmgk@FreeBSD.org
 COMMENT=	Go programming language (development version)
 
 LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
 
-ONLY_FOR_ARCHS=	amd64 armv6 armv7 i386
+.ifdef QEMU_EMULATING
+IGNORE=		fails to build with qemu-user-static
+.endif
 
-BUILD_DEPENDS=	go14>=1.4:lang/go14
+ONLY_FOR_ARCHS=	aarch64 amd64 armv6 armv7 i386
 
-USES=		shebangfix
+RUN_DEPENDS=	${RUN_DEPENDS_${ARCH}}
+# ld.bfd from devel/binutils is needed for working cgo on aarch64
+RUN_DEPENDS_aarch64=	binutils>0:devel/binutils
+
+TEST_DEPENDS=	${TEST_DEPENDS_${ARCH}}
+TEST_DEPENDS_aarch64=	binutils>0:devel/binutils
+
+USES=		shebangfix tar:xz
+
 USE_GITHUB=	yes
 GH_ACCOUNT=	golang
-GH_TAGNAME=	3f995c3f3b
+GH_TAGNAME=	498eaee461
 
-SHEBANG_FILES=	misc/benchcmp \
-		misc/nacl/go_nacl_*_exec \
-		misc/wasm/go_js_wasm_exec \
+SHEBANG_FILES=	misc/wasm/go_js_wasm_exec \
 		src/net/http/cgi/testdata/test.cgi
 SHEBANG_GLOB=	*.bash *.pl *.sh
 SHEBANG_LANG=	sh
@@ -32,58 +44,78 @@ sh_CMD=		${SH}
 CONFLICTS_INSTALL=	go
 
 OPTIONS_DEFINE_i386=	GO387
+
 GO387_DESC=	Do not generate code with SSE2 (for old x86 CPU)
 
-.include <bsd.port.pre.mk>
+GO387_VARS=	GO386=387
 
-.if ${ARCH} == i386
-GOARCH=386
-.elif ${ARCH} == "amd64"
-GOARCH=amd64
-.elif ${ARCH} == armv6 || ${ARCH} == armv7
-GOARCH=arm
-.else
-IGNORE=		unknown arch ${ARCH}
-.endif
+BINARIES=	go gofmt
+BOOTSTRAP_TAG=	go1.13beta1-1224-g45b4ed7577
 
-.if ${PORT_OPTIONS:MGO387}
-GO386=387
-.endif
+GOARCH_aarch64=	arm64
+GOARCH_amd64=	amd64
+GOARCH_armv6=	arm
+GOARCH_armv7=	arm
+GOARCH_i386=	386
 
-BINARIES=	go gofmt
+GOARM_armv6=	6
+GOARM_armv7=	7
 
 post-patch:
-	@cd ${WRKSRC} && ${FIND} . -name '*.orig' -delete
 	@${REINPLACE_CMD} -e 's|^if ulimit -T|false \&\& &|' ${WRKSRC}/src/run.bash
+	# Needed only for untagged releases
+	${ECHO_CMD} "devel +${GH_TAGNAME}" > ${WRKSRC}/VERSION
 
 do-build:
-	cd ${WRKSRC}/src && \
-		GOROOT=${WRKSRC} GOROOT_FINAL=${PREFIX}/go \
-		GOROOT_BOOTSTRAP=${LOCALBASE}/go14 \
-		GOBIN= GOARCH=${GOARCH} GOOS=${OPSYS:tl} \
+	cd ${WRKSRC}/src ; ${SETENV} \
+		XDG_CACHE_HOME=${WRKDIR} \
+		GOROOT_BOOTSTRAP=${WRKDIR}/go-${OPSYS:tl}-${GOARCH_${ARCH}}${GOARM_${ARCH}}-bootstrap \
+		GOROOT=${WRKSRC} \
+		GOROOT_FINAL=${PREFIX}/go \
+		GOBIN= \
+		GOOS=${OPSYS:tl} \
+		GOARCH=${GOARCH_${ARCH}} \
 		GO386=${GO386} \
+		GOARM=${GOARM_${ARCH}} \
 		${SH} make.bash -v
-	${RM} -r ${WRKSRC}/pkg/obj \
-	    ${WRKSRC}/pkg/bootstrap \
-	    ${WRKSRC}/pkg/${OPSYS:tl}_${GOARCH}/cmd
 
 do-install:
+	cd ${WRKSRC} ; \
+		${RM} -r .gitattributes .gitignore .github favicon.ico robots.txt \
+		pkg/obj pkg/bootstrap pkg/${OPSYS:tl}_${GOARCH_${ARCH}}/cmd
 	@${MKDIR} ${STAGEDIR}${PREFIX}/go
 	@${CP} -a ${WRKSRC}/* ${STAGEDIR}${PREFIX}/go
-.for f in ${BINARIES}
-	@${LN} -sf ../go/bin/${f} ${STAGEDIR}${PREFIX}/bin/${f}
+.for file in ${BINARIES}
+	@${LN} -sf ../go/bin/${file} ${STAGEDIR}${PREFIX}/bin/${file}
 .endfor
 
 post-install:
-.for f in ${BINARIES}
-	@${ECHO_CMD} bin/${f} >> ${TMPPLIST}
+.for file in ${BINARIES}
+	@${ECHO_CMD} bin/${file} >> ${TMPPLIST}
 .endfor
 	@cd ${STAGEDIR}${PREFIX} && \
 		${FIND} go -type f >> ${TMPPLIST}
 
 do-test:
-	cd ${WRKSRC}/src && \
-		GOROOT=${WRKSRC} PATH=${WRKSRC}/bin:${PATH} \
-		${SH} run.bash -no-rebuild -banner ""
+	cd ${WRKSRC}/src && ${SETENV} \
+		GOROOT=${WRKSRC} \
+		PATH=${WRKSRC}/bin:${PATH} \
+		GOOS=${OPSYS:tl} \
+		GOARCH=${GOARCH_${ARCH}} \
+		GO386=${GO386} \
+		GOARM=${GOARM_${ARCH}} \
+		${SH} run.bash
 
-.include <bsd.port.post.mk>
+.if !defined(_GO_MAKESUM_GUARD)
+makesum:
+	${MAKE} -D_GO_MAKESUM_GUARD makesum ARCH=${ONLY_FOR_ARCHS:O:[1]} DISTINFO_FILE=${DISTINFO_FILE}.tmp
+.for arch in ${ONLY_FOR_ARCHS:O:[2..-1]}
+	${MAKE} -D_GO_MAKESUM_GUARD makesum ARCH=${arch} DISTINFO_FILE=${DISTINFO_FILE}.${arch}
+	${GREP} ${GOARCH_${arch}:U${arch}} ${DISTINFO_FILE}.${arch} >> ${DISTINFO_FILE}.tmp
+	${RM} ${DISTINFO_FILE}.${arch}
+.endfor
+	${AWK} '!seen[$$0]++' ${DISTINFO_FILE}.tmp > ${DISTINFO_FILE}
+	${RM} ${DISTINFO_FILE}.tmp
+.endif
+
+.include <bsd.port.mk>

Modified: head/lang/go-devel/distinfo
==============================================================================
--- head/lang/go-devel/distinfo	Fri Nov 15 20:47:36 2019	(r517702)
+++ head/lang/go-devel/distinfo	Fri Nov 15 22:44:58 2019	(r517703)
@@ -1,3 +1,13 @@
-TIMESTAMP = 1572620422
-SHA256 (golang-go-g20191031-3f995c3f3b_GH0.tar.gz) = a580dd0b0965a954ae9972a07a68417058dba7e7dca32b06dd86823203b04668
-SIZE (golang-go-g20191031-3f995c3f3b_GH0.tar.gz) = 21560890
+TIMESTAMP = 1573823321
+SHA256 (go-freebsd-arm64-go1.13beta1-1224-g45b4ed7577.tar.xz) = 526420170f67280a4e21b3e5deefcca3d3f85c7aefa2cb842a685a32af98b1cf
+SIZE (go-freebsd-arm64-go1.13beta1-1224-g45b4ed7577.tar.xz) = 34373400
+SHA256 (golang-go-g20191113-498eaee461_GH0.tar.gz) = 62f111800c970229b3a86a09268acc66ca6a012165e1b2724647e24dbf15566b
+SIZE (golang-go-g20191113-498eaee461_GH0.tar.gz) = 22345387
+SHA256 (go-freebsd-amd64-go1.13beta1-1224-g45b4ed7577.tar.xz) = 9728ed374d45d770b782e6f3e993710f42e52084a96ccfd74009668585c22d88
+SIZE (go-freebsd-amd64-go1.13beta1-1224-g45b4ed7577.tar.xz) = 35892860
+SHA256 (go-freebsd-arm6-go1.13beta1-1224-g45b4ed7577.tar.xz) = e9413f381e5e207ab338e713eeec5064bf0c0d5510b3d58e806d6094d2112c75
+SIZE (go-freebsd-arm6-go1.13beta1-1224-g45b4ed7577.tar.xz) = 34737532
+SHA256 (go-freebsd-arm7-go1.13beta1-1224-g45b4ed7577.tar.xz) = 0721805d3599c383c58404ff8c3a7eac45a30213e1dc1f2f1ebbb7900fa97646
+SIZE (go-freebsd-arm7-go1.13beta1-1224-g45b4ed7577.tar.xz) = 34607568
+SHA256 (go-freebsd-386-go1.13beta1-1224-g45b4ed7577.tar.xz) = 738f67f72f420c8892f7907cf6fa273d897572e5dcf5cefbe6dd5e5cea905ddc
+SIZE (go-freebsd-386-go1.13beta1-1224-g45b4ed7577.tar.xz) = 35506392



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