Tue Jun 14 18:41:44 2022 UTC ()
go118: make print-PLIST work without manual fixups

Add some PRINT_PLIST_AWK statements to do the standard transformations
that I used to do by hand. With this change, "make print-PLIST" outputs
the correct PLIST without a need for manually fixing some lines.


(bsiegert)
diff -r1.1 -r1.2 pkgsrc/lang/go118/Makefile

cvs diff -r1.1 -r1.2 pkgsrc/lang/go118/Makefile (switch to unified diff)

--- pkgsrc/lang/go118/Makefile 2022/03/15 20:13:45 1.1
+++ pkgsrc/lang/go118/Makefile 2022/06/14 18:41:44 1.2
@@ -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
6GOVERSSUFFIX= 118 6GOVERSSUFFIX= 118
7 7
8DISTNAME= go${GO${GOVERSSUFFIX}_VERSION:S/.rc/rc/}.src 8DISTNAME= go${GO${GOVERSSUFFIX}_VERSION:S/.rc/rc/}.src
9PKGNAME= go${GOVERSSUFFIX}-${GO${GOVERSSUFFIX}_VERSION} 9PKGNAME= go${GOVERSSUFFIX}-${GO${GOVERSSUFFIX}_VERSION}
10CATEGORIES= lang 10CATEGORIES= lang
11MASTER_SITES= https://storage.googleapis.com/golang/ 11MASTER_SITES= https://storage.googleapis.com/golang/
12 12
13MAINTAINER= bsiegert@NetBSD.org 13MAINTAINER= bsiegert@NetBSD.org
14HOMEPAGE= https://golang.org/ 14HOMEPAGE= https://golang.org/
15COMMENT= The Go programming language 15COMMENT= The Go programming language
16LICENSE= modified-bsd 16LICENSE= modified-bsd
17 17
18WRKSRC= ${WRKDIR}/go 18WRKSRC= ${WRKDIR}/go
19USE_TOOLS+= bash:run perl:run pax 19USE_TOOLS+= bash:run perl:run pax
20 20
21# cgo compiles under TMPDIR 21# cgo compiles under TMPDIR
22TMPDIR?= /tmp 22TMPDIR?= /tmp
23BUILDLINK_PASSTHRU_DIRS+= ${TMPDIR} 23BUILDLINK_PASSTHRU_DIRS+= ${TMPDIR}
24 24
25GOROOT_FINAL= ${PREFIX}/go${GOVERSSUFFIX} 25GOROOT_FINAL= ${PREFIX}/go${GOVERSSUFFIX}
26INSTALLATION_DIRS= bin go${GOVERSSUFFIX} 26INSTALLATION_DIRS= bin go${GOVERSSUFFIX}
27 27
28REPLACE_BASH+= lib/time/update.bash 28REPLACE_BASH+= lib/time/update.bash
29REPLACE_BASH+= misc/arm/a 29REPLACE_BASH+= misc/arm/a
30REPLACE_BASH+= misc/cgo/fortran/test.bash 30REPLACE_BASH+= misc/cgo/fortran/test.bash
31REPLACE_BASH+= misc/wasm/go_js_wasm_exec 31REPLACE_BASH+= misc/wasm/go_js_wasm_exec
32REPLACE_BASH+= src/all.bash 32REPLACE_BASH+= src/all.bash
33REPLACE_BASH+= src/bootstrap.bash 33REPLACE_BASH+= src/bootstrap.bash
34REPLACE_BASH+= src/buildall.bash 34REPLACE_BASH+= src/buildall.bash
35REPLACE_BASH+= src/clean.bash 35REPLACE_BASH+= src/clean.bash
36REPLACE_BASH+= src/cmd/compile/internal/ssa/gen/cover.bash 36REPLACE_BASH+= src/cmd/compile/internal/ssa/gen/cover.bash
37REPLACE_BASH+= src/cmd/go/mkalldocs.sh 37REPLACE_BASH+= src/cmd/go/mkalldocs.sh
38REPLACE_BASH+= src/cmd/vendor/golang.org/x/sys/unix/mkall.sh 38REPLACE_BASH+= src/cmd/vendor/golang.org/x/sys/unix/mkall.sh
39REPLACE_BASH+= src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh 39REPLACE_BASH+= src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh
40REPLACE_BASH+= src/internal/trace/mkcanned.bash 40REPLACE_BASH+= src/internal/trace/mkcanned.bash
41REPLACE_BASH+= src/make.bash 41REPLACE_BASH+= src/make.bash
42REPLACE_BASH+= src/race.bash 42REPLACE_BASH+= src/race.bash
43REPLACE_BASH+= src/run.bash 43REPLACE_BASH+= src/run.bash
44REPLACE_BASH+= src/syscall/mkall.sh 44REPLACE_BASH+= src/syscall/mkall.sh
45REPLACE_BASH+= src/syscall/mkerrors.sh 45REPLACE_BASH+= src/syscall/mkerrors.sh
46REPLACE_BASH+= src/syscall/mksysnum_plan9.sh 46REPLACE_BASH+= src/syscall/mksysnum_plan9.sh
47 47
48REPLACE_PERL+= src/net/http/cgi/testdata/test.cgi 48REPLACE_PERL+= src/net/http/cgi/testdata/test.cgi
49REPLACE_PERL+= src/regexp/syntax/make_perl_groups.pl 49REPLACE_PERL+= src/regexp/syntax/make_perl_groups.pl
50REPLACE_PERL+= src/syscall/*.pl 50REPLACE_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
53CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/bin/go 53CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/bin/go
54CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/bin/gofmt 54CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/bin/gofmt
55CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/asm 55CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/asm
56CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/compile 56CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/compile
57CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/link 57CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/link
58CHECK_RELRO_SKIP+= go${GOVERSSUFFIX}/pkg/bootstrap/bin/cgo 58CHECK_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
60CHECK_SSP_SKIP= ${CHECK_RELRO_SKIP} 60CHECK_SSP_SKIP= ${CHECK_RELRO_SKIP}
61 61
62# uses /bin/rc (for Plan 9) 62# uses /bin/rc (for Plan 9)
63CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/include/plan9/mklibc.rc 63CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/include/plan9/mklibc.rc
64CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/all.rc 64CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/all.rc
65CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/clean.rc 65CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/clean.rc
66CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/make.rc 66CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/make.rc
67CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/run.rc 67CHECK_INTERPRETER_SKIP+= go${GOVERSSUFFIX}/src/run.rc
68 68
69SUBST_CLASSES+= paths 69SUBST_CLASSES+= paths
70SUBST_STAGE.paths= pre-configure 70SUBST_STAGE.paths= pre-configure
71SUBST_FILES.paths= src/crypto/x509/root_solaris.go 71SUBST_FILES.paths= src/crypto/x509/root_solaris.go
72SUBST_VARS.paths= PKG_SYSCONFDIR 72SUBST_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"
77SUBST_CLASSES+= grplist 77SUBST_CLASSES+= grplist
78SUBST_STAGE.grplist= pre-configure 78SUBST_STAGE.grplist= pre-configure
79SUBST_FILES.grplist= src/os/user/getgrouplist_unix.go 79SUBST_FILES.grplist= src/os/user/getgrouplist_unix.go
80SUBST_SED.grplist= -e 's,return getgrouplist.*,return 0;,' 80SUBST_SED.grplist= -e 's,return getgrouplist.*,return 0;,'
81.endif 81.endif
82 82
83PLIST_SUBST+= GOVERSSUFFIX=${GOVERSSUFFIX} 83PLIST_SUBST+= GOVERSSUFFIX=${GOVERSSUFFIX}
84 84
85PLIST_VARS+= pty route 85PLIST_VARS+= pty route
86 86
87.if ${OPSYS} != "SunOS" 87.if ${OPSYS} != "SunOS"
88PLIST.pty= yes 88PLIST.pty= yes
89.endif 89.endif
90 90
91.if ${OPSYS} != "Linux" && ${OPSYS} != "SunOS" 91.if ${OPSYS} != "Linux" && ${OPSYS} != "SunOS"
92PLIST.route= yes 92PLIST.route= yes
93.endif 93.endif
94 94
 95PRINT_PLIST_AWK+= /^bin\/go${GOVERSSUFFIX}/ { print "bin/go$${GOVERSSUFFIX}"; next; }
 96PRINT_PLIST_AWK+= /^bin\/gofmt${GOVERSSUFFIX}/ { print "bin/gofmt$${GOVERSSUFFIX}"; next; }
 97PRINT_PLIST_AWK+= /internal\/pty\.a/ { printf "%s", "$${PLIST.pty}"; }
 98PRINT_PLIST_AWK+= /x\/net\/route\.a/ { printf "%s", "$${PLIST.route}"; }
 99
95post-extract: 100post-extract:
96 ${RM} -r -f ${WRKSRC}/test/fixedbugs/issue27836* 101 ${RM} -r -f ${WRKSRC}/test/fixedbugs/issue27836*
97 102
98do-build: 103do-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
109do-install: 114do-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
117do-test: 122do-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"