aboutsummaryrefslogtreecommitdiffstats
path: root/lang/go14/Makefile
blob: 261e7a1c6c8951cb200bb6870d41944913e39703 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# $FreeBSD$

PORTNAME=   go14
PORTVERSION=    1.4.3
PORTREVISION=   2
CATEGORIES= lang
MASTER_SITES=   http://golang.org/dl/
DISTNAME=   go${PORTVERSION}.src

MAINTAINER= jlaffaye@FreeBSD.org
COMMENT=    Go programming language

LICENSE=    BSD3CLAUSE

USES=       compiler shebangfix
SHEBANG_LANG=   sh perl
SHEBANG_FILES=  src/*.bash \
        src/cmd/go/*.bash \
        doc/progs/run \
        doc/articles/wiki/*.bash \
        test/bench/shootout/timing.sh \
        misc/nacl/*_exec misc/benchcmp \
        src/net/http/cgi/testdata/*.cgi \
        src/regexp/syntax/*.pl \
        lib/codereview/*.sh

sh_OLD_CMD= "/usr/bin/env bash"
sh_CMD=     ${SH}

WRKSRC=     ${WRKDIR}/go

ONLY_FOR_ARCHS=     amd64 armv6 i386

# NB: apparently this failure is only when running under emulation via
# qemu; it works fine on native hardware.  Let's leave the line in as a
# reminder, but commented out for now while this is being investigated.
#BROKEN_armv6=      Fails to configure: wait: interrupted system call

.include <bsd.port.pre.mk>

# If cc is clang, change it to clang to help Go identify the compiler
.if ${COMPILER_TYPE} == "clang" && ${CC} == "cc"
CC=clang
.endif

.if ${ARCH} == "i386"
GOARCH=386
GOOBJ=8
.elif ${ARCH} == "amd64"
GOARCH=amd64
GOOBJ=6
.elif ${ARCH} == "armv6"
GOARCH=arm
GOOBJ=5
.else
IGNORE=     unknown arch ${ARCH}
.endif

PLIST_SUB+= ARCH=${GOARCH} \
        GOOBJ=${GOOBJ}

post-patch:
    @cd ${WRKSRC} && ${FIND} . -name '*.orig' -delete

do-build:
    cd ${WRKSRC}/src && \
        CC=${CC} \
        GOROOT=${WRKSRC} GOROOT_FINAL=${PREFIX}/go14 \
        GOBIN= GOARCH=${GOARCH} GOOS=${OPSYS:tl} \
        CGO_ENABLED=0 \
        ${SH} make.bash

do-install:
    @${CP} -a ${WRKSRC} ${STAGEDIR}${PREFIX}/go14

regression-test: build
    cd ${WRKSRC}/src && GOROOT=${WRKSRC} PATH=${WRKSRC}/bin:${PATH} ${SH} run.bash --no-rebuild --banner

.include <bsd.port.post.mk>