Support loongarch.
diff --git a/PKGBUILD b/PKGBUILD
index fe0ca4c..efe5940 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@ pkgname=clash-meta
pkgver=1.16.0
pkgrel=4
pkgdesc="Another Clash Kernel by MetaCubeX"
-arch=("x86_64" 'aarch64')
+arch=("x86_64" 'aarch64' 'loong64')
url="https://github.com/MetaCubeX/Clash.Meta"
license=("GPL3")
depends=('glibc' 'clash-geoip')
@@ -16,16 +16,19 @@ source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz
"clash-meta@.service"
"${pkgname}.sysusers"
"${pkgname}.tmpfiles"
- "config.yaml")
+ "config.yaml"
+ "loong64.patch")
sha256sums=('037f926369ac9a0922801f1b0a8e2d79d454e67f6bc2a1e4ca7a52a0a8c641ea'
'b6b7ce11489a6f6322a41ce840b3f999b1ec88914f8bd6864c220269231bf759'
'ec4de877464e595124a5f2752c3f4be157adc85ec5f7f8392c0331cb70fc906a'
'655e8e2edcd82a6bdf2fd12430b7ab6f8e32db8dffce70e7342685a7cc65ebfb'
'50737592c7bd743fe8f543924034718337477a203fa11ef4272cae496df3769c'
- '90f7fdacecd5928e37865b4f841517f925c8bedc769f16f7a7a1e89b923f1fb9')
+ '90f7fdacecd5928e37865b4f841517f925c8bedc769f16f7a7a1e89b923f1fb9'
+ 'a1d56756c6756d4a1e5133ac5303d4b7a0de1bf1577767026016e81efee54b60')
build(){
cd "${srcdir}"/Clash.Meta-${pkgver}
+ patch -p1 < "${srcdir}/loong64.patch"
BUILDTIME=$(date -u)
GOOS=linux CGO_ENABLED=0 go build \
-trimpath \
diff --git a/loong64.patch b/loong64.patch
index e69de29..6e089c5 100644
--- a/loong64.patch
+++ b/loong64.patch
@@ -0,0 +1,36 @@
+diff --git a/component/ebpf/byteorder/byteorder_littleendian.go b/component/ebpf/byteorder/byteorder_littleendian.go
+index 216a5e5..d40f351 100644
+--- a/component/ebpf/byteorder/byteorder_littleendian.go
++++ b/component/ebpf/byteorder/byteorder_littleendian.go
+@@ -1,4 +1,4 @@
+-//go:build 386 || amd64 || amd64p32 || arm || arm64 || mips64le || mips64p32le || mipsle || ppc64le || riscv64
++//go:build 386 || amd64 || amd64p32 || arm || arm64 || mips64le || mips64p32le || mipsle || ppc64le || riscv64 || loong64
+
+ package byteorder
+
+diff --git a/component/ebpf/redir/bpf_bpfel.go b/component/ebpf/redir/bpf_bpfel.go
+index 936b84e..1fe3454 100644
+--- a/component/ebpf/redir/bpf_bpfel.go
++++ b/component/ebpf/redir/bpf_bpfel.go
+@@ -1,6 +1,6 @@
+ // Code generated by bpf2go; DO NOT EDIT.
+-//go:build 386 || amd64 || amd64p32 || arm || arm64 || mips64le || mips64p32le || mipsle || ppc64le || riscv64
+-// +build 386 amd64 amd64p32 arm arm64 mips64le mips64p32le mipsle ppc64le riscv64
++//go:build 386 || amd64 || amd64p32 || arm || arm64 || mips64le || mips64p32le || mipsle || ppc64le || riscv64 || loong64
++// +build 386 amd64 amd64p32 arm arm64 mips64le mips64p32le mipsle ppc64le riscv64 loong64
+
+ package redir
+
+diff --git a/component/ebpf/tc/bpf_bpfel.go b/component/ebpf/tc/bpf_bpfel.go
+index 07daba1..4cca0e1 100644
+--- a/component/ebpf/tc/bpf_bpfel.go
++++ b/component/ebpf/tc/bpf_bpfel.go
+@@ -1,6 +1,6 @@
+ // Code generated by bpf2go; DO NOT EDIT.
+-//go:build 386 || amd64 || amd64p32 || arm || arm64 || mips64le || mips64p32le || mipsle || ppc64le || riscv64
+-// +build 386 amd64 amd64p32 arm arm64 mips64le mips64p32le mipsle ppc64le riscv64
++//go:build 386 || amd64 || amd64p32 || arm || arm64 || mips64le || mips64p32le || mipsle || ppc64le || riscv64 || loong64
++// +build 386 amd64 amd64p32 arm arm64 mips64le mips64p32le mipsle ppc64le riscv64 loong64
+
+ package tc
+
Pinned Comments
sukanka commented on 2023-02-15 01:05 (UTC)
If you want use tun mode, add the following pacman hook.