git: 46d9a6db21a5 - main - net-mgmt/unbound_exporter: fix build on riscv64

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Fri, 24 Mar 2023 20:56:51 UTC
The branch main has been updated by fuz:

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

commit 46d9a6db21a513c6db55b14a3bbfc36fcf56bc8e
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-03-23 10:16:36 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-03-24 20:54:50 +0000

    net-mgmt/unbound_exporter: 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-mgmt/unbound_exporter/Makefile                 | 10 +++-
 net-mgmt/unbound_exporter/distinfo                 |  4 +-
 net-mgmt/unbound_exporter/files/patch-go.mod       | 31 ++++++++++
 net-mgmt/unbound_exporter/files/patch-go.sum       | 11 ++++
 .../files/patch-vendor_modules.txt                 | 70 ++++++++++++++++++++++
 5 files changed, 123 insertions(+), 3 deletions(-)

diff --git a/net-mgmt/unbound_exporter/Makefile b/net-mgmt/unbound_exporter/Makefile
index a94412720c69..e10a7bd3dc46 100644
--- a/net-mgmt/unbound_exporter/Makefile
+++ b/net-mgmt/unbound_exporter/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=		unbound_exporter
-PORTVERSION=		0.4.1
-PORTREVISION=	4
 DISTVERSIONPREFIX=	v
+DISTVERSION=		0.4.1
+PORTREVISION=		5
 CATEGORIES=		net-mgmt
 
 MAINTAINER=		aduitsis@cpan.org
@@ -11,6 +11,8 @@ WWW=			https://github.com/letsencrypt/unbound_exporter
 LICENSE=		APACHE20
 
 USES=			go:modules
+USE_GITHUB=		nodefault
+GH_TUPLE=		golang:sys:v0.6.0:sys
 USE_RC_SUBR=		unbound_exporter
 GO_MODULE=		github.com/letsencrypt/unbound_exporter
 
@@ -22,4 +24,8 @@ GROUPS=			unbound
 
 PLIST_FILES=		bin/unbound_exporter
 
+pre-patch:
+	${RM} -r ${WRKSRC}/vendor/golang.org/x/sys
+	${LN} -s ${WRKDIR}/sys-* ${WRKSRC}/vendor/golang.org/x/sys
+
 .include <bsd.port.mk>
diff --git a/net-mgmt/unbound_exporter/distinfo b/net-mgmt/unbound_exporter/distinfo
index 6db3e95be3f9..779a56468a72 100644
--- a/net-mgmt/unbound_exporter/distinfo
+++ b/net-mgmt/unbound_exporter/distinfo
@@ -1,5 +1,7 @@
-TIMESTAMP = 1667511702
+TIMESTAMP = 1679566149
 SHA256 (go/net-mgmt_unbound_exporter/unbound_exporter-v0.4.1/v0.4.1.mod) = 1bd03db78e5d0be6f7e91fdb7f1c689c811529a74c0e7988ed1e13bf63fff2dd
 SIZE (go/net-mgmt_unbound_exporter/unbound_exporter-v0.4.1/v0.4.1.mod) = 485
 SHA256 (go/net-mgmt_unbound_exporter/unbound_exporter-v0.4.1/v0.4.1.zip) = 596d8f658e7f8a67ea2a5e36566a664168641fa5e793a170032df30a7c2d1092
 SIZE (go/net-mgmt_unbound_exporter/unbound_exporter-v0.4.1/v0.4.1.zip) = 28044
+SHA256 (go/net-mgmt_unbound_exporter/unbound_exporter-v0.4.1/golang-sys-v0.6.0_GH0.tar.gz) = b4f6d17c7a128f76169964b437cb66b3f2dbf9a33361928ec19dfecf7b03fc54
+SIZE (go/net-mgmt_unbound_exporter/unbound_exporter-v0.4.1/golang-sys-v0.6.0_GH0.tar.gz) = 1434234
diff --git a/net-mgmt/unbound_exporter/files/patch-go.mod b/net-mgmt/unbound_exporter/files/patch-go.mod
new file mode 100644
index 000000000000..8e42c72fab48
--- /dev/null
+++ b/net-mgmt/unbound_exporter/files/patch-go.mod
@@ -0,0 +1,31 @@
+--- go.mod.orig	2023-03-23 10:12:21 UTC
++++ go.mod
+@@ -1,15 +1,23 @@
+ module github.com/letsencrypt/unbound_exporter
+ 
+-go 1.16
++go 1.17
+ 
+ require (
+-	github.com/cespare/xxhash/v2 v2.1.2 // indirect
+ 	github.com/go-kit/log v0.2.0
+-	github.com/golang/protobuf v1.5.2 // indirect
+-	github.com/google/go-cmp v0.5.6 // indirect
+ 	github.com/prometheus/client_golang v1.11.0
+ 	github.com/prometheus/common v0.32.1
++)
++
++require (
++	github.com/beorn7/perks v1.0.1 // indirect
++	github.com/cespare/xxhash/v2 v2.1.2 // indirect
++	github.com/go-logfmt/logfmt v0.5.1 // indirect
++	github.com/golang/protobuf v1.5.2 // indirect
++	github.com/google/go-cmp v0.5.6 // indirect
++	github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
++	github.com/pkg/errors v0.9.1 // indirect
++	github.com/prometheus/client_model v0.2.0 // indirect
+ 	github.com/prometheus/procfs v0.7.3 // indirect
+-	golang.org/x/sys v0.0.0-20211112193437-faf0a1b62c6b // indirect
++	golang.org/x/sys v0.6.0 // indirect
+ 	google.golang.org/protobuf v1.27.1 // indirect
+ )
diff --git a/net-mgmt/unbound_exporter/files/patch-go.sum b/net-mgmt/unbound_exporter/files/patch-go.sum
new file mode 100644
index 000000000000..ecb9e1e9a659
--- /dev/null
+++ b/net-mgmt/unbound_exporter/files/patch-go.sum
@@ -0,0 +1,11 @@
+--- go.sum.orig	2023-03-23 10:12:24 UTC
++++ go.sum
+@@ -312,6 +312,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go
+ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+ golang.org/x/sys v0.0.0-20211112193437-faf0a1b62c6b h1:uo+9AuR+gDt/gdj+1BaLhdOHsaGI6YU6585IiDcLrFE=
+ golang.org/x/sys v0.0.0-20211112193437-faf0a1b62c6b/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-mgmt/unbound_exporter/files/patch-vendor_modules.txt b/net-mgmt/unbound_exporter/files/patch-vendor_modules.txt
new file mode 100644
index 000000000000..da7166da9325
--- /dev/null
+++ b/net-mgmt/unbound_exporter/files/patch-vendor_modules.txt
@@ -0,0 +1,70 @@
+--- vendor/modules.txt.orig	2023-03-23 10:12:52 UTC
++++ vendor/modules.txt
+@@ -1,52 +1,57 @@
+ # github.com/beorn7/perks v1.0.1
++## explicit; go 1.11
+ github.com/beorn7/perks/quantile
+ # github.com/cespare/xxhash/v2 v2.1.2
+-## explicit
++## explicit; go 1.11
+ github.com/cespare/xxhash/v2
+ # github.com/go-kit/log v0.2.0
+-## explicit
++## explicit; go 1.17
+ github.com/go-kit/log
+ github.com/go-kit/log/level
+ # github.com/go-logfmt/logfmt v0.5.1
++## explicit; go 1.17
+ github.com/go-logfmt/logfmt
+ # github.com/golang/protobuf v1.5.2
+-## explicit
++## explicit; go 1.9
+ github.com/golang/protobuf/proto
+ github.com/golang/protobuf/ptypes
+ github.com/golang/protobuf/ptypes/any
+ github.com/golang/protobuf/ptypes/duration
+ github.com/golang/protobuf/ptypes/timestamp
+ # github.com/google/go-cmp v0.5.6
+-## explicit
++## explicit; go 1.8
+ # github.com/matttproud/golang_protobuf_extensions v1.0.1
++## explicit
+ github.com/matttproud/golang_protobuf_extensions/pbutil
+ # github.com/pkg/errors v0.9.1
++## explicit
+ github.com/pkg/errors
+ # github.com/prometheus/client_golang v1.11.0
+-## explicit
++## explicit; go 1.13
+ github.com/prometheus/client_golang/prometheus
+ github.com/prometheus/client_golang/prometheus/internal
+ github.com/prometheus/client_golang/prometheus/promhttp
+ # github.com/prometheus/client_model v0.2.0
++## explicit; go 1.9
+ github.com/prometheus/client_model/go
+ # github.com/prometheus/common v0.32.1
+-## explicit
++## explicit; go 1.13
+ github.com/prometheus/common/expfmt
+ github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
+ github.com/prometheus/common/model
+ github.com/prometheus/common/promlog
+ # github.com/prometheus/procfs v0.7.3
+-## explicit
++## explicit; go 1.13
+ github.com/prometheus/procfs
+ github.com/prometheus/procfs/internal/fs
+ github.com/prometheus/procfs/internal/util
+-# golang.org/x/sys v0.0.0-20211112193437-faf0a1b62c6b
+-## 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
+ # google.golang.org/protobuf v1.27.1
+-## explicit
++## explicit; go 1.9
+ google.golang.org/protobuf/encoding/prototext
+ google.golang.org/protobuf/encoding/protowire
+ google.golang.org/protobuf/internal/descfmt