Skip to content

Commit 76788a2

Browse files
qiangxuhuiptrcnull
authored andcommitted
community/termshark: backport patch to support loongarch64
Upstream: - gcla/termshark#166 - gcla/termshark@0ffde9f
1 parent a603a4b commit 76788a2

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

community/termshark/APKBUILD

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ arch="all !armhf" # no tshark on armhf
1010
depends="tshark"
1111
makedepends="go"
1212
options="net"
13-
source="$pkgname-$pkgver.tar.gz::https://github.com/gcla/termshark/archive/v$pkgver.tar.gz"
13+
source="$pkgname-$pkgver.tar.gz::https://github.com/gcla/termshark/archive/v$pkgver.tar.gz
14+
loongarch64-support.patch"
1415

1516
export GOFLAGS="$GOFLAGS -trimpath -mod=readonly -modcacherw"
1617
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
@@ -33,4 +34,5 @@ package() {
3334

3435
sha512sums="
3536
378bb67ff50a8dfa80f614540371f326627e73bdf63bceb183ed73afbbf9dead4e0597fb969ba49c4ee3d3de00ac7bb91166421c19c788df47ff8d9fcbc5b9fc termshark-2.4.0.tar.gz
37+
21080967cf59878cb2c86e815faaec481bbe48bcbf1bc9de2ef9755d2e12e76c481493835697a720af7e43ad9417b7da63d92ae62a2aad2e9c5f9222994f65f6 loongarch64-support.patch
3638
"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
diff --git a/go.mod b/go.mod
2+
index 176b1d0..64ae1b6 100644
3+
--- a/go.mod
4+
+++ b/go.mod
5+
@@ -7,6 +7,7 @@ require (
6+
github.com/antchfx/xmlquery v1.3.3
7+
github.com/antchfx/xpath v1.1.11 // indirect
8+
github.com/blang/semver v3.5.1+incompatible
9+
+ github.com/creack/pty v1.1.21 // indirect
10+
github.com/flytam/filenamify v1.1.0
11+
github.com/gcla/deep v1.0.2
12+
github.com/gcla/gowid v1.4.0
13+
diff --git a/go.sum b/go.sum
14+
index 928c074..41936b4 100644
15+
--- a/go.sum
16+
+++ b/go.sum
17+
@@ -116,6 +116,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr
18+
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
19+
github.com/creack/pty v1.1.15 h1:cKRCLMj3Ddm54bKSpemfQ8AtYFBhAI2MPmdys22fBdc=
20+
github.com/creack/pty v1.1.15/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
21+
+github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0=
22+
+github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
23+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
24+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
25+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
26+
diff --git a/pkg/system/dup.go b/pkg/system/dup.go
27+
index 4fee401..8270f05 100644
28+
--- a/pkg/system/dup.go
29+
+++ b/pkg/system/dup.go
30+
@@ -5,6 +5,7 @@
31+
// +build !windows
32+
// +build !linux !arm64
33+
// +build !linux !riscv64
34+
+// +build !linux !loong64
35+
36+
package system
37+
38+
diff --git a/pkg/system/dup_linux_loong64.go b/pkg/system/dup_linux_loong64.go
39+
new file mode 100644
40+
index 0000000..74d633e
41+
--- /dev/null
42+
+++ b/pkg/system/dup_linux_loong64.go
43+
@@ -0,0 +1,11 @@
44+
+// Copyright 2019-2022 Graham Clark. All rights reserved. Use of this source
45+
+// code is governed by the MIT license that can be found in the LICENSE
46+
+// file.
47+
+
48+
+package system
49+
+
50+
+import "syscall"
51+
+
52+
+func Dup2(fd int, fd2 int) error {
53+
+ return syscall.Dup3(fd, fd2, 0)
54+
+}

0 commit comments

Comments
 (0)