2020-01-30 17:11:08 +00:00
|
|
|
# $OpenBSD: Makefile,v 1.81 2020/01/30 17:11:08 jsing Exp $
|
2012-03-31 12:37:15 +00:00
|
|
|
|
2015-03-18 16:21:02 +00:00
|
|
|
ONLY_FOR_ARCHS = ${GO_ARCHS}
|
2012-03-31 12:37:15 +00:00
|
|
|
|
2019-09-15 02:00:34 +00:00
|
|
|
BIN_BOOTSTRAP_GOARCHS = arm arm64
|
2019-09-13 09:04:07 +00:00
|
|
|
BIN_BOOTSTRAP_VERSION = 1.13
|
2019-04-19 07:15:36 +00:00
|
|
|
|
2012-03-31 12:37:15 +00:00
|
|
|
COMMENT = Go programming language
|
|
|
|
|
2020-01-30 17:11:08 +00:00
|
|
|
VERSION = 1.13.7
|
2019-04-19 07:15:36 +00:00
|
|
|
DISTNAME = go${VERSION}.src
|
2018-04-06 13:01:39 +00:00
|
|
|
PKGNAME = go-${VERSION}
|
2019-11-19 09:30:40 +00:00
|
|
|
PKGSPEC = ${FULLPKGNAME:S/go-/go-=/}
|
2018-04-06 13:01:39 +00:00
|
|
|
|
2012-03-31 12:37:15 +00:00
|
|
|
CATEGORIES = lang
|
|
|
|
|
2015-12-05 05:01:24 +00:00
|
|
|
HOMEPAGE = https://golang.org/
|
2012-03-31 12:37:15 +00:00
|
|
|
|
2018-04-06 13:01:39 +00:00
|
|
|
MAINTAINER = Joel Sing <jsing@openbsd.org>
|
2012-03-31 12:37:15 +00:00
|
|
|
|
|
|
|
# software: BSD, documentation: CC-BY-3.0
|
2019-07-12 20:46:54 +00:00
|
|
|
PERMIT_PACKAGE = Yes
|
2012-03-31 12:37:15 +00:00
|
|
|
|
2016-08-18 17:23:03 +00:00
|
|
|
WANTLIB = c pthread
|
2012-03-31 12:37:15 +00:00
|
|
|
|
2015-12-05 05:01:24 +00:00
|
|
|
MASTER_SITES = https://golang.org/dl/
|
2019-04-19 07:15:36 +00:00
|
|
|
MASTER_SITES0 = https://download.exigere.com.au/pub/go/
|
|
|
|
|
|
|
|
DISTFILES = ${DISTNAME}${EXTRACT_SUFX}
|
2012-03-31 12:37:15 +00:00
|
|
|
|
2019-04-19 07:15:36 +00:00
|
|
|
BUILD_DEPENDS = shells/bash
|
2012-03-31 12:37:15 +00:00
|
|
|
|
|
|
|
SEPARATE_BUILD = simple
|
|
|
|
CONFIGURE_STYLE = None
|
2015-12-05 05:01:24 +00:00
|
|
|
SUBST_VARS = GOCFG
|
2012-03-31 12:37:15 +00:00
|
|
|
|
|
|
|
WRKDIST = ${WRKDIR}/go
|
|
|
|
WRKSRC = ${WRKDIST}/src
|
|
|
|
|
2016-05-05 10:46:50 +00:00
|
|
|
INSTALL_STRIP =
|
|
|
|
|
2018-05-10 18:39:35 +00:00
|
|
|
GOOS = openbsd
|
2012-03-31 12:37:15 +00:00
|
|
|
GOARCH = unknown
|
2018-05-10 18:39:35 +00:00
|
|
|
GOROOT = ${PREFIX}/go
|
2019-04-19 07:15:36 +00:00
|
|
|
GOROOT_BOOTSTRAP =
|
2012-03-31 12:37:15 +00:00
|
|
|
|
2019-10-06 15:37:15 +00:00
|
|
|
# sync with go.port.mk
|
2012-03-31 12:37:15 +00:00
|
|
|
.if ${MACHINE_ARCH} == "amd64"
|
|
|
|
GOARCH = amd64
|
2019-04-19 07:15:36 +00:00
|
|
|
.elif ${MACHINE_ARCH} == "arm"
|
|
|
|
GOARCH = arm
|
2019-09-15 02:00:34 +00:00
|
|
|
.elif ${MACHINE_ARCH} == "aarch64"
|
|
|
|
GOARCH = arm64
|
2012-03-31 12:37:15 +00:00
|
|
|
.elif ${MACHINE_ARCH} == "i386"
|
|
|
|
GOARCH = 386
|
|
|
|
.endif
|
2012-07-30 15:49:55 +00:00
|
|
|
|
2019-11-19 09:17:06 +00:00
|
|
|
# We cannot assume that the maching running the built code will have SSE,
|
|
|
|
# even though the machine building the package has SSE. As such, we need
|
|
|
|
# to explicitly disable SSE on i386 builds.
|
|
|
|
MAKE_ENV += GO386=387
|
|
|
|
|
2019-04-19 07:15:36 +00:00
|
|
|
.for arch in ${BIN_BOOTSTRAP_GOARCHS}
|
|
|
|
SUPDISTFILES += go-openbsd-${arch}-bootstrap-${BIN_BOOTSTRAP_VERSION}${EXTRACT_SUFX}:0
|
|
|
|
|
|
|
|
.if ${GOARCH} == ${arch}
|
|
|
|
DISTFILES += go-openbsd-${GOARCH}-bootstrap-${BIN_BOOTSTRAP_VERSION}${EXTRACT_SUFX}:0
|
|
|
|
GOROOT_BOOTSTRAP = ${WRKDIR}/go-openbsd-${GOARCH}-bootstrap
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.if empty(GOROOT_BOOTSTRAP)
|
|
|
|
BUILD_DEPENDS += lang/go-bootstrap
|
|
|
|
GOROOT_BOOTSTRAP = ${GOROOT}/bootstrap
|
|
|
|
.endif
|
|
|
|
|
2012-03-31 12:37:15 +00:00
|
|
|
GOCFG = /${GOOS}_${GOARCH}
|
2018-05-10 18:39:35 +00:00
|
|
|
GOTOOLS = pkg/tool/${GOCFG}
|
2012-03-31 12:37:15 +00:00
|
|
|
|
|
|
|
do-configure:
|
|
|
|
. if ${GOARCH} == "unknown"
|
|
|
|
@echo "Unable to determine GOARCH for ${MACHINE_ARCH}."
|
|
|
|
@exit 1
|
|
|
|
. endif
|
|
|
|
|
|
|
|
do-build:
|
|
|
|
@cd ${WRKSRC} && \
|
2019-04-19 07:15:36 +00:00
|
|
|
ulimit -d $$(ulimit -H -d) && \
|
2019-12-02 22:20:38 +00:00
|
|
|
${SETENV} ${MAKE_ENV} \
|
2013-12-02 20:07:38 +00:00
|
|
|
CC="${CC}" \
|
|
|
|
CXX="${CXX}" \
|
2012-05-20 16:32:51 +00:00
|
|
|
GOROOT=${WRKDIST} \
|
|
|
|
GOBIN=${WRKDIST}/bin \
|
2019-05-04 15:03:15 +00:00
|
|
|
GOCACHE=${WRKDIST}/go-cache \
|
2015-12-05 05:01:24 +00:00
|
|
|
GOROOT_FINAL=${GOROOT} \
|
2017-06-04 18:04:03 +00:00
|
|
|
GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP} \
|
2018-05-10 18:39:35 +00:00
|
|
|
./make.bash --no-banner
|
2012-03-31 12:37:15 +00:00
|
|
|
|
2018-09-23 17:19:10 +00:00
|
|
|
# The regress framework leaks fd 3 and 4 into this execution,
|
|
|
|
# which breaks Go's (now rather fragile) os/exec tests.
|
2013-03-11 11:20:26 +00:00
|
|
|
do-test:
|
2012-03-31 12:37:15 +00:00
|
|
|
@cd ${WRKSRC} && \
|
2019-04-19 07:15:36 +00:00
|
|
|
ulimit -d $$(ulimit -H -d) -n 256 && \
|
2019-12-02 22:20:38 +00:00
|
|
|
${SETENV} ${MAKE_ENV} \
|
2018-09-23 17:19:10 +00:00
|
|
|
CC="${CC}" \
|
|
|
|
CXX="${CXX}" \
|
2019-09-27 19:04:57 +00:00
|
|
|
GOCACHE=${WRKDIST}/go-cache \
|
|
|
|
GOPATH=${WRKDIR} \
|
|
|
|
HOME=${WRKDIR} \
|
2018-05-10 18:39:35 +00:00
|
|
|
PATH=${WRKDIST}/bin:${PATH} \
|
2018-09-23 17:19:10 +00:00
|
|
|
/bin/ksh -c "exec 3>&-; exec 4>&-; ./run.bash"
|
2012-03-31 12:37:15 +00:00
|
|
|
|
|
|
|
do-install:
|
2015-12-05 05:01:24 +00:00
|
|
|
${INSTALL_PROGRAM_DIR} ${GOROOT}/bin
|
|
|
|
|
2018-05-10 18:39:35 +00:00
|
|
|
. for prog in go gofmt
|
|
|
|
${INSTALL_PROGRAM} -p ${WRKDIST}/bin/${prog} ${GOROOT}/bin
|
|
|
|
@ln -s ../go/bin/${prog} ${PREFIX}/bin/${prog}
|
|
|
|
. endfor
|
2015-12-05 05:01:24 +00:00
|
|
|
|
2018-05-10 18:39:35 +00:00
|
|
|
find ${WRKDIST} -maxdepth 1 -type f \
|
|
|
|
-exec ${INSTALL_DATA} -p {} ${GOROOT} \;
|
2012-03-31 12:37:15 +00:00
|
|
|
|
2018-03-14 14:14:36 +00:00
|
|
|
. for dir in api doc lib misc src pkg/include pkg/${GOCFG} test
|
2018-05-10 18:39:35 +00:00
|
|
|
cd ${WRKDIST} && \
|
2012-03-31 12:37:15 +00:00
|
|
|
find ${dir} -type d \
|
2018-05-10 18:39:35 +00:00
|
|
|
-exec ${INSTALL_DATA_DIR} ${GOROOT}/{} \; \
|
|
|
|
-o -type f ! -name \*.orig \
|
|
|
|
-exec ${INSTALL_DATA} -p {} ${GOROOT}/{} \;
|
2012-03-31 12:37:15 +00:00
|
|
|
. endfor
|
|
|
|
|
2018-05-10 18:39:35 +00:00
|
|
|
${INSTALL_PROGRAM_DIR} ${GOROOT}/${GOTOOLS}
|
|
|
|
${INSTALL_PROGRAM} -p ${WRKDIST}/${GOTOOLS}/* ${GOROOT}/${GOTOOLS}
|
2012-03-31 12:37:15 +00:00
|
|
|
|
|
|
|
.include <bsd.port.mk>
|