git: d27f21e397b8 - main - security/gitjacker: fix build on riscv64

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

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

commit d27f21e397b845cc4dec662951e8a5d0286a0b6e
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-03-20 17:07:21 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-03-22 20:15:21 +0000

    security/gitjacker: fix build on riscv64
    
    Bump golang.org/x/sys dependency to a version new enough
    to support riscv64-freebsd.  Remove thus obsoleted patch file.
    
    Sponsored by:   Berliner Linux User Group e.V.
    Approved by:    portmgr (build fix blanket)
---
 security/gitjacker/Makefile                        |  9 ++++-
 security/gitjacker/distinfo                        |  4 ++-
 security/gitjacker/files/patch-go.mod              | 26 ++++++++++++++
 security/gitjacker/files/patch-go.sum              | 31 ++++++++++++++++
 ...golang.org_x_sys_unix_ztypes__freebsd__arm64.go | 24 -------------
 security/gitjacker/files/patch-vendor_modules.txt  | 41 ++++++++++++++++++++++
 6 files changed, 109 insertions(+), 26 deletions(-)

diff --git a/security/gitjacker/Makefile b/security/gitjacker/Makefile
index a71be142f001..e2db4b4ab45c 100644
--- a/security/gitjacker/Makefile
+++ b/security/gitjacker/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	gitjacker
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.1.0
-PORTREVISION=	11
+PORTREVISION=	12
 CATEGORIES=	security
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -12,6 +12,9 @@ LICENSE=	PD
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
 USES=		cpe go:modules
+USE_GITHUB=	nodefault
+GH_TUPLE=	golang:sys:v0.6.0:sys
+
 CPE_VENDOR=	${PORTNAME}_project
 
 GO_MODULE=	github.com/liamg/gitjacker
@@ -19,4 +22,8 @@ GO_TARGET=	./cmd/${PORTNAME}
 
 PLIST_FILES=	bin/${PORTNAME}
 
+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/security/gitjacker/distinfo b/security/gitjacker/distinfo
index 6d6c6bfe902e..142fe431f3bf 100644
--- a/security/gitjacker/distinfo
+++ b/security/gitjacker/distinfo
@@ -1,5 +1,7 @@
-TIMESTAMP = 1620355103
+TIMESTAMP = 1679331476
 SHA256 (go/security_gitjacker/gitjacker-v0.1.0/v0.1.0.mod) = b3db6be3fc30d6f4246b98b62a9a1aaeeb4baf56813250be44bc31d1346faebf
 SIZE (go/security_gitjacker/gitjacker-v0.1.0/v0.1.0.mod) = 341
 SHA256 (go/security_gitjacker/gitjacker-v0.1.0/v0.1.0.zip) = 850de0ee593d0292c248275b1bd3aec2ec98f6336329aab516087544a1f345dc
 SIZE (go/security_gitjacker/gitjacker-v0.1.0/v0.1.0.zip) = 239095
