freebsd-ports/lang/go/Makefile
John Marino 23ba4e0f8f lang/go: Restrict if_data8 "extra" patch to FreeBSD
The use of OSVERSION to define EXTRA_PATCHES requires an OPSYS check.
The extra patch in question is not valid for DragonFly.

Approved by:	portmgr (bapt, after technical discussion)
2015-09-10 07:20:52 +00:00

68 lines
1.4 KiB
Makefile

# Created by: Devon H. O'Dell <devon.odell@gmail.com>
# $FreeBSD$
PORTNAME= go
PORTVERSION= 1.5.1
PORTEPOCH= 1
CATEGORIES= lang
MASTER_SITES= http://golang.org/dl/
DISTNAME= go${PORTVERSION}.src
MAINTAINER= jlaffaye@FreeBSD.org
COMMENT= Go programming language
LICENSE= BSD3CLAUSE
BUILD_DEPENDS= go14>=1.4:${PORTSDIR}/lang/go14
USES= shebangfix
SHEBANG_LANG= sh
SHEBANG_FILES= ${WRKSRC}/src/*.bash \
${WRKSRC}/doc/articles/wiki/*.bash \
${WRKSRC}/test/bench/shootout/timing.sh
sh_OLD_CMD= ${SETENV} bash
sh_CMD= ${SH}
WRKSRC= ${WRKDIR}/go
ONLY_FOR_ARCHS= i386 amd64 armv6
.include <bsd.port.pre.mk>
.if ${ARCH} == "i386"
GOARCH=386
.elif ${ARCH} == "amd64"
GOARCH=amd64
.elif ${ARCH} == "armv6"
GOARCH=arm
.else
IGNORE= unknown arch ${ARCH}
.endif
PLIST_SUB+= ARCH=${GOARCH}
.if ${OPSYS} == FreeBSD && (${OSVERSION} >= 1100000)
EXTRA_PATCHES+= ${FILESDIR}/struct-if_data-patch
.endif
post-patch:
@cd ${WRKSRC} && ${FIND} . -name '*.orig' -delete
do-build:
cd ${WRKSRC}/src && \
CC=${CC} \
GOROOT=${WRKSRC} GOROOT_FINAL=${PREFIX}/go \
GOROOT_BOOTSTRAP=${LOCALBASE}/go14 \
GOBIN= GOARCH=${GOARCH} GOOS=${OPSYS:tl} \
${SH} make.bash
do-install:
@${CP} -a ${WRKSRC} ${STAGEDIR}${PREFIX}
.for f in go gofmt
@${LN} -sf ${PREFIX}/go/bin/${f} ${STAGEDIR}${PREFIX}/bin/${f}
.endfor
regression-test: build
cd ${WRKSRC}/src && GOROOT=${WRKSRC} PATH=${WRKSRC}/bin:${PATH} ${SH} run.bash --no-rebuild --banner
.include <bsd.port.post.mk>