go-tools needs some love :)

Diff below updates it to the latest tag which is... 0.5.0, hence
EPOCH.  I don't see any tag 1.12 tag in the repo, only 0.1.12.
Haven't digged in the history to see if they changed/retired tags.
go-tools doesn't have any other ports depending on it so nothing else
need to be done, right?

I've switched the port to use MODGO_MODNAME and fetch the modules
needed, dropping the build depends on net/go-net (which can be
removed, but this is for another thread once this gets in)

godoc doesn't need hacks now, but gopls is not bundled anymore.  Not a
big deal, there's another tread in ports@ with a tarball for a new
devel/gopls port.

I had to roll my own do-build because the default one would build
every cmd.  Not a big deal but there a few that doesn't make sense to
ship IMHO.

While here I've also synced DESCR with reality: some tools are not
distributed anymore (not even in the current version) and I've folded
some long lines.  and updated HOMEPAGE.  MODGO_TYPE was also
redundant, dropped.

Comments/Thoughts/OK?

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/devel/go-tools/Makefile,v
retrieving revision 1.27
diff -u -p -r1.27 Makefile
--- Makefile    11 Mar 2022 18:50:08 -0000      1.27
+++ Makefile    24 Jan 2023 18:00:16 -0000
@@ -1,11 +1,13 @@
 COMMENT =              various tools for the Go programming language
-GH_ACCOUNT =           golang
-GH_PROJECT =           tools
-GH_COMMIT =            f727befe758c04ce68d52abc6e69ad111e2c6797
-DISTNAME =             go-tools-1.12.20190226
+
+MODGO_MODNAME =                golang.org/x/tools
+MODGO_VERSION =                v0.5.0
+
+DISTNAME =             go-tools-${MODGO_VERSION}
+EPOCH =                        0
+
 CATEGORIES =           devel
-HOMEPAGE =             https://godoc.org/golang.org/x/tools
-REVISION =             2
+HOMEPAGE =             https://pkg.go.dev/golang.org/x/tools
 
 # 3-clause BSD
 PERMIT_PACKAGE =       Yes
@@ -13,14 +15,9 @@ PERMIT_PACKAGE =     Yes
 WANTLIB +=             c pthread
 
 MODULES =              lang/go
-MODGO_TYPE =           bin
 
-BUILD_DEPENDS =                net/go-net
 RUN_DEPENDS =          ${MODGO_RUN_DEPENDS}
 
-GODOC_TARGET =         golang.org/x/tools/cmd/godoc
-
-_MAIN =                        golang.org/x/tools
 _SUBPKGS =             benchcmp \
                        bundle \
                        callgraph \
@@ -30,9 +27,9 @@ _SUBPKGS =            benchcmp \
                        fiximports \
                        go-contrib-init \
                        godex \
+                       godoc \
                        goimports \
                        gomvpkg \
-                       gopls \
                        gorename \
                        gotype \
                        goyacc \
@@ -44,18 +41,13 @@ _SUBPKGS =          benchcmp \
                        stringer \
                        toolstash
 
-ALL_TARGET =           ${_SUBPKGS:%=${_MAIN}/cmd/%}
-WRKSRC =               ${MODGO_WORKSPACE}/src/${_MAIN}
-
-post-extract:
-       mkdir -p ${MODGO_WORKSPACE}/pkg
+ALL_TARGET =           ${_SUBPKGS:%=golang.org/x/tools/cmd/%}
+WRKDIST =              ${WRKSRC}
 
-# godoc needs special handling - prior to Go 1.2, godoc was part of the base
-# distribution and there is a remaining mapping that causes 'go install' to
-# install godoc in $GOROOT/bin instead of $GOPATH/bin (golang.org/issue/6654).
+# default do-build set by go.port.mk would build everything under
+# cmd/... regardless of ALL_TARGET.
 do-build:
-       ${MODGO_BUILD_TARGET}
-       ${MODGO_CMD} build ${MODGO_FLAGS} -o ${MODGO_WORKSPACE}/bin/godoc \
-               ${GODOC_TARGET}
+       cd ${WRKSRC} && ${MODGO_BUILD_TARGET}
 
