git: 62136192aee0 - main - net/librespeed-go: fix build on riscv64

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Wed, 22 Mar 2023 20:16:57 UTC
The branch main has been updated by fuz:

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

commit 62136192aee084ce4a2440a5c0f12663bf30df9c
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-03-20 15:10:33 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-03-22 20:15:19 +0000

    net/librespeed-go: fix build on riscv64
    
    Bump golang.org/x/sys dependency to a version new enough
    to support riscv64-freebsd.
    
    Sponsored by:   Berliner Linux User Group e.V.
    Approved by:    portmgr (build fix blanket)
---
 net/librespeed-go/Makefile                       |   9 +-
 net/librespeed-go/distinfo                       |   4 +-
 net/librespeed-go/files/patch-go.mod             |  40 +++++++
 net/librespeed-go/files/patch-go.sum             |  11 ++
 net/librespeed-go/files/patch-vendor_modules.txt | 129 +++++++++++++++++++++++
 5 files changed, 191 insertions(+), 2 deletions(-)

diff --git a/net/librespeed-go/Makefile b/net/librespeed-go/Makefile
index c0b2c9a505a2..f6db6cc5c9c4 100644
--- a/net/librespeed-go/Makefile
+++ b/net/librespeed-go/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	librespeed-go
 DISTVERSIONPREFIX=	v
 DISTVERSION=	1.1.5
-PORTREVISION=	9
+PORTREVISION=	10
 CATEGORIES=	net www
 
 MAINTAINER=	driesm@FreeBSD.org
@@ -12,6 +12,9 @@ LICENSE=	LGPL3
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
 USES=		go:modules
+USE_GITHUB=	nodefault
+GH_TUPLE=	golang:sys:v0.6.0:sys
+
 USE_RC_SUBR=	librespeed-go
 
 GO_MODULE=	github.com/librespeed/speedtest-go
@@ -26,6 +29,10 @@ PLIST_SUB=	LIBRESPEED_USER=${USERS} LIBRESPEED_GROUP=${GROUPS}
 
 OPTIONS_DEFINE=	EXAMPLES
 
+pre-patch:
+	${RM} -r ${WRKSRC}/vendor/golang.org/x/sys
+	${LN} -s ${WRKDIR}/sys-* ${WRKSRC}/vendor/golang.org/x/sys
+
 post-patch:
 	${REINPLACE_CMD} -e 's|"."|"${ETCDIR}"|g' ${WRKSRC}/config/config.go
 
diff --git a/net/librespeed-go/distinfo b/net/librespeed-go/distinfo
index eace8bd96abf..e099659b43d9 100644
--- a/net/librespeed-go/distinfo
+++ b/net/librespeed-go/distinfo
@@ -1,5 +1,7 @@
-TIMESTAMP = 1657306990
+TIMESTAMP = 1679324546
 SHA256 (go/net_librespeed-go/librespeed-go-v1.1.5/v1.1.5.mod) = aaaaa4b204e0b72fce3edc5b83d5180fa8e980a32f152b241f3600983763672f
 SIZE (go/net_librespeed-go/librespeed-go-v1.1.5/v1.1.5.mod) = 856
 SHA256 (go/net_librespeed-go/librespeed-go-v1.1.5/v1.1.5.zip) = b2640d3cc90f82a7656cfd7fe1d3c4edf560bcf7b83c13303245f7675a1c7850
 SIZE (go/net_librespeed-go/librespeed-go-v1.1.5/v1.1.5.zip) = 2293935
