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