+.include "modules.inc"
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /home/cvs/ports/devel/go-tools/distinfo,v
retrieving revision 1.10
diff -u -p -r1.10 distinfo
--- distinfo    16 Mar 2019 13:42:06 -0000      1.10
+++ distinfo    24 Jan 2023 16:17:27 -0000
@@ -1,2 +1,32 @@
-SHA256 (go-tools-1.12.20190226-f727befe.tar.gz) = 
zF8/BaUh7sY45AxfoyMYjGcS/bMv3aCdrd1qUwAcXM8=
-SIZE (go-tools-1.12.20190226-f727befe.tar.gz) = 2643081
+SHA256 (go-tools-v0.5.0.zip) = +Iunkk24qtwqk8kWE2tS9/zUZx5234cWqgLeWGqdGHE=
+SHA256 (go_modules/github.com/yuin/goldmark/@v/v1.4.13.mod) = 
7n/kRmIDoB06wZrcE0zeyZvG3nGZLCjz3Zp0SAv/BgM=
+SHA256 (go_modules/github.com/yuin/goldmark/@v/v1.4.13.zip) = 
u0GmArF0NF/aOSyK2D/MkyF8KFx2NplndjC+kP63peM=
+SHA256 (go_modules/golang.org/x/mod/@v/v0.7.0.mod) = 
YkVnRZxumUesSr3gtwNO5h3Ltqk3P1lwCUwLs+gSGWQ=
+SHA256 (go_modules/golang.org/x/mod/@v/v0.7.0.zip) = 
JKvR2xMymHPXIDTcJ++tCcvDfTnPKLj/e7PCrcju3vc=
+SHA256 (go_modules/golang.org/x/net/@v/v0.5.0.mod) = 
XDe+Zi2TeArML0PMnG6heErvFMEaDyJ971zm23u4pwQ=
+SHA256 (go_modules/golang.org/x/net/@v/v0.5.0.zip) = 
DmBoge6y9XKz1hrSpjnnnK0AIGQJDHXIOKovT+ymHI4=
+SHA256 (go_modules/golang.org/x/sync/@v/v0.1.0.mod) = 
Qh9hOWhtWJHz3FpWPQmVeA0yefZcrU0iXOpSaGeUFhw=
+SHA256 (go_modules/golang.org/x/sync/@v/v0.1.0.zip) = 
9RC+xgCeGYgtGZU+cnMTfTTfhsZZSTRdcvEjolXC7NI=
+SHA256 (go_modules/golang.org/x/sys/@v/v0.4.0.mod) = 
8DMzMJb+GY8xUd7tk/LeunTlC7/nc5E0BFvDt85KUCQ=
+SHA256 (go_modules/golang.org/x/sys/@v/v0.4.0.zip) = 
76k1T8qnCYJbuxyGuD4jR867U0n0MmzEyMy5cq0yAyw=
+SHA256 (go_modules/golang.org/x/term/@v/v0.4.0.mod) = 
zeXNBcC9PaC/rF4royqoXCVwjmVJPn4bfXPDCXcKd7o=
+SHA256 (go_modules/golang.org/x/term/@v/v0.4.0.zip) = 
R3Dzfqp9VJkacfRu7I4pZBCRg7Ai649k1vqOaJNOL3w=
+SHA256 (go_modules/golang.org/x/text/@v/v0.6.0.mod) = 
FZKedvzgSupMkqNUQmu0M3BoRkWk7gPy510MLrFGYwQ=
+SHA256 (go_modules/golang.org/x/text/@v/v0.6.0.zip) = 
nsc+hEJDazM+fQkg3ARujXHacd5YZvJtRHYgeUam34M=
+SHA256 (go_modules/golang.org/x/tools/@v/v0.1.12.mod) = 
KouTZYmPCCL6zmW6CJoTU+aKZdNC8wDKMXzOzN5kIfM=
+SIZE (go-tools-v0.5.0.zip) = 2984292
+SIZE (go_modules/github.com/yuin/goldmark/@v/v1.4.13.mod) = 41
+SIZE (go_modules/github.com/yuin/goldmark/@v/v1.4.13.zip) = 229017
+SIZE (go_modules/golang.org/x/mod/@v/v0.7.0.mod) = 84
+SIZE (go_modules/golang.org/x/mod/@v/v0.7.0.zip) = 161744
+SIZE (go_modules/golang.org/x/net/@v/v0.5.0.mod) = 123
+SIZE (go_modules/golang.org/x/net/@v/v0.5.0.zip) = 1555050
+SIZE (go_modules/golang.org/x/sync/@v/v0.1.0.mod) = 25
+SIZE (go_modules/golang.org/x/sync/@v/v0.1.0.zip) = 27781
+SIZE (go_modules/golang.org/x/sys/@v/v0.4.0.mod) = 33
+SIZE (go_modules/golang.org/x/sys/@v/v0.4.0.zip) = 1881264
+SIZE (go_modules/golang.org/x/term/@v/v0.4.0.mod) = 67
+SIZE (go_modules/golang.org/x/term/@v/v0.4.0.zip) = 19924
+SIZE (go_modules/golang.org/x/text/@v/v0.6.0.mod) = 258
+SIZE (go_modules/golang.org/x/text/@v/v0.6.0.zip) = 8614583
+SIZE (go_modules/golang.org/x/tools/@v/v0.1.12.mod) = 327
Index: modules.inc
===================================================================
RCS file: modules.inc
diff -N modules.inc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ modules.inc 24 Jan 2023 16:16:50 -0000
@@ -0,0 +1,12 @@
+MODGO_MODULES =        \
+       github.com/yuin/goldmark         v1.4.13 \
+       golang.org/x/mod                 v0.7.0 \
+       golang.org/x/net                 v0.5.0 \
+       golang.org/x/sync                v0.1.0 \
+       golang.org/x/sys                 v0.4.0 \
+       golang.org/x/term                v0.4.0 \
+       golang.org/x/text                v0.6.0
+
+MODGO_MODFILES =       \
+       golang.org/x/tools       v0.1.12
+
Index: pkg/DESCR
===================================================================
RCS file: /home/cvs/ports/devel/go-tools/pkg/DESCR,v
retrieving revision 1.3
diff -u -p -r1.3 DESCR
--- pkg/DESCR   21 May 2016 01:29:09 -0000      1.3
+++ pkg/DESCR   24 Jan 2023 18:00:10 -0000
@@ -1,24 +1,31 @@
-This package holds the source for various packages and tools that support the 
Go
-programming language:
+This package holds the source for various packages and tools that
+support the Go programming language:
 
  * benchcmp    displays performance changes between benchmarks
- * bundle      creates a single-source-file version of a source package 
suitable
-               for inclusion in a particular target package
+ * bundle      creates a single-source-file version of a source package
+               suitable for inclusion in a particular target package
  * callgraph   a tool for reporting the call graph of a Go program
- * digraph     performs queries over unlabelled directed graphs represented in
-               text form
+ * compilebench        benchmarks the speed of the Go compiler
+ * digraph     performs queries over unlabelled directed graphs represented
+               in text form
  * eg          performs example-based refactoring
- * fiximports  fixes import declarations to use the canonical import path for
-               packages that have an "import comment"
+ * fiximports  fixes import declarations to use the canonical import path
+               for packages that have an "import comment"
+ * go-contrib-init helps new Go contributors to get their development
+               environment set up for the Go contribution process.
  * godex       dumps exported information of packages or selected objects
  * godoc       extracts and generates documentation for Go programs
  * goimports   updates Go import lines
  * gomvpkg     moves go packages, updating import declarations
  * gorename    performs precise type-safe renaming of identifiers in Go code
  * gotype      syntactic and semantic analysis of Go files and packages
- * html2article        takes an HTML file and outputs a corresponding article 
file in
-               present format
- * oracle      answers questions about Go source code
- * ssadump     displays and interprets the SSA form of Go programs
+ * goyacc      Go version of yacc
+ * guru                tool for answering questions about Go source code
+ * html2article        takes an HTML file and outputs a corresponding article 
file
+               in present format
+ * present     displayslide presentations and articles
+ * ssadump     display and interpret the SSA form of Go programs
  * stress      utility intended for catching of episodic failures
  * stringer    creation of methods that satisfy the fmt.Stringer interface
+ * toolstash   save, run and restore a known good copy of the Go toolchain
+               and compare the object files generated by two toolchains
Index: pkg/PLIST
===================================================================
RCS file: /home/cvs/ports/devel/go-tools/pkg/PLIST,v
retrieving revision 1.14
diff -u -p -r1.14 PLIST
--- pkg/PLIST   11 Mar 2022 18:50:08 -0000      1.14
+++ pkg/PLIST   24 Jan 2023 18:00:05 -0000
@@ -14,7 +14,6 @@
 @bin bin/godoc
 @bin bin/goimports
 @bin bin/gomvpkg
-@bin bin/gopls
 @bin bin/gorename
 @bin bin/gotype
 @bin bin/goyacc

Reply via email to