+SHA256 (go/net_librespeed-go/librespeed-go-v1.1.5/golang-sys-v0.6.0_GH0.tar.gz) = b4f6d17c7a128f76169964b437cb66b3f2dbf9a33361928ec19dfecf7b03fc54
+SIZE (go/net_librespeed-go/librespeed-go-v1.1.5/golang-sys-v0.6.0_GH0.tar.gz) = 1434234
diff --git a/net/librespeed-go/files/patch-go.mod b/net/librespeed-go/files/patch-go.mod
new file mode 100644
index 000000000000..17d5cb0c001b
--- /dev/null
+++ b/net/librespeed-go/files/patch-go.mod
@@ -0,0 +1,40 @@
+--- go.mod.orig	2023-03-20 15:04:13 UTC
++++ go.mod
+@@ -1,6 +1,6 @@
+ module github.com/librespeed/speedtest
+ 
+-go 1.16
++go 1.17
+ 
+ require (
+ 	github.com/breml/rootcerts v0.2.1
+@@ -16,10 +16,27 @@ require (
+ 	github.com/oklog/ulid/v2 v2.0.2
+ 	github.com/pires/go-proxyproto v0.6.1
+ 	github.com/sirupsen/logrus v1.8.1
+-	github.com/spf13/afero v1.8.0 // indirect
+ 	github.com/spf13/viper v1.10.1
+ 	github.com/umahmood/haversine v0.0.0-20151105152445-808ab04add26
+ 	go.etcd.io/bbolt v1.3.6
+ 	golang.org/x/image v0.0.0-20211028202545-6944b10bf410
+-	golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
++)
++
++require (
++	github.com/fsnotify/fsnotify v1.5.1 // indirect
++	github.com/hashicorp/hcl v1.0.0 // indirect
++	github.com/kr/pretty v0.2.0 // indirect
++	github.com/magiconair/properties v1.8.5 // indirect
++	github.com/mitchellh/mapstructure v1.4.3 // indirect
++	github.com/pelletier/go-toml v1.9.4 // indirect
++	github.com/spf13/afero v1.8.0 // indirect
++	github.com/spf13/cast v1.4.1 // indirect
++	github.com/spf13/jwalterweatherman v1.1.0 // indirect
++	github.com/spf13/pflag v1.0.5 // indirect
++	github.com/subosito/gotenv v1.2.0 // indirect
++	golang.org/x/sys v0.6.0 // indirect
++	golang.org/x/text v0.3.7 // indirect
++	gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
++	gopkg.in/ini.v1 v1.66.2 // indirect
++	gopkg.in/yaml.v2 v2.4.0 // indirect
+ )
diff --git a/net/librespeed-go/files/patch-go.sum b/net/librespeed-go/files/patch-go.sum
new file mode 100644
index 000000000000..e751a3c2e86b
--- /dev/null
+++ b/net/librespeed-go/files/patch-go.sum
@@ -0,0 +1,11 @@
+--- go.sum.orig	2023-03-20 15:04:16 UTC
++++ go.sum
+@@ -567,6 +567,8 @@ golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go
+ golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0=
+ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
++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.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
diff --git a/net/librespeed-go/files/patch-vendor_modules.txt b/net/librespeed-go/files/patch-vendor_modules.txt
new file mode 100644
index 000000000000..c629436d7d54
--- /dev/null
+++ b/net/librespeed-go/files/patch-vendor_modules.txt
@@ -0,0 +1,129 @@
+--- vendor/modules.txt.orig	2023-03-20 15:05:38 UTC
++++ vendor/modules.txt
+@@ -1,24 +1,25 @@
+ # github.com/breml/rootcerts v0.2.1
+-## explicit
++## explicit; go 1.15
+ github.com/breml/rootcerts
+ github.com/breml/rootcerts/embedded
+ # github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
+ ## explicit
+ github.com/coreos/go-systemd/activation
+ # github.com/fsnotify/fsnotify v1.5.1
++## explicit; go 1.13
+ github.com/fsnotify/fsnotify
+ # github.com/go-chi/chi/v5 v5.0.7
+-## explicit
++## explicit; go 1.14
+ github.com/go-chi/chi/v5
+ github.com/go-chi/chi/v5/middleware
+ # github.com/go-chi/cors v1.2.0
+-## explicit
++## explicit; go 1.14
+ github.com/go-chi/cors
+ # github.com/go-chi/render v1.0.1
+ ## explicit
+ github.com/go-chi/render
+ # github.com/go-sql-driver/mysql v1.6.0
+-## explicit
++## explicit; go 1.10
+ github.com/go-sql-driver/mysql
+ # github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
+ ## explicit
+@@ -32,6 +33,7 @@ github.com/gorilla/securecookie
+ ## explicit
+ github.com/gorilla/sessions
+ # github.com/hashicorp/hcl v1.0.0
++## explicit
+ github.com/hashicorp/hcl
+ github.com/hashicorp/hcl/hcl/ast
+ github.com/hashicorp/hcl/hcl/parser
+@@ -42,38 +44,46 @@ github.com/hashicorp/hcl/hcl/token
+ github.com/hashicorp/hcl/json/parser
+ github.com/hashicorp/hcl/json/scanner
+ github.com/hashicorp/hcl/json/token
++# github.com/kr/pretty v0.2.0
++## explicit; go 1.12
+ # github.com/lib/pq v1.10.4
+-## explicit
++## explicit; go 1.13
+ github.com/lib/pq
+ github.com/lib/pq/oid
+ github.com/lib/pq/scram
+ # github.com/magiconair/properties v1.8.5
++## explicit; go 1.13
+ github.com/magiconair/properties
+ # github.com/mitchellh/mapstructure v1.4.3
++## explicit; go 1.14
+ github.com/mitchellh/mapstructure
+ # github.com/oklog/ulid/v2 v2.0.2
+ ## explicit
+ github.com/oklog/ulid/v2
+ # github.com/pelletier/go-toml v1.9.4
++## explicit; go 1.12
+ github.com/pelletier/go-toml
+ # github.com/pires/go-proxyproto v0.6.1
+-## explicit
++## explicit; go 1.13
+ github.com/pires/go-proxyproto
+ # github.com/sirupsen/logrus v1.8.1
+-## explicit
++## explicit; go 1.13
+ github.com/sirupsen/logrus
+ # github.com/spf13/afero v1.8.0
+-## explicit
++## explicit; go 1.13
+ github.com/spf13/afero
+ github.com/spf13/afero/mem
+ # github.com/spf13/cast v1.4.1
++## explicit
+ github.com/spf13/cast
+ # github.com/spf13/jwalterweatherman v1.1.0
++## explicit
+ github.com/spf13/jwalterweatherman
+ # github.com/spf13/pflag v1.0.5
++## explicit; go 1.12
+ github.com/spf13/pflag
+ # github.com/spf13/viper v1.10.1
+-## explicit
++## explicit; go 1.17
+ github.com/spf13/viper
+ github.com/spf13/viper/internal/encoding
+ github.com/spf13/viper/internal/encoding/hcl
+@@ -81,26 +91,32 @@ github.com/spf13/viper/internal/encoding/json
+ github.com/spf13/viper/internal/encoding/toml
+ github.com/spf13/viper/internal/encoding/yaml
+ # github.com/subosito/gotenv v1.2.0
++## explicit
+ github.com/subosito/gotenv
+ # github.com/umahmood/haversine v0.0.0-20151105152445-808ab04add26
+ ## explicit
+ github.com/umahmood/haversine
+ # go.etcd.io/bbolt v1.3.6
+-## explicit
++## explicit; go 1.12
+ go.etcd.io/bbolt
+ # golang.org/x/image v0.0.0-20211028202545-6944b10bf410
+-## explicit
++## explicit; go 1.12
+ golang.org/x/image/font
+ golang.org/x/image/math/fixed
+-# golang.org/x/sys v0.0.0-20220114195835-da31bd327af9
+-## 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
+ # golang.org/x/text v0.3.7
++## explicit; go 1.17
+ golang.org/x/text/transform
+ golang.org/x/text/unicode/norm
++# gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15
++## explicit
+ # gopkg.in/ini.v1 v1.66.2
++## explicit
+ gopkg.in/ini.v1
+ # gopkg.in/yaml.v2 v2.4.0
++## explicit; go 1.15
+ gopkg.in/yaml.v2