+SHA256 (go/security_gitjacker/gitjacker-v0.1.0/golang-sys-v0.6.0_GH0.tar.gz) = b4f6d17c7a128f76169964b437cb66b3f2dbf9a33361928ec19dfecf7b03fc54
+SIZE (go/security_gitjacker/gitjacker-v0.1.0/golang-sys-v0.6.0_GH0.tar.gz) = 1434234
diff --git a/security/gitjacker/files/patch-go.mod b/security/gitjacker/files/patch-go.mod
new file mode 100644
index 000000000000..566d9ee805ec
--- /dev/null
+++ b/security/gitjacker/files/patch-go.mod
@@ -0,0 +1,26 @@
+--- go.mod.orig	2023-03-20 17:03:06 UTC
++++ go.mod
+@@ -1,15 +1,20 @@
+ module github.com/liamg/gitjacker
+ 
+-go 1.15
++go 1.17
+ 
+ require (
+ 	github.com/liamg/tml v0.3.0
+ 	github.com/magiconair/properties v1.8.0
+ 	github.com/sirupsen/logrus v1.2.0
+ 	github.com/spf13/cobra v1.0.0
++)
++
++require (
++	github.com/inconshreveable/mousetrap v1.0.0 // indirect
++	github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
++	github.com/spf13/pflag v1.0.3 // indirect
+ 	github.com/stretchr/testify v1.4.0 // indirect
+ 	golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect
+-	golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e // indirect
+-	gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
++	golang.org/x/sys v0.6.0 // indirect
+ 	gopkg.in/yaml.v2 v2.2.4 // indirect
+ )
diff --git a/security/gitjacker/files/patch-go.sum b/security/gitjacker/files/patch-go.sum
new file mode 100644
index 000000000000..8d7520bcbba3
--- /dev/null
+++ b/security/gitjacker/files/patch-go.sum
@@ -0,0 +1,31 @@
+--- go.sum.orig	2023-03-20 17:03:09 UTC
++++ go.sum
+@@ -48,10 +48,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWc
+ github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
+ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
+-github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
+ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+-github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
+ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+ github.com/liamg/tml v0.3.0 h1:Qz+R+E3BH07IgflYyB4dLijKZ+mZcKJEuC5pTNDWShc=
+ github.com/liamg/tml v0.3.0/go.mod h1:0h4EAV/zBOsqI91EWONedjRpO8O0itjGJVd+wG5eC+E=
+@@ -128,6 +126,8 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go
+ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e h1:D5TXcfTk7xF7hvieo4QErS3qqCB4teTffacDWr7CI+0=
+ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/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/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+ golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+@@ -140,8 +140,6 @@ google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15
+ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+-gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
+-gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
+ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
+ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/security/gitjacker/files/patch-vendor_golang.org_x_sys_unix_ztypes__freebsd__arm64.go b/security/gitjacker/files/patch-vendor_golang.org_x_sys_unix_ztypes__freebsd__arm64.go
deleted file mode 100644
index 0e0603b77cee..000000000000
--- a/security/gitjacker/files/patch-vendor_golang.org_x_sys_unix_ztypes__freebsd__arm64.go
+++ /dev/null
@@ -1,24 +0,0 @@
-From 33540a1f603772f9d4b761f416f5c10dade23e96 Mon Sep 17 00:00:00 2001
-From: Tobias Klauser <tklauser@distanz.ch>
-Date: Fri, 25 Oct 2019 21:13:51 +0200
-Subject: [PATCH] unix: don't use non-existing uint128 type on freebsd/arm64
-
-CL 179099 introduced type FpReg on freebsd, on freebsd/arm64 using a
-type uint128. This type doesn't exist in Go.
-
-Change-Id: Ie7f065f38f2cc2c163abdfa7dddad886b8edbe3b
-Reviewed-on: https://go-review.googlesource.com/c/sys/+/203419
-Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
-TryBot-Result: Gobot Gobot <gobot@golang.org>
-Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
---- vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go.orig	2019-08-18 13:42:05 UTC
-+++ vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go
-@@ -397,7 +397,7 @@ type Reg struct {
- }
- 
- type FpReg struct {
--	Fp_q  [32]uint128
-+	Fp_q  [512]uint8
- 	Fp_sr uint32
- 	Fp_cr uint32
- }
diff --git a/security/gitjacker/files/patch-vendor_modules.txt b/security/gitjacker/files/patch-vendor_modules.txt
new file mode 100644
index 000000000000..fdba1197dc71
--- /dev/null
+++ b/security/gitjacker/files/patch-vendor_modules.txt
@@ -0,0 +1,41 @@
+--- vendor/modules.txt.orig	2023-03-20 17:03:44 UTC
++++ vendor/modules.txt
+@@ -1,9 +1,11 @@
+ # github.com/inconshreveable/mousetrap v1.0.0
++## explicit
+ github.com/inconshreveable/mousetrap
+ # github.com/konsorten/go-windows-terminal-sequences v1.0.1
++## explicit
+ github.com/konsorten/go-windows-terminal-sequences
+ # github.com/liamg/tml v0.3.0
+-## explicit
++## explicit; go 1.12
+ github.com/liamg/tml
+ # github.com/magiconair/properties v1.8.0
+ ## explicit
+@@ -12,20 +14,20 @@ github.com/magiconair/properties/assert
+ ## explicit
+ github.com/sirupsen/logrus
+ # github.com/spf13/cobra v1.0.0
+-## explicit
++## explicit; go 1.12
+ github.com/spf13/cobra
+ # github.com/spf13/pflag v1.0.3
++## explicit
+ github.com/spf13/pflag
+ # github.com/stretchr/testify v1.4.0
+ ## explicit
+ # golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4
+ ## explicit
+ golang.org/x/crypto/ssh/terminal
+-# golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e
+-## 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
+-# gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15
+-## explicit
+ # gopkg.in/yaml.v2 v2.2.4
+ ## explicit