aboutsummaryrefslogtreecommitdiffstats
path: root/lang/go/Makefile
blob: 1c9b305446b94786bbbcbb3a986ab4ee3681ba47 (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
# Ports collection makefile for:  go
# Date created:           04 December 2010
# Whom:               Devon H. O'Dell <devon.odell@gmail.com>
#
# $FreeBSD$
#

PORTNAME=   go
PORTVERSION=    20111017
PORTREVISION=   1
CATEGORIES= lang
MASTER_SITES=   LOCAL/jlaffaye

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

LICENSE=    BSD

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

ONLY_FOR_ARCHS= i386 amd64
USE_XZ=     yes
USE_GMAKE=  yes
SUB_FILES=  pkg-message
SUB_LIST+=  GOOBJ=${GOOBJ} \
        ARCH=${GOARCH}

.include <bsd.port.pre.mk>

.if ${ARCH} == "i386"
GOARCH=386
GOOBJ=8
.else
GOARCH=amd64
GOOBJ=6
.endif

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

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

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

do-install:
.if !defined(NOPORTDOCS)
    ${INSTALL} -d -m 0755 ${DOCSDIR}
    ${CP} -R ${WRKSRC}/doc/ ${DOCSDIR}
.endif
    ${INSTALL_SCRIPT} ${WRKSRC}/bin/* ${PREFIX}/bin/
    ${INSTALL} -d ${PREFIX}/go/pkg
    (cd ${WRKSRC}/pkg/ && ${COPYTREE_SHARE} \* ${PREFIX}/go/pkg)
    ${INSTALL} -d ${PREFIX}/go/src/
    ${INSTALL} -m 0644 ${WRKSRC}/src/Make.* ${PREFIX}/go/src/
    ${INSTALL} -d ${PREFIX}/go/src/pkg/
    (cd ${WRKSRC}/src/pkg/ && ${COPYTREE_SHARE} \* ${PREFIX}/go/src/pkg)
    ${INSTALL} -d ${PREFIX}/go/lib/
    (cd ${WRKSRC}/lib/ && ${COPYTREE_SHARE} \* ${PREFIX}/go/lib)

.include <bsd.port.post.mk>