aboutsummaryrefslogtreecommitdiffstats
path: root/lang/go/Makefile
blob: 5b1b168909c6f8cad7270ff8d384668659cc4d58 (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
# Created by: Devon H. O'Dell <devon.odell@gmail.com>
# $FreeBSD$

PORTNAME=   go
PORTVERSION=    1.1
PORTEPOCH=  1
CATEGORIES= lang
MASTER_SITES=   GOOGLE_CODE
DISTNAME=   go${PORTVERSION}.src

MAINTAINER= jlaffaye@FreeBSD.org
COMMENT=    A concurrent, garbage-collected language

LICENSE=    BSD

BUILD_DEPENDS=  bash:${PORTSDIR}/shells/bash    \
        bison:${PORTSDIR}/devel/bison

WRKSRC=     ${WRKDIR}/go
ONLY_FOR_ARCHS= i386 amd64
SUB_FILES=  pkg-message
SUB_LIST+=  GOOBJ=${GOOBJ} \
        ARCH=${GOARCH}

.include <bsd.port.pre.mk>

.if ${ARCH} == "i386"
GOARCH=386
GOOBJ=8
PLIST_SUB+= ENAM="@comment "
.else
GOARCH=amd64
GOOBJ=6
PLIST_SUB+= ENAM=""
.endif

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

do-build:
    (cd ${WRKSRC}/src &&            \
        GOTRACEBACK=2           \
        GOROOT=${WRKSRC}        \
        GOROOT_FINAL=${PREFIX}/go   \
        GOBIN=              \
        GOARCH=${GOARCH}        \
        GOOS=freebsd            \
        bash make.bash)

post-install:
    @${CAT} ${PKGMESSAGE}

do-install:
    @${CP} -a ${WRKSRC} ${PREFIX}
.for f in go godoc gofmt
    @${LN} -s ${PREFIX}/go/bin/${f} ${PREFIX}/bin/${f}
.endfor

.include <bsd.port.post.mk>