| @@ -1,120 +1,125 @@ | | | @@ -1,120 +1,125 @@ |
1 | # $NetBSD: Makefile,v 1.1 2022/03/15 20:13:45 bsiegert Exp $ | | 1 | # $NetBSD: Makefile,v 1.2 2022/06/14 18:41:44 bsiegert Exp $ |
2 | | | 2 | |
3 | .include "../../lang/go/version.mk" | | 3 | .include "../../lang/go/version.mk" |
4 | .include "../../lang/go/bootstrap.mk" | | 4 | .include "../../lang/go/bootstrap.mk" |
5 | | | 5 | |
6 | GOVERSSUFFIX= 118 | | 6 | GOVERSSUFFIX= 118 |
7 | | | 7 | |
8 | DISTNAME= go${GO${GOVERSSUFFIX}_VERSION:S/.rc/rc/}.src | | 8 | DISTNAME= go${GO${GOVERSSUFFIX}_VERSION:S/.rc/rc/}.src |
9 | PKGNAME= go${GOVERSSUFFIX}-${GO${GOVERSSUFFIX}_VERSION} | | 9 | PKGNAME= go${GOVERSSUFFIX}-${GO${GOVERSSUFFIX}_VERSION} |
10 | CATEGORIES= lang | | 10 | CATEGORIES= lang |
11 | MASTER_SITES= https://storage.googleapis.com/golang/ | | 11 | MASTER_SITES= https://storage.googleapis.com/golang/ |
12 | | | 12 | |
13 | MAINTAINER= bsiegert@NetBSD.org | | 13 | MAINTAINER= bsiegert@NetBSD.org |
14 | HOMEPAGE= https://golang.org/ | | 14 | HOMEPAGE= https://golang.org/ |
15 | COMMENT= The Go programming language | | 15 | COMMENT= The Go programming language |
16 | LICENSE= modified-bsd | | 16 | LICENSE= modified-bsd |
17 | | | 17 | |
18 | WRKSRC= ${WRKDIR}/go | | 18 | WRKSRC= ${WRKDIR}/go |
19 | USE_TOOLS+= bash:run perl:run pax | | 19 | USE_TOOLS+= bash:run perl:run pax |
20 | | | 20 | |
21 | # cgo compiles under TMPDIR | | 21 | # cgo compiles under TMPDIR |
22 | TMPDIR?= /tmp | | 22 | TMPDIR?= /tmp |
23 | BUILDLINK_PASSTHRU_DIRS+= ${TMPDIR} | | 23 | BUILDLINK_PASSTHRU_DIRS+= ${TMPDIR} |
24 | | | 24 | |
25 | GOROOT_FINAL= ${PREFIX}/go${GOVERSSUFFIX} | | 25 | GOROOT_FINAL= ${PREFIX}/go${GOVERSSUFFIX} |
26 | INSTALLATION_DIRS= bin go${GOVERSSUFFIX} | | 26 | INSTALLATION_DIRS= bin go${GOVERSSUFFIX} |
27 | | | 27 | |
28 | REPLACE_BASH+= lib/time/update.bash | | 28 | REPLACE_BASH+= lib/time/update.bash |
29 | REPLACE_BASH+= misc/arm/a | | 29 | REPLACE_BASH+= misc/arm/a |
30 | REPLACE_BASH+= misc/cgo/fortran/test.bash | | 30 | REPLACE_BASH+= misc/cgo/fortran/test.bash |
31 | REPLACE_BASH+= misc/wasm/go_js_wasm_exec | | 31 | REPLACE_BASH+= misc/wasm/go_js_wasm_exec |
32 | REPLACE_BASH+= src/all.bash | | 32 | REPLACE_BASH+= src/all.bash |
33 | REPLACE_BASH+= src/bootstrap.bash | | 33 | REPLACE_BASH+= src/bootstrap.bash |
34 | REPLACE_BASH+= src/buildall.bash | | 34 | REPLACE_BASH+= src/buildall.bash |
35 | REPLACE_BASH+= src/clean.bash | | 35 | REPLACE_BASH+= src/clean.bash |
36 | REPLACE_BASH+= src/cmd/compile/internal/ssa/gen/cover.bash | | 36 | REPLACE_BASH+= src/cmd/compile/internal/ssa/gen/cover.bash |
37 | REPLACE_BASH+= src/cmd/go/mkalldocs.sh | | 37 | REPLACE_BASH+= src/cmd/go/mkalldocs.sh |
38 | REPLACE_BASH+= src/cmd/vendor/golang.org/x/sys/unix/mkall.sh | | 38 | REPLACE_BASH+= src/cmd/vendor/golang.org/x/sys/unix/mkall.sh |
39 | REPLACE_BASH+= src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh | | 39 | REPLACE_BASH+= src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh |
40 | REPLACE_BASH+= src/internal/trace/mkcanned.bash | | 40 | REPLACE_BASH+= src/internal/trace/mkcanned.bash |
41 | REPLACE_BASH+= src/make.bash | | 41 | REPLACE_BASH+= src/make.bash |
42 | REPLACE_BASH+= src/race.bash | | 42 | REPLACE_BASH+= src/race.bash |
43 | REPLACE_BASH+= src/run.bash | | 43 | REPLACE_BASH+= src/run.bash |
44 | REPLACE_BASH+= src/syscall/mkall.sh | | 44 | REPLACE_BASH+= src/syscall/mkall.sh |
45 | REPLACE_BASH+= src/syscall/mkerrors.sh | | 45 | REPLACE_BASH+= src/syscall/mkerrors.sh |
46 | REPLACE_BASH+= src/syscall/mksysnum_plan9.sh | | 46 | REPLACE_BASH+= src/syscall/mksysnum_plan9.sh |
47 | | | 47 | |
48 | REPLACE_PERL+= src/net/http/cgi/testdata/test.cgi | | 48 | REPLACE_PERL+= src/net/http/cgi/testdata/test.cgi |
49 | REPLACE_PERL+= src/regexp/syntax/make_perl_groups.pl | | 49 | REPLACE_PERL+= src/regexp/syntax/make_perl_groups.pl |
50 | REPLACE_PERL+= src/syscall/*.pl | | 50 | REPLACE_PERL+= src/syscall/*.pl |
51 | | | 51 | |
52 | # uses own linker, which does not support relro on NetBSD | | 52 | # uses own linker, which does not support relro on NetBSD |
53 | CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/bin/go | | 53 | CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/bin/go |
54 | CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/bin/gofmt | | 54 | CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/bin/gofmt |
55 | CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/asm | | 55 | CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/asm |
56 | CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/compile | | 56 | CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/compile |
57 | CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/link | | 57 | CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/link |
58 | CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/cgo | | 58 | CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/cgo |
59 | # also does not support SSP at this time | | 59 | # also does not support SSP at this time |
60 | CHECK_SSP_SKIP= ${CHECK_RELRO_SKIP} | | 60 | CHECK_SSP_SKIP= ${CHECK_RELRO_SKIP} |
61 | | | 61 | |
62 | # uses /bin/rc (for Plan 9) | | 62 | # uses /bin/rc (for Plan 9) |
63 | CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/include/plan9/mklibc.rc | | 63 | CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/include/plan9/mklibc.rc |
64 | CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/all.rc | | 64 | CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/all.rc |
65 | CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/clean.rc | | 65 | CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/clean.rc |
66 | CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/make.rc | | 66 | CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/make.rc |
67 | CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/run.rc | | 67 | CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/run.rc |
68 | | | 68 | |
69 | SUBST_CLASSES+= paths | | 69 | SUBST_CLASSES+= paths |
70 | SUBST_STAGE.paths= pre-configure | | 70 | SUBST_STAGE.paths= pre-configure |
71 | SUBST_FILES.paths= src/crypto/x509/root_solaris.go | | 71 | SUBST_FILES.paths= src/crypto/x509/root_solaris.go |
72 | SUBST_VARS.paths= PKG_SYSCONFDIR | | 72 | SUBST_VARS.paths= PKG_SYSCONFDIR |
73 | | | 73 | |
74 | # Required until we bootstrap from a native illumos kit. This is obviously | | 74 | # Required until we bootstrap from a native illumos kit. This is obviously |
75 | # terrible and should be fixed properly. | | 75 | # terrible and should be fixed properly. |
76 | .if ${OPSYS} == "SunOS" && ${OS_VARIANT} != "Solaris" | | 76 | .if ${OPSYS} == "SunOS" && ${OS_VARIANT} != "Solaris" |
77 | SUBST_CLASSES+= grplist | | 77 | SUBST_CLASSES+= grplist |
78 | SUBST_STAGE.grplist= pre-configure | | 78 | SUBST_STAGE.grplist= pre-configure |
79 | SUBST_FILES.grplist= src/os/user/getgrouplist_unix.go | | 79 | SUBST_FILES.grplist= src/os/user/getgrouplist_unix.go |
80 | SUBST_SED.grplist= -e 's,return getgrouplist.*,return 0;,' | | 80 | SUBST_SED.grplist= -e 's,return getgrouplist.*,return 0;,' |
81 | .endif | | 81 | .endif |
82 | | | 82 | |
83 | PLIST_SUBST+= GOVERSSUFFIX=${GOVERSSUFFIX} | | 83 | PLIST_SUBST+= GOVERSSUFFIX=${GOVERSSUFFIX} |
84 | | | 84 | |
85 | PLIST_VARS+= pty route | | 85 | PLIST_VARS+= pty route |
86 | | | 86 | |
87 | .if ${OPSYS} != "SunOS" | | 87 | .if ${OPSYS} != "SunOS" |
88 | PLIST.pty= yes | | 88 | PLIST.pty= yes |
89 | .endif | | 89 | .endif |
90 | | | 90 | |
91 | .if ${OPSYS} != "Linux" && ${OPSYS} != "SunOS" | | 91 | .if ${OPSYS} != "Linux" && ${OPSYS} != "SunOS" |
92 | PLIST.route= yes | | 92 | PLIST.route= yes |
93 | .endif | | 93 | .endif |
94 | | | 94 | |
| | | 95 | PRINT_PLIST_AWK+= /^bin\/go${GOVERSSUFFIX}/ { print "bin/go$${GOVERSSUFFIX}"; next; } |
| | | 96 | PRINT_PLIST_AWK+= /^bin\/gofmt${GOVERSSUFFIX}/ { print "bin/gofmt$${GOVERSSUFFIX}"; next; } |
| | | 97 | PRINT_PLIST_AWK+= /internal\/pty\.a/ { printf "%s", "$${PLIST.pty}"; } |
| | | 98 | PRINT_PLIST_AWK+= /x\/net\/route\.a/ { printf "%s", "$${PLIST.route}"; } |
| | | 99 | |
95 | post-extract: | | 100 | post-extract: |
96 | ${RM} -r -f ${WRKSRC}/test/fixedbugs/issue27836* | | 101 | ${RM} -r -f ${WRKSRC}/test/fixedbugs/issue27836* |
97 | | | 102 | |
98 | do-build: | | 103 | do-build: |
99 | cd ${WRKSRC}/src && \ | | 104 | cd ${WRKSRC}/src && \ |
100 | env \ | | 105 | env \ |
101 | GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:Q} \ | | 106 | GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:Q} \ |
102 | GOROOT_FINAL=${GOROOT_FINAL:Q} \ | | 107 | GOROOT_FINAL=${GOROOT_FINAL:Q} \ |
103 | ${GOOPT} \ | | 108 | ${GOOPT} \ |
104 | GOCACHE=${WRKDIR}/.cache/go-build \ | | 109 | GOCACHE=${WRKDIR}/.cache/go-build \ |
105 | ${BASH} ./make.bash | | 110 | ${BASH} ./make.bash |
106 | # for RELRO build: | | 111 | # for RELRO build: |
107 | # cd ${WRKSRC}/src && env GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:Q} GOROOT_FINAL=${GOROOT_FINAL:Q} GO_LDFLAGS="-buildmode=pie" ${GOOPT} ${BASH} ./make.bash | | 112 | # cd ${WRKSRC}/src && env GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:Q} GOROOT_FINAL=${GOROOT_FINAL:Q} GO_LDFLAGS="-buildmode=pie" ${GOOPT} ${BASH} ./make.bash |
108 | | | 113 | |
109 | do-install: | | 114 | do-install: |
110 | cd ${WRKSRC} && rm -rf pkg/obj pkg/bootstrap | | 115 | cd ${WRKSRC} && rm -rf pkg/obj pkg/bootstrap |
111 | cd ${WRKSRC} && pax -rw . ${DESTDIR}${PREFIX}/go${GOVERSSUFFIX} | | 116 | cd ${WRKSRC} && pax -rw . ${DESTDIR}${PREFIX}/go${GOVERSSUFFIX} |
112 | find ${DESTDIR}${PREFIX}/go${GOVERSSUFFIX} -name \*.orig -exec rm {} \; | | 117 | find ${DESTDIR}${PREFIX}/go${GOVERSSUFFIX} -name \*.orig -exec rm {} \; |
113 | .for cmd in go gofmt | | 118 | .for cmd in go gofmt |
114 | ${LN} -sf ${PREFIX}/go${GOVERSSUFFIX}/bin/${cmd} ${DESTDIR}${PREFIX}/bin/${cmd}${GOVERSSUFFIX} | | 119 | ${LN} -sf ${PREFIX}/go${GOVERSSUFFIX}/bin/${cmd} ${DESTDIR}${PREFIX}/bin/${cmd}${GOVERSSUFFIX} |
115 | .endfor | | 120 | .endfor |
116 | | | 121 | |
117 | do-test: | | 122 | do-test: |
118 | cd ${WRKSRC}/src && GOROOT=${WRKSRC} PATH=${WRKSRC}/bin:${PATH} ${GOOPT} ${BASH} run.bash --no-rebuild --banner "" | | 123 | cd ${WRKSRC}/src && GOROOT=${WRKSRC} PATH=${WRKSRC}/bin:${PATH} ${GOOPT} ${BASH} run.bash --no-rebuild --banner "" |
119 | | | 124 | |
120 | .include "../../mk/bsd.pkg.mk" | | 125 | .include "../../mk/bsd.pkg.mk" |