summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsukanka2022-09-05 16:43:36 +0800
committersukanka2022-09-05 16:43:36 +0800
commitf2195052bb405252b63f2b5da729c50d3846677a (patch)
tree83d7a1061fdb96aaa15669df5bed775641423fd3
parent8609dd24216be946fb013699b4326b68f68dbc80 (diff)
downloadaur-f2195052bb405252b63f2b5da729c50d3846677a.tar.gz
add support for clash-meta
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD8
-rw-r--r--cfw-start-pre.sh2
-rw-r--r--clash-for-windows-bin.install11
4 files changed, 18 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 661445903ecc..28859ed0affc 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = clash-for-windows-electron-bin
pkgdesc = A Windows/macOS/Linux GUI based on Clash and Electron. Using system clash and electron
pkgver = 0.19.29
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/Fndroid/clash_for_windows_pkg
install = clash-for-windows-bin.install
arch = x86_64
@@ -10,11 +10,11 @@ pkgbase = clash-for-windows-electron-bin
makedepends = asar
makedepends = npm
depends = electron
- depends = clash
depends = clash-geoip
optdepends = nftables: TUN mode required.
optdepends = iproute2: TUN mode required.
- optdepends = clash-premium-bin: TUN mode required
+ optdepends = clash-premium-bin: clash core
+ optdepends = clash-meta: clash core
provides = clash-for-windows
provides = clash-for-windows-electron
conflicts = clash-for-windows
@@ -25,7 +25,7 @@ pkgbase = clash-for-windows-electron-bin
source = clash-core-service@.service
sha256sums = 9a84b05b718913d3d1fbe462a2da671abff2cb94bb2ded75a3af12204cebe32f
sha256sums = db2e160e5d5cf82ed69d0926ac51c0eccb9efc541f89be3bb467d85be509f735
- sha256sums = 823a44d0440750411a3f33dd052d11571cbe9afb4067e985839637e92f8af6a4
+ sha256sums = 2d1cb05f33eef51d01bca397ac52796a557b812b243f0d5e5377f7640e4d4433
sha256sums = d55c2f4088505116a5bad6d09f5ebe232e7c6a269ea6bf46daada02bc3a9f961
source_x86_64 = clash-for-windows-electron-bin-0.19.29-x86_64-linux.tar.gz::https://github.com/Fndroid/clash_for_windows_pkg/releases/download/0.19.29/Clash.for.Windows-0.19.29-x64-linux.tar.gz
sha256sums_x86_64 = 202c3d6411b38c5fe53cea9361f4dac1c4dc88d1826cd9d647ed637a3651e9b4
diff --git a/PKGBUILD b/PKGBUILD
index 8e9cdd3f9459..e958b0431be9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=clash-for-windows-electron-bin
_pkgname=${pkgname%-bin}
pkgver=0.19.29
-pkgrel=2
+pkgrel=3
pkgdesc="A Windows/macOS/Linux GUI based on Clash and Electron. Using system clash and electron"
arch=("x86_64" "aarch64")
license=('unknown')
@@ -11,13 +11,13 @@ install=clash-for-windows-bin.install
provides=('clash-for-windows' ${_pkgname})
conflicts=('clash-for-windows' 'clash-for-windows-bin')
depends=('electron'
-'clash'
'clash-geoip'
)
optdepends=(
'nftables: TUN mode required.'
'iproute2: TUN mode required.'
- 'clash-premium-bin: TUN mode required'
+ 'clash-premium-bin: clash core'
+ 'clash-meta: clash core'
)
makedepends=('asar' 'npm')
source_x86_64=("${pkgname}-${pkgver}-x86_64-linux.tar.gz::${url}/releases/download/${pkgver}/Clash.for.Windows-${pkgver}-x64-linux.tar.gz")
@@ -29,7 +29,7 @@ source=(
"clash-core-service@.service")
sha256sums=('9a84b05b718913d3d1fbe462a2da671abff2cb94bb2ded75a3af12204cebe32f'
'db2e160e5d5cf82ed69d0926ac51c0eccb9efc541f89be3bb467d85be509f735'
- '823a44d0440750411a3f33dd052d11571cbe9afb4067e985839637e92f8af6a4'
+ '2d1cb05f33eef51d01bca397ac52796a557b812b243f0d5e5377f7640e4d4433'
'd55c2f4088505116a5bad6d09f5ebe232e7c6a269ea6bf46daada02bc3a9f961')
sha256sums_x86_64=('202c3d6411b38c5fe53cea9361f4dac1c4dc88d1826cd9d647ed637a3651e9b4')
sha256sums_aarch64=('747e07d30a2794319f7a8528c97608e7d8e69566aacc4a5f343c3222ec130c8d')
diff --git a/cfw-start-pre.sh b/cfw-start-pre.sh
index 36eaf9b24541..7c0a4f372598 100644
--- a/cfw-start-pre.sh
+++ b/cfw-start-pre.sh
@@ -4,5 +4,3 @@ install -Dm644 -o $1 -g $1 /etc/clash/Country.mmdb -t "/home/$1/.config/clash"
install -Dm755 -o $1 -g $1 \
"/opt/clash-for-windows/static/files/linux/${_parch}/service/clash-core-service" \
-t "/home/$1/.config/clash/service"
-
-setcap cap_net_admin,cap_net_bind_service=ep /usr/bin/clash
diff --git a/clash-for-windows-bin.install b/clash-for-windows-bin.install
index 9eb6900eee79..75ac5dbf72ce 100644
--- a/clash-for-windows-bin.install
+++ b/clash-for-windows-bin.install
@@ -1,11 +1,20 @@
post_install() {
echo 'Clash for Windows has it own built-in autostart since 0.18.1.'
echo 'Enable it will create .desktop file under $HOME/.config/autostart/'
+
+ _parch=$(uname -m | sed "s/x86_64/x64/;s/aarch64/arm64/")
+ echo -e "\033[32m If you want to use clash-meta, install it and run \033[0m"
+ echo -e "\033[32m sudo ln -sf /usr/bin/clash-meta /opt/clash-for-windows/static/files/linux/${_parch}/clash-linux \033[0m\n"
echo -e "\033[32m To use the TUN mode, you need to run \033[0m"
echo -e "\033[32m sudo systemctl start clash-core-service@\$USER \033[0m"
echo -e "\033[32m sudo systemctl enable clash-core-service@\$USER \033[0m"
- setcap cap_net_admin,cap_net_bind_service=ep /usr/bin/clash
+ for clsh in {clash,clash-meta};
+ do
+ if [ -z /usr/bin/$clsh ]; then
+ setcap cap_net_admin,cap_net_bind_service=ep /usr/bin/$clsh
+ fi
+ done
}
post_upgrade(){
post_install