git: 9827d3f04956 - main - www/carbonapi: fix build on riscv64

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

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

commit 9827d3f04956d11cfb0483a2f71418b4793b7451
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-03-21 16:06:20 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-03-22 20:15:27 +0000

    www/carbonapi: 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)
---
 www/carbonapi/Makefile                       |   7 +-
 www/carbonapi/distinfo                       |   4 +-
 www/carbonapi/files/patch-go.mod             |  80 ++++++++++++
 www/carbonapi/files/patch-go.sum             |  11 ++
 www/carbonapi/files/patch-vendor_modules.txt | 180 +++++++++++++++++++++++++++
 5 files changed, 280 insertions(+), 2 deletions(-)

diff --git a/www/carbonapi/Makefile b/www/carbonapi/Makefile
index eb43b8ec7dda..6759518a6f85 100644
--- a/www/carbonapi/Makefile
+++ b/www/carbonapi/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	carbonapi
 DISTVERSION=	0.14.1
-PORTREVISION=	11
+PORTREVISION=	12
 CATEGORIES=	www
 
 MAINTAINER=	a.andersson.thn@gmail.com
@@ -14,6 +14,7 @@ USES=		go:modules
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	go-graphite
+GH_TUPLE=	golang:sys:v0.6.0:sys
 
 USE_RC_SUBR=	${PORTNAME}
 
@@ -34,6 +35,10 @@ CAIRO_LIB_DEPENDS=	libcairo.so:graphics/cairo
 CAIRO_USES=	pkgconfig
 CAIRO_VARS=	CARBON_ARGS="-tags cairo"
 
+pre-patch:
+	${RM} -r ${WRKSRC}/vendor/golang.org/x/sys
+	${LN} -s ${WRKDIR}/sys-* ${WRKSRC}/vendor/golang.org/x/sys
+
 post-install:
 	@${MKDIR} ${STAGEDIR}/var/log/carbonapi
 
diff --git a/www/carbonapi/distinfo b/www/carbonapi/distinfo
index 15e47084a466..6f86268957bc 100644
--- a/www/carbonapi/distinfo
+++ b/www/carbonapi/distinfo
@@ -1,3 +1,5 @@
-TIMESTAMP = 1601718887
+TIMESTAMP = 1679412432
 SHA256 (go-graphite-carbonapi-0.14.1_GH0.tar.gz) = 5f33a3aa8c9f8edfce8a26b358b6edf8c455f4156cf25e2a2399712d67282379
 SIZE (go-graphite-carbonapi-0.14.1_GH0.tar.gz) = 3485133
+SHA256 (golang-sys-v0.6.0_GH0.tar.gz) = b4f6d17c7a128f76169964b437cb66b3f2dbf9a33361928ec19dfecf7b03fc54
+SIZE (golang-sys-v0.6.0_GH0.tar.gz) = 1434234
diff --git a/www/carbonapi/files/patch-go.mod b/www/carbonapi/files/patch-go.mod
new file mode 100644
index 000000000000..a4f69e25d6b3
--- /dev/null
+++ b/www/carbonapi/files/patch-go.mod
@@ -0,0 +1,80 @@
+--- go.mod.orig	2023-03-21 15:50:06 UTC
++++ go.mod
+@@ -1,11 +1,10 @@
+ module github.com/go-graphite/carbonapi
+ 
+-go 1.14
++go 1.17
+ 
+ require (
+ 	bitbucket.org/tebeka/strftime v0.0.0-20140926081919-2194253a23c0
+ 	github.com/JaderDias/movingmedian v0.0.0-20170611140316-de8c410559fa
+-	github.com/aclements/go-moremath v0.0.0-20190830160640-d16893ddf098 // indirect
+ 	github.com/ansel1/merry v1.5.1
+ 	github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b
+ 	github.com/dgryski/go-expirecache v0.0.0-20170314133854-743ef98b2adb
+@@ -13,16 +12,8 @@ require (
+ 	github.com/dgryski/httputil v0.0.0-20160116060654-189c2918cd08
+ 	github.com/dustin/go-humanize v1.0.0
+ 	github.com/evmar/gocairo v0.0.0-20160222165215-ddd30f837497
+-	github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect
+-	github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
+-	github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c // indirect
+-	github.com/facebookgo/freeport v0.0.0-20150612182905-d4adf43b75b9 // indirect
+ 	github.com/facebookgo/grace v0.0.0-20180706040059-75cf19382434
+-	github.com/facebookgo/httpdown v0.0.0-20180706035922-5979d39b15c2 // indirect
+ 	github.com/facebookgo/pidfile v0.0.0-20150612191647-f242e2999868
+-	github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
+-	github.com/facebookgo/stats v0.0.0-20151006221625-1b76add642e4 // indirect
+-	github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 // indirect
+ 	github.com/go-graphite/protocol v0.4.3
+ 	github.com/golang/protobuf v1.4.0
+ 	github.com/gorilla/handlers v1.4.2
+@@ -32,7 +23,6 @@ require (
+ 	github.com/maruel/natural v0.0.0-20180416170133-dbcb3e2e8cf1
+ 	github.com/mjibson/go-dsp v0.0.0-20180508042940-11479a337f12
+ 	github.com/peterbourgon/g2g v0.0.0-20161124161852-0c2bab2b173d
+-	github.com/philhofer/fwd v1.0.0 // indirect
+ 	github.com/satori/go.uuid v1.2.0
+ 	github.com/spf13/viper v1.6.3
+ 	github.com/stretchr/testify v1.5.1
+@@ -42,4 +32,39 @@ require (
+ 	gonum.org/v1/gonum v0.7.0
+ 	google.golang.org/grpc v1.29.1
+ 	gopkg.in/yaml.v2 v2.2.8
++)
++
++require (
++	github.com/aclements/go-moremath v0.0.0-20190830160640-d16893ddf098 // indirect
++	github.com/davecgh/go-spew v1.1.1 // indirect
++	github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect
++	github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
++	github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c // indirect
++	github.com/facebookgo/freeport v0.0.0-20150612182905-d4adf43b75b9 // indirect
++	github.com/facebookgo/httpdown v0.0.0-20180706035922-5979d39b15c2 // indirect
++	github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
++	github.com/facebookgo/stats v0.0.0-20151006221625-1b76add642e4 // indirect
++	github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 // indirect
++	github.com/fsnotify/fsnotify v1.4.7 // indirect
++	github.com/gogo/protobuf v1.2.1 // indirect
++	github.com/hashicorp/hcl v1.0.0 // indirect
++	github.com/magiconair/properties v1.8.1 // indirect
++	github.com/mitchellh/mapstructure v1.1.2 // indirect
++	github.com/pelletier/go-toml v1.2.0 // indirect
++	github.com/philhofer/fwd v1.0.0 // indirect
++	github.com/pmezard/go-difflib v1.0.0 // indirect
++	github.com/spf13/afero v1.1.2 // indirect
++	github.com/spf13/cast v1.3.0 // indirect
++	github.com/spf13/jwalterweatherman v1.0.0 // indirect
++	github.com/spf13/pflag v1.0.3 // indirect
++	github.com/subosito/gotenv v1.2.0 // indirect
++	go.uber.org/atomic v1.6.0 // indirect
++	go.uber.org/multierr v1.5.0 // indirect
++	golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect
++	golang.org/x/sys v0.6.0 // indirect
++	golang.org/x/text v0.3.0 // indirect
++	golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
++	google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect
++	google.golang.org/protobuf v1.21.0 // indirect
++	gopkg.in/ini.v1 v1.51.0 // indirect
+ )
diff --git a/www/carbonapi/files/patch-go.sum b/www/carbonapi/files/patch-go.sum
new file mode 100644
index 000000000000..d0995bbf267f
--- /dev/null
+++ b/www/carbonapi/files/patch-go.sum
@@ -0,0 +1,11 @@
+--- go.sum.orig	2023-03-21 15:50:08 UTC
++++ go.sum
+@@ -252,6 +252,8 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go
+ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+ golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
+ golang.org/x/sys v0.0.0-20190412213103-97732733099d/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/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
+ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
diff --git a/www/carbonapi/files/patch-vendor_modules.txt b/www/carbonapi/files/patch-vendor_modules.txt
new file mode 100644
index 000000000000..e69a3bb5fcb8
--- /dev/null
+++ b/www/carbonapi/files/patch-vendor_modules.txt
@@ -0,0 +1,180 @@
+--- vendor/modules.txt.orig	2023-03-21 15:58:15 UTC
++++ vendor/modules.txt
+@@ -8,12 +8,13 @@ github.com/JaderDias/movingmedian
+ ## explicit
+ github.com/aclements/go-moremath/mathx
+ # github.com/ansel1/merry v1.5.1
+-## explicit
++## explicit; go 1.9
+ github.com/ansel1/merry
+ # github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b
+-## explicit
++## explicit; go 1.12
+ github.com/bradfitz/gomemcache/memcache
+ # github.com/davecgh/go-spew v1.1.1
++## explicit
+ github.com/davecgh/go-spew/spew
+ # github.com/dgryski/go-expirecache v0.0.0-20170314133854-743ef98b2adb
+ ## explicit
+@@ -58,6 +59,7 @@ github.com/facebookgo/stats
+ # github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4
+ ## explicit
+ # github.com/fsnotify/fsnotify v1.4.7
++## explicit
+ github.com/fsnotify/fsnotify
+ # github.com/go-graphite/protocol v0.4.3
+ ## explicit
+@@ -65,12 +67,13 @@ github.com/go-graphite/protocol/carbonapi_v2_pb
+ github.com/go-graphite/protocol/carbonapi_v3_grpc
+ github.com/go-graphite/protocol/carbonapi_v3_pb
+ # github.com/gogo/protobuf v1.2.1
++## explicit
+ github.com/gogo/protobuf/gogoproto
+ github.com/gogo/protobuf/proto
+ github.com/gogo/protobuf/protoc-gen-gogo/descriptor
+ github.com/gogo/protobuf/sortkeys
+ # github.com/golang/protobuf v1.4.0
+-## explicit
++## explicit; go 1.9
+ github.com/golang/protobuf/proto
+ github.com/golang/protobuf/ptypes
+ github.com/golang/protobuf/ptypes/any
+@@ -81,6 +84,7 @@ github.com/golang/protobuf/ptypes/timestamp
+ ## explicit
+ github.com/gorilla/handlers
+ # github.com/hashicorp/hcl v1.0.0
++## explicit
+ github.com/hashicorp/hcl
+ github.com/hashicorp/hcl/hcl/ast
+ github.com/hashicorp/hcl/hcl/parser
+@@ -103,17 +107,20 @@ github.com/lomik/og-rek
+ ## explicit
+ github.com/lomik/zapwriter
+ # github.com/magiconair/properties v1.8.1
++## explicit
+ github.com/magiconair/properties
+ # github.com/maruel/natural v0.0.0-20180416170133-dbcb3e2e8cf1
+ ## explicit
+ github.com/maruel/natural
+ # github.com/mitchellh/mapstructure v1.1.2
++## explicit
+ github.com/mitchellh/mapstructure
+ # github.com/mjibson/go-dsp v0.0.0-20180508042940-11479a337f12
+ ## explicit
+ github.com/mjibson/go-dsp/dsputils
+ github.com/mjibson/go-dsp/fft
+ # github.com/pelletier/go-toml v1.2.0
++## explicit
+ github.com/pelletier/go-toml
+ # github.com/peterbourgon/g2g v0.0.0-20161124161852-0c2bab2b173d
+ ## explicit
+@@ -122,26 +129,32 @@ github.com/peterbourgon/g2g
+ ## explicit
+ github.com/philhofer/fwd
+ # github.com/pmezard/go-difflib v1.0.0
++## explicit
+ github.com/pmezard/go-difflib/difflib
+ # github.com/satori/go.uuid v1.2.0
+ ## explicit
+ github.com/satori/go.uuid
+ # github.com/spf13/afero v1.1.2
++## explicit
+ github.com/spf13/afero
+ github.com/spf13/afero/mem
+ # github.com/spf13/cast v1.3.0
++## explicit
+ github.com/spf13/cast
+ # github.com/spf13/jwalterweatherman v1.0.0
++## explicit
+ github.com/spf13/jwalterweatherman
+ # github.com/spf13/pflag v1.0.3
++## explicit
+ github.com/spf13/pflag
+ # github.com/spf13/viper v1.6.3
+-## explicit
++## explicit; go 1.12
+ github.com/spf13/viper
+ # github.com/stretchr/testify v1.5.1
+-## explicit
++## explicit; go 1.13
+ github.com/stretchr/testify/assert
+ # github.com/subosito/gotenv v1.2.0
++## explicit
+ github.com/subosito/gotenv
+ # github.com/tinylib/msgp v1.1.2
+ ## explicit
+@@ -150,11 +163,13 @@ github.com/tinylib/msgp/msgp
+ ## explicit
+ github.com/wangjohn/quickselect
+ # go.uber.org/atomic v1.6.0
++## explicit; go 1.13
+ go.uber.org/atomic
+ # go.uber.org/multierr v1.5.0
++## explicit; go 1.12
+ go.uber.org/multierr
+ # go.uber.org/zap v1.15.0
+-## explicit
++## explicit; go 1.13
+ go.uber.org/zap
+ go.uber.org/zap/buffer
+ go.uber.org/zap/internal/bufferpool
+@@ -162,6 +177,7 @@ go.uber.org/zap/internal/color
+ go.uber.org/zap/internal/exit
+ go.uber.org/zap/zapcore
+ # golang.org/x/net v0.0.0-20190620200207-3b0461eec859
++## explicit; go 1.11
+ golang.org/x/net/context
+ golang.org/x/net/http/httpguts
+ golang.org/x/net/http2
+@@ -169,18 +185,21 @@ golang.org/x/net/http2/hpack
+ golang.org/x/net/idna
+ golang.org/x/net/internal/timeseries
+ golang.org/x/net/trace
+-# golang.org/x/sys v0.0.0-20190412213103-97732733099d
++# golang.org/x/sys v0.6.0
++## explicit; go 1.17
+ golang.org/x/sys/unix
+ # golang.org/x/text v0.3.0
++## explicit
+ golang.org/x/text/secure/bidirule
+ golang.org/x/text/transform
+ golang.org/x/text/unicode/bidi
+ golang.org/x/text/unicode/norm
+ # golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
++## explicit; go 1.11
+ golang.org/x/xerrors
+ golang.org/x/xerrors/internal
+ # gonum.org/v1/gonum v0.7.0
+-## explicit
++## explicit; go 1.13
+ gonum.org/v1/gonum/blas
+ gonum.org/v1/gonum/blas/blas64
+ gonum.org/v1/gonum/blas/cblas128
+@@ -197,9 +216,10 @@ gonum.org/v1/gonum/lapack/gonum
+ gonum.org/v1/gonum/lapack/lapack64
+ gonum.org/v1/gonum/mat
+ # google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55
++## explicit
+ google.golang.org/genproto/googleapis/rpc/status
+ # google.golang.org/grpc v1.29.1
+-## explicit
++## explicit; go 1.11
+ google.golang.org/grpc
+ google.golang.org/grpc/attributes
+ google.golang.org/grpc/backoff
+@@ -240,6 +260,7 @@ google.golang.org/grpc/stats
+ google.golang.org/grpc/status
+ google.golang.org/grpc/tap
+ # google.golang.org/protobuf v1.21.0
++## explicit; go 1.9
+ google.golang.org/protobuf/encoding/prototext
+ google.golang.org/protobuf/encoding/protowire
+ google.golang.org/protobuf/internal/descfmt
+@@ -272,6 +293,7 @@ google.golang.org/protobuf/types/known/durationpb
+ google.golang.org/protobuf/types/known/emptypb
+ google.golang.org/protobuf/types/known/timestamppb
+ # gopkg.in/ini.v1 v1.51.0
++## explicit
+ gopkg.in/ini.v1
+ # gopkg.in/yaml.v2 v2.2.8
+ ## explicit