Import lang/go-bootstrap - this is a version of Go that builds natively on

OpenBSD and can be used to bootstrap later versions of Go (1.5+) that
require an existing Go compiler to build. It exists for bootstrapping
lang/go and is not intended for general use or distribution.

Discussed with sthen@, jasper@

ok jasper@
This commit is contained in:
jsing 2015-12-04 17:19:18 +00:00
parent 5b59ea681b
commit 5ce9d57a02
6 changed files with 3795 additions and 0 deletions

103
lang/go-bootstrap/Makefile Normal file
View File

@ -0,0 +1,103 @@
# $OpenBSD: Makefile,v 1.1.1.1 2015/12/04 17:19:18 jsing Exp $
ONLY_FOR_ARCHS = ${GO_ARCHS}
COMMENT = Go programming language
VERSION = 1.4.3
EXTRACT_SUFX = .src.tar.gz
DISTNAME = go${VERSION}
PKGNAME = go-bootstrap-${VERSION}
CATEGORIES = lang
HOMEPAGE = https://golang.org/
MAINTAINER = Joel Sing <jsing@openbsd.org>
# software: BSD, documentation: CC-BY-3.0
PERMIT_PACKAGE_CDROM = bootstrap only
PERMIT_PACKAGE_FTP = bootstrap only
PERMIT_DISTFILES_FTP = bootstrap only
WANTLIB = c m pthread
MASTER_SITES = https://golang.org/dl/
BUILD_DEPENDS = shells/bash
SEPARATE_BUILD = simple
CONFIGURE_STYLE = None
SUBST_VARS = GOEXE GOCFG
WRKDIST = ${WRKDIR}/go
WRKSRC = ${WRKDIST}/src
GOOS = openbsd
GOARCH = unknown
GOROOT = ${PREFIX}/go/bootstrap
.if ${MACHINE_ARCH} == "amd64"
GOARCH = amd64
EXEPREFIX = 6
PKG_ARGS += -Damd64=1
PKG_ARGS += -Di386=0
.elif ${MACHINE_ARCH} == "i386"
GOARCH = 386
EXEPREFIX = 8
PKG_ARGS += -Damd64=0
PKG_ARGS += -Di386=1
.else
PKG_ARGS += -Damd64=0 -Di386=0
.endif
GOCFG = /${GOOS}_${GOARCH}
GOEXE = ${GOCFG}/${EXEPREFIX}
do-configure:
. if ${GOARCH} == "unknown"
@echo "Unable to determine GOARCH for ${MACHINE_ARCH}."
@exit 1
. endif
do-build:
@cd ${WRKSRC} && \
CC="${CC}" \
CXX="${CXX}" \
GOROOT=${WRKDIST} \
GOBIN=${WRKDIST}/bin \
GOROOT_FINAL=${GOROOT} ./make.bash --no-banner
do-test:
@cd ${WRKSRC} && \
ulimit -n 256 -d 2097152 && \
PATH=${WRKDIST}/bin:${PATH} GOROOT=${WRKDIST} ./run.bash
do-install:
${INSTALL_PROGRAM_DIR} ${GOROOT}
${INSTALL_PROGRAM_DIR} ${GOROOT}/bin
${INSTALL_PROGRAM} -p ${WRKDIST}/bin/go{,fmt} ${GOROOT}/bin
@cd ${WRKDIST} && \
find . ! -name .hg\* -type f -maxdepth 1 \
-exec ${INSTALL_DATA} -p {} \
${GOROOT} \;
. for dir in doc include lib misc src pkg
@cd ${WRKDIST} && \
find ${dir} -type d \
-exec ${INSTALL_DATA_DIR} \
${GOROOT}/{} \;
@cd ${WRKDIST} && \
find ${dir} ! -name \*.orig -type f \
-exec ${INSTALL_DATA} -p {} \
${GOROOT}/{} \;
. endfor
# These get installed via `find' however we need them to be executable
${INSTALL_PROGRAM_DIR} ${GOROOT}/pkg/tool/${GOOS}_${GOARCH}
${INSTALL_PROGRAM} -p ${WRKDIST}/pkg/tool/${GOOS}_${GOARCH}/* \
${GOROOT}/pkg/tool/${GOOS}_${GOARCH}
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (go1.4.3.src.tar.gz) = mUf8cFsLhBtZOMSLItwz6WR+wHUrrmblAnjfTyP2SVk=
SIZE (go1.4.3.src.tar.gz) = 10875170

View File

@ -0,0 +1,7 @@
Go is an open source programming language that makes it easy to build simple,
reliable, and efficient software.
This package contains a version of Go that builds natively on OpenBSD and can
be used to bootstrap later versions of Go (1.5+) that require an existing Go
compiler to build. It exists for bootstrapping lang/go and is not intended for
general use or distribution.

View File

@ -0,0 +1,5 @@
@comment $OpenBSD: PFRAG.amd64,v 1.1.1.1 2015/12/04 17:19:18 jsing Exp $
go/bootstrap/src/runtime/zasm_openbsd_amd64.h
go/bootstrap/src/runtime/zgoarch_amd64.go
go/bootstrap/src/runtime/zruntime_defs_openbsd_amd64.go
go/bootstrap/src/runtime/zsys_openbsd_amd64.s

View File

@ -0,0 +1,5 @@
@comment $OpenBSD: PFRAG.i386,v 1.1.1.1 2015/12/04 17:19:18 jsing Exp $
go/bootstrap/src/runtime/zasm_openbsd_386.h
go/bootstrap/src/runtime/zgoarch_386.go
go/bootstrap/src/runtime/zruntime_defs_openbsd_386.go
go/bootstrap/src/runtime/zsys_openbsd_386.s

3673
lang/go-bootstrap/pkg/PLIST Normal file

File diff suppressed because it is too large Load Diff