git: 43ee001edccc - main - devel/hub: fix build on riscv64

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Tue, 21 Mar 2023 12:54:54 UTC
The branch main has been updated by fuz:

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

commit 43ee001edccc0f512b0fffd5b134aa45d9e953b5
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-03-17 17:06:34 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-03-21 12:53:48 +0000

    devel/hub: 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)
    Differential Revision: https://reviews.freebsd.org/D39153
---
 devel/hub/Makefile                       |  7 +++-
 devel/hub/distinfo                       |  4 ++-
 devel/hub/files/patch-go.mod             | 33 ++++++++++++++++++
 devel/hub/files/patch-go.sum             | 20 +++++++++++
 devel/hub/files/patch-vendor_modules.txt | 58 ++++++++++++++++++++++++++++++++
 5 files changed, 120 insertions(+), 2 deletions(-)

diff --git a/devel/hub/Makefile b/devel/hub/Makefile
index e4a5e13745f1..0adf7d89815a 100644
--- a/devel/hub/Makefile
+++ b/devel/hub/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	hub
 PORTVERSION=	2.14.2
 DISTVERSIONPREFIX=	v
-PORTREVISION=	11
+PORTREVISION=	12
 CATEGORIES=	devel sysutils
 
 MAINTAINER=	egypcio@FreeBSD.org
@@ -18,6 +18,7 @@ CPE_VENDOR=	${PORTNAME}_project
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	github
+GH_TUPLE=	golang:sys:v0.6.0:sys
 
 GO_PKGNAME=	github.com/github/hub
 
@@ -27,6 +28,10 @@ PLIST_FILES=	bin/hub \
 		share/fish/completions/hub.fish \
 		share/zsh/site-functions/_hub
 
+pre-patch:
+	${RM} -r ${WRKSRC}/vendor/golang.org/x/sys
+	${LN} -s ${WRKDIR}/sys-* ${WRKSRC}/vendor/golang.org/x/sys
+
 post-build:
 	(cd ${GO_WRKSRC} && \
 	  ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} install ${GO_BUILDFLAGS} ${GO_TARGET}/md2roff-bin)
diff --git a/devel/hub/distinfo b/devel/hub/distinfo
index 0f2df3a3d132..8160bd6c6fa7 100644
--- a/devel/hub/distinfo
+++ b/devel/hub/distinfo
@@ -1,3 +1,5 @@
-TIMESTAMP = 1583933007
+TIMESTAMP = 1679072305
 SHA256 (github-hub-v2.14.2_GH0.tar.gz) = e19e0fdfd1c69c401e1c24dd2d4ecf3fd9044aa4bd3f8d6fd942ed1b2b2ad21a
 SIZE (github-hub-v2.14.2_GH0.tar.gz) = 2080107
+SHA256 (golang-sys-v0.6.0_GH0.tar.gz) = b4f6d17c7a128f76169964b437cb66b3f2dbf9a33361928ec19dfecf7b03fc54
+SIZE (golang-sys-v0.6.0_GH0.tar.gz) = 1434234
diff --git a/devel/hub/files/patch-go.mod b/devel/hub/files/patch-go.mod
new file mode 100644
index 000000000000..eeee85c64783
--- /dev/null
+++ b/devel/hub/files/patch-go.mod
@@ -0,0 +1,33 @@
+--- go.mod.orig	2023-03-17 17:04:08 UTC
++++ go.mod
+@@ -1,21 +1,25 @@
+ module github.com/github/hub
+ 
+-go 1.11
++go 1.17
+ 
+ require (
+ 	github.com/BurntSushi/toml v0.3.0
+ 	github.com/atotto/clipboard v0.0.0-20171229224153-bc5958e1c833
+ 	github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869
+ 	github.com/kballard/go-shellquote v0.0.0-20170619183022-cd60e84ee657
+-	github.com/kr/pretty v0.0.0-20160823170715-cfb55aafdaf3 // indirect
+-	github.com/kr/text v0.0.0-20160504234017-7cafcd837844 // indirect
+ 	github.com/mattn/go-colorable v0.0.9
+ 	github.com/mattn/go-isatty v0.0.3
+ 	github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747
+ 	github.com/russross/blackfriday v0.0.0-20180526075726-670777b536d3
+-	github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95 // indirect
+ 	golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
+ 	golang.org/x/net v0.0.0-20191002035440-2ec189313ef0
+-	golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2 // indirect
+ 	gopkg.in/yaml.v2 v2.0.0-20190319135612-7b8349ac747c
++)
++
++require (
++	github.com/kr/pretty v0.0.0-20160823170715-cfb55aafdaf3 // indirect
++	github.com/kr/text v0.0.0-20160504234017-7cafcd837844 // indirect
++	github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95 // indirect
++	golang.org/x/sys v0.6.0 // indirect
++	golang.org/x/text v0.3.0 // indirect
+ )
diff --git a/devel/hub/files/patch-go.sum b/devel/hub/files/patch-go.sum
new file mode 100644
index 000000000000..829c639aa841
--- /dev/null
+++ b/devel/hub/files/patch-go.sum
@@ -0,0 +1,20 @@
+--- go.sum.orig	2023-03-17 17:04:11 UTC
++++ go.sum
+@@ -20,8 +20,6 @@ github.com/russross/blackfriday v0.0.0-20180526075726-
+ github.com/russross/blackfriday v0.0.0-20180526075726-670777b536d3/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
+ github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95 h1:/vdW8Cb7EXrkqWGufVMES1OH2sU9gKVb2n9/1y5NMBY=
+ github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
+-golang.org/x/crypto v0.0.0-20180127211104-1875d0a70c90 h1:DNyuYmiOz3AH2rGH1n4YsZUvxVhkeMvSs8s31jiWpm0=
+-golang.org/x/crypto v0.0.0-20180127211104-1875d0a70c90/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
+ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+ golang.org/x/net v0.0.0-20191002035440-2ec189313ef0 h1:2mqDk8w/o6UmeUCu5Qiq2y7iMf6anbx+YA8d1JFoFrs=
+@@ -29,6 +27,8 @@ golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go
+ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+ golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2 h1:T5DasATyLQfmbTpfEXx/IOL9vfjzW6up+ZDkmHvIf2s=
+ golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/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=
+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
diff --git a/devel/hub/files/patch-vendor_modules.txt b/devel/hub/files/patch-vendor_modules.txt
new file mode 100644
index 000000000000..9cf2b51179ac
--- /dev/null
+++ b/devel/hub/files/patch-vendor_modules.txt
@@ -0,0 +1,58 @@
+--- vendor/modules.txt.orig	2023-03-17 17:04:40 UTC
++++ vendor/modules.txt
+@@ -1,37 +1,54 @@
+ # github.com/BurntSushi/toml v0.3.0
++## explicit
+ github.com/BurntSushi/toml
+ # github.com/atotto/clipboard v0.0.0-20171229224153-bc5958e1c833
++## explicit
+ github.com/atotto/clipboard
+ # github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869
++## explicit
+ github.com/bmizerany/assert
+ # github.com/kballard/go-shellquote v0.0.0-20170619183022-cd60e84ee657
++## explicit
+ github.com/kballard/go-shellquote
+ # github.com/kr/pretty v0.0.0-20160823170715-cfb55aafdaf3
++## explicit
+ github.com/kr/pretty
+ # github.com/kr/text v0.0.0-20160504234017-7cafcd837844
++## explicit
+ github.com/kr/text
+ # github.com/mattn/go-colorable v0.0.9
++## explicit
+ github.com/mattn/go-colorable
+ # github.com/mattn/go-isatty v0.0.3
++## explicit
+ github.com/mattn/go-isatty
+ # github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747
++## explicit
+ github.com/mitchellh/go-homedir
+ # github.com/russross/blackfriday v0.0.0-20180526075726-670777b536d3
++## explicit
+ github.com/russross/blackfriday
+ # github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95
++## explicit
+ github.com/shurcooL/sanitized_anchor_name
+ # golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
++## explicit
+ golang.org/x/crypto/ssh/terminal
+ # golang.org/x/net v0.0.0-20191002035440-2ec189313ef0
++## explicit; go 1.11
+ golang.org/x/net/http/httpproxy
+ golang.org/x/net/idna
+-# golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2
++# 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.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
+ # gopkg.in/yaml.v2 v2.0.0-20190319135612-7b8349ac747c
++## explicit
+ gopkg.in/yaml.v2