Lines 1-30
Link Here
|
1 |
# Created by: Devon H. O'Dell <devon.odell@gmail.com> |
1 |
# Created by: Devon H. O'Dell <devon.odell@gmail.com> |
2 |
|
2 |
|
3 |
PORTVERSION= g20220319 |
3 |
PORTNAME?= go-devel |
4 |
# Always set PORTREVISION and PORTEPOCH explicitly as otherwise they are inherited from lang/go |
4 |
DISTVERSION?= g20220319 |
5 |
PORTREVISION= 0 |
5 |
PORTREVISION?= 0 |
6 |
PORTEPOCH= 0 |
6 |
CATEGORIES= lang |
7 |
MASTER_SITES= https://github.com/dmgk/go-bootstrap/releases/download/${BOOTSTRAP_TAG}/:bootstrap \ |
7 |
MASTER_SITES?= https://github.com/dmgk/go-bootstrap/releases/download/${BOOTSTRAP_TAG}/:bootstrap \ |
8 |
LOCAL/dmgk:bootstrap |
8 |
LOCAL/dmgk:bootstrap |
9 |
PKGNAMESUFFIX= -devel |
9 |
DISTFILES?= go-${OPSYS:tl}-${GOARCH_${ARCH}}${GOARM_${ARCH}}-${BOOTSTRAP_TAG}.tar.xz:bootstrap |
10 |
DISTFILES= go-${OPSYS:tl}-${GOARCH_${ARCH}}${GOARM_${ARCH}}-${BOOTSTRAP_TAG}.tar.xz:bootstrap |
|
|
11 |
|
10 |
|
12 |
# Avoid conflicting patch files |
11 |
MAINTAINER= ygy@FreeBSD.org |
13 |
PATCHFILES= |
12 |
COMMENT?= Go programming language (development version) |
14 |
|
13 |
|
15 |
COMMENT= Go programming language (development version) |
14 |
LICENSE= BSD3CLAUSE |
|
|
15 |
LICENSE_FILE= ${WRKSRC}/LICENSE |
16 |
|
16 |
|
|
|
17 |
.ifdef QEMU_EMULATING |
18 |
IGNORE= fails to build with qemu-user-static |
19 |
.endif |
20 |
|
21 |
ONLY_FOR_ARCHS= aarch64 amd64 armv6 armv7 i386 |
22 |
|
23 |
RUN_DEPENDS= ${RUN_DEPENDS_${ARCH}} |
24 |
# ld.bfd from devel/binutils is needed for working cgo on aarch64 |
25 |
RUN_DEPENDS_aarch64= binutils>0:devel/binutils |
26 |
|
27 |
TEST_DEPENDS= ${TEST_DEPENDS_${ARCH}} |
28 |
# ld.bfd from devel/binutils is needed for working cgo on aarch64 |
29 |
TEST_DEPENDS_aarch64= binutils>0:devel/binutils |
30 |
|
31 |
USES= cpe shebangfix |
32 |
|
33 |
CPE_VENDOR= golang |
34 |
|
35 |
.ifndef MASTERDIR |
17 |
USE_GITHUB= yes |
36 |
USE_GITHUB= yes |
18 |
GH_ACCOUNT= golang |
37 |
GH_ACCOUNT= golang |
|
|
38 |
GH_PROJECT= go |
19 |
GH_TAGNAME= 4aa1efed4853ea067d665a952eee77c52faac774 |
39 |
GH_TAGNAME= 4aa1efed4853ea067d665a952eee77c52faac774 |
|
|
40 |
.endif |
20 |
|
41 |
|
21 |
CONFLICTS_INSTALL= go |
42 |
SHEBANG_FILES= misc/wasm/go_js_wasm_exec \ |
|
|
43 |
src/net/http/cgi/testdata/test.cgi |
44 |
SHEBANG_GLOB= *.bash *.pl *.sh |
22 |
|
45 |
|
23 |
MASTERDIR= ${.CURDIR}/../go |
46 |
# Upstream archive contains files with UTF-8 names |
24 |
PATCHDIR= ${.CURDIR}/files |
47 |
EXTRACT_CMD= ${SETENV} LC_ALL=en_US.UTF-8 ${TAR} |
25 |
DISTINFO_FILE= ${.CURDIR}/distinfo |
48 |
|
|
|
49 |
.ifndef GH_TAGNAME |
50 |
.endif |
51 |
|
52 |
OPTIONS_DEFINE_i386= SOFTFLOAT |
53 |
SOFTFLOAT_DESC= Use soft float on non-SSE2 processors (Pentium 4 and older) |
54 |
SOFTFLOAT_VARS= GO386=softfloat |
55 |
|
56 |
BOOTSTRAP_TAG= go1.17.9 |
57 |
GO_SUFFIX= ${PORTNAME:S/go//} |
58 |
|
59 |
GOARCH_aarch64= arm64 |
60 |
GOARCH_amd64= amd64 |
61 |
GOARCH_armv6= arm |
62 |
GOARCH_armv7= arm |
63 |
GOARCH_i386= 386 |
64 |
GOARM_armv6= 6 |
65 |
GOARM_armv7= 7 |
26 |
|
66 |
|
27 |
post-extract: |
67 |
post-extract: |
28 |
@[ -f ${WRKSRC}/VERSION ] || ${ECHO_CMD} "devel +${GH_TAGNAME}" > ${WRKSRC}/VERSION |
68 |
@[ -f ${WRKSRC}/VERSION ] || ${ECHO_CMD} "devel +${GH_TAGNAME}" > ${WRKSRC}/VERSION |
29 |
|
69 |
|
30 |
.include "${MASTERDIR}/Makefile" |
70 |
post-patch: |
|
|
71 |
@${REINPLACE_CMD} -e 's|type -ap |type |' ${WRKSRC}/src/make.bash |
72 |
@${REINPLACE_CMD} -e 's|^if ulimit -T|false \&\& &|' ${WRKSRC}/src/run.bash |
73 |
|
74 |
pre-build: |
75 |
# Check that the running kernel has COMPAT_FREEBSD11 required by lang/go{,-devel} post-ino64 |
76 |
@${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ |
77 |
${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh |
78 |
|
79 |
do-build: |
80 |
cd ${WRKSRC}/src ; ${SETENV} \ |
81 |
XDG_CACHE_HOME=${WRKDIR} \ |
82 |
GOROOT_BOOTSTRAP=${WRKDIR}/go-${OPSYS:tl}-${GOARCH_${ARCH}}${GOARM_${ARCH}}-bootstrap \ |
83 |
GOROOT=${WRKSRC} \ |
84 |
GOROOT_FINAL=${PREFIX}/go${GO_SUFFIX} \ |
85 |
GOBIN= \ |
86 |
GOOS=${OPSYS:tl} \ |
87 |
GOARCH=${GOARCH_${ARCH}} \ |
88 |
GO386=${GO386} \ |
89 |
GOARM=${GOARM_${ARCH}} \ |
90 |
CC=${CC} \ |
91 |
${SH} make.bash -v |
92 |
|
93 |
do-install: |
94 |
@cd ${WRKSRC} ; \ |
95 |
${RM} -r .gitattributes .gitignore .github favicon.ico robots.txt \ |
96 |
pkg/obj pkg/bootstrap pkg/${OPSYS:tl}_${GOARCH_${ARCH}}/cmd |
97 |
@${MKDIR} ${STAGEDIR}${PREFIX}/go${GO_SUFFIX} |
98 |
@${CP} -a ${WRKSRC}/* ${STAGEDIR}${PREFIX}/go${GO_SUFFIX} |
99 |
.for f in go gofmt |
100 |
${LN} -sf ../go${GO_SUFFIX}/bin/${f} ${STAGEDIR}${PREFIX}/bin/${f}${GO_SUFFIX} |
101 |
@${ECHO_CMD} bin/${f}${GO_SUFFIX} >> ${TMPPLIST} |
102 |
.endfor |
103 |
@cd ${STAGEDIR}${PREFIX} && ${FIND} go${GO_SUFFIX} -type f >> ${TMPPLIST} |
104 |
|
105 |
do-test: |
106 |
cd ${WRKSRC}/src && ${SETENV} \ |
107 |
GOROOT=${WRKSRC} \ |
108 |
PATH=${WRKSRC}/bin:${PATH} \ |
109 |
GOOS=${OPSYS:tl} \ |
110 |
GOARCH=${GOARCH_${ARCH}} \ |
111 |
GO386=${GO386} \ |
112 |
GOARM=${GOARM_${ARCH}} \ |
113 |
CC=${CC} \ |
114 |
${SH} run.bash -no-rebuild |
115 |
|
116 |
.if !defined(_GO_MAKESUM_GUARD) |
117 |
makesum: |
118 |
${MAKE} -D_GO_MAKESUM_GUARD makesum ARCH=${ONLY_FOR_ARCHS:O:[1]} DISTINFO_FILE=${DISTINFO_FILE}.tmp |
119 |
.for arch in ${ONLY_FOR_ARCHS:O:[2..-1]} |
120 |
${MAKE} -D_GO_MAKESUM_GUARD makesum ARCH=${arch} DISTINFO_FILE=${DISTINFO_FILE}.${arch} |
121 |
${SED} 1d ${DISTINFO_FILE}.${arch} >> ${DISTINFO_FILE}.tmp |
122 |
${RM} ${DISTINFO_FILE}.${arch} |
123 |
.endfor |
124 |
${AWK} '!seen[$$0]++' ${DISTINFO_FILE}.tmp > ${DISTINFO_FILE} |
125 |
${RM} ${DISTINFO_FILE}.tmp |
126 |
.endif |
127 |
|
128 |
.include <bsd.port.mk> |