git: ed5a244f11f4 - main - net/librespeed-cli: fix build on riscv64

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Mon, 27 Mar 2023 11:27:09 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ed5a244f11f49e04328a16fa22bc3415ceed1a68

commit ed5a244f11f49e04328a16fa22bc3415ceed1a68
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-03-24 21:36:18 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-03-27 11:24:55 +0000

    net/librespeed-cli: fix build on riscv64
    
    Bump golang.org/x/{net,sys} dependencies to versions new
    enough to support riscv64-freebsd.
    
    Sponsored by:   Berliner Linux User Group e.V.
    Approved by:    portmgr (build fix blanket)
---
 net/librespeed-cli/Makefile                       |  9 ++++
 net/librespeed-cli/distinfo                       |  6 ++-
 net/librespeed-cli/files/patch-go.mod             | 32 ++++++++++++
 net/librespeed-cli/files/patch-go.sum             | 20 ++++++++
 net/librespeed-cli/files/patch-vendor_modules.txt | 59 +++++++++++++++++++++++
 5 files changed, 125 insertions(+), 1 deletion(-)

diff --git a/net/librespeed-cli/Makefile b/net/librespeed-cli/Makefile
index f6369f14d01b..ecc01b367854 100644
--- a/net/librespeed-cli/Makefile
+++ b/net/librespeed-cli/Makefile
@@ -12,6 +12,9 @@ LICENSE=	LGPL3
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
 USES=		go:modules
+USE_GITHUB=	nodefault
+GH_TUPLE=	golang:net:v0.8.0:net \
+		golang:sys:v0.6.0:sys
 
 GO_MODULE=	github.com/librespeed/speedtest-cli
 GO_BUILDFLAGS+=	-ldflags "-X \"librespeed-cli/defs.ProgName=${PORTNAME}\" \
@@ -20,4 +23,10 @@ GO_BUILDFLAGS+=	-ldflags "-X \"librespeed-cli/defs.ProgName=${PORTNAME}\" \
 
 PLIST_FILES=	bin/librespeed-cli
 
+pre-patch:
+.for m in net sys
+	${RM} -r ${WRKSRC}/vendor/golang.org/x/$m
+	${LN} -s ${WRKDIR}/$m-* ${WRKSRC}/vendor/golang.org/x/$m
+.endfor
+
 .include <bsd.port.mk>
diff --git a/net/librespeed-cli/distinfo b/net/librespeed-cli/distinfo
index b81f30738612..529e412516cc 100644
--- a/net/librespeed-cli/distinfo
+++ b/net/librespeed-cli/distinfo
@@ -1,5 +1,9 @@
-TIMESTAMP = 1657306529
+TIMESTAMP = 1679693757
 SHA256 (go/net_librespeed-cli/librespeed-cli-v1.0.10/v1.0.10.mod) = 0564307c5ba5746b08372cf21d82f91a50af3a5aa5f463ec849c8e9cf7eadc1e
 SIZE (go/net_librespeed-cli/librespeed-cli-v1.0.10/v1.0.10.mod) = 624
 SHA256 (go/net_librespeed-cli/librespeed-cli-v1.0.10/v1.0.10.zip) = b8015d4d63ca2a0660255b85ec22a39c9d09386f784c6713316a120435ee4487
 SIZE (go/net_librespeed-cli/librespeed-cli-v1.0.10/v1.0.10.zip) = 31726
+SHA256 (go/net_librespeed-cli/librespeed-cli-v1.0.10/golang-net-v0.8.0_GH0.tar.gz) = f9e2128a2d6861db0595428c7cce62fe5a131348a6c7651b6efa8b03d0b10831
+SIZE (go/net_librespeed-cli/librespeed-cli-v1.0.10/golang-net-v0.8.0_GH0.tar.gz) = 1244302
+SHA256 (go/net_librespeed-cli/librespeed-cli-v1.0.10/golang-sys-v0.6.0_GH0.tar.gz) = b4f6d17c7a128f76169964b437cb66b3f2dbf9a33361928ec19dfecf7b03fc54
+SIZE (go/net_librespeed-cli/librespeed-cli-v1.0.10/golang-sys-v0.6.0_GH0.tar.gz) = 1434234
diff --git a/net/librespeed-cli/files/patch-go.mod b/net/librespeed-cli/files/patch-go.mod
new file mode 100644
index 000000000000..ede36f4178be
--- /dev/null
+++ b/net/librespeed-cli/files/patch-go.mod
@@ -0,0 +1,32 @@
+--- go.mod.orig	2023-03-24 21:32:43 UTC
++++ go.mod
+@@ -1,17 +1,22 @@
+ module github.com/librespeed/speedtest-cli
+ 
+-go 1.14
++go 1.17
+ 
+ require (
+ 	github.com/briandowns/spinner v1.12.0
+-	github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
+-	github.com/fatih/color v1.10.0 // indirect
+ 	github.com/go-ping/ping v0.0.0-20210407214646-e4e642a95741
+ 	github.com/gocarina/gocsv v0.0.0-20210408192840-02d7211d929d
+-	github.com/russross/blackfriday/v2 v2.1.0 // indirect
+ 	github.com/sirupsen/logrus v1.8.1
+-	github.com/stretchr/testify v1.3.0 // indirect
+ 	github.com/urfave/cli/v2 v2.3.0
+-	golang.org/x/net v0.0.0-20210421230115-4e50805a0758 // indirect
+-	golang.org/x/sys v0.0.0-20210421221651-33663a62ff08 // indirect
++)
++
++require (
++	github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
++	github.com/fatih/color v1.10.0 // indirect
++	github.com/mattn/go-colorable v0.1.8 // indirect
++	github.com/mattn/go-isatty v0.0.12 // indirect
++	github.com/russross/blackfriday/v2 v2.1.0 // indirect
++	github.com/stretchr/testify v1.3.0 // indirect
++	golang.org/x/net v0.8.0 // indirect
++	golang.org/x/sys v0.6.0 // indirect
+ )
diff --git a/net/librespeed-cli/files/patch-go.sum b/net/librespeed-cli/files/patch-go.sum
new file mode 100644
index 000000000000..5eb00e150212
--- /dev/null
+++ b/net/librespeed-cli/files/patch-go.sum
@@ -0,0 +1,20 @@
+--- go.sum.orig	2023-03-24 21:32:45 UTC
++++ go.sum
+@@ -40,6 +40,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go
+ golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+ golang.org/x/net v0.0.0-20210421230115-4e50805a0758 h1:aEpZnXcAmXkd6AvLb2OPt+EN1Zu/8Ne3pCqPjja5PXY=
+ golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM=
++golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
++golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
+ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+ golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+@@ -51,6 +53,8 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go
+ golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+ golang.org/x/sys v0.0.0-20210421221651-33663a62ff08 h1:qyN5bV+96OX8pL78eXDuz6YlDPzCYgdW74H5yE9BoSU=
+ golang.org/x/sys v0.0.0-20210421221651-33663a62ff08/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
++golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
++golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
diff --git a/net/librespeed-cli/files/patch-vendor_modules.txt b/net/librespeed-cli/files/patch-vendor_modules.txt
new file mode 100644
index 000000000000..71131755adff
--- /dev/null
+++ b/net/librespeed-cli/files/patch-vendor_modules.txt
@@ -0,0 +1,59 @@
+--- vendor/modules.txt.orig	2023-03-24 21:34:27 UTC
++++ vendor/modules.txt
+@@ -1,43 +1,45 @@
+ # github.com/briandowns/spinner v1.12.0
+-## explicit
++## explicit; go 1.14
+ github.com/briandowns/spinner
+ # github.com/cpuguy83/go-md2man/v2 v2.0.0
+-## explicit
++## explicit; go 1.12
+ github.com/cpuguy83/go-md2man/v2/md2man
+ # github.com/fatih/color v1.10.0
+-## explicit
++## explicit; go 1.13
+ github.com/fatih/color
+ # github.com/go-ping/ping v0.0.0-20210407214646-e4e642a95741
+-## explicit
++## explicit; go 1.14
+ github.com/go-ping/ping
+ # github.com/gocarina/gocsv v0.0.0-20210408192840-02d7211d929d
+-## explicit
++## explicit; go 1.13
+ github.com/gocarina/gocsv
+ # github.com/mattn/go-colorable v0.1.8
++## explicit; go 1.13
+ github.com/mattn/go-colorable
+ # github.com/mattn/go-isatty v0.0.12
++## explicit; go 1.12
+ github.com/mattn/go-isatty
+ # github.com/russross/blackfriday/v2 v2.1.0
+ ## explicit
+ github.com/russross/blackfriday/v2
+ # github.com/sirupsen/logrus v1.8.1
+-## explicit
++## explicit; go 1.13
+ github.com/sirupsen/logrus
+ # github.com/stretchr/testify v1.3.0
+ ## explicit
+ # github.com/urfave/cli/v2 v2.3.0
+-## explicit
++## explicit; go 1.11
+ github.com/urfave/cli/v2
+-# golang.org/x/net v0.0.0-20210421230115-4e50805a0758
+-## explicit
++# golang.org/x/net v0.8.0
++## explicit; go 1.17
+ golang.org/x/net/bpf
+ golang.org/x/net/icmp
+ golang.org/x/net/internal/iana
+ golang.org/x/net/internal/socket
+ golang.org/x/net/ipv4
+ golang.org/x/net/ipv6
+-# golang.org/x/sys v0.0.0-20210421221651-33663a62ff08
+-## explicit
++# golang.org/x/sys v0.6.0
++## explicit; go 1.17
+ golang.org/x/sys/internal/unsafeheader
+ golang.org/x/sys/unix
+ golang.org/x/sys/windows