Skip to content

Commit d9c9cc1

Browse files
addpkg: flclash
1 parent 596ad95 commit d9c9cc1

4 files changed

Lines changed: 170 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From a882bfadf9e75c8cea20759136503ede921e1ee1 Mon Sep 17 00:00:00 2001
2+
From: Dee HY <dongfengweixiao@hotmail.com>
3+
Date: Fri, 3 Apr 2026 13:41:47 +0800
4+
Subject: [PATCH] fix build error
5+
6+
---
7+
linux/CMakeLists.txt | 3 +++
8+
1 file changed, 3 insertions(+)
9+
10+
diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt
11+
index c419eea..c796bda 100644
12+
--- a/linux/CMakeLists.txt
13+
+++ b/linux/CMakeLists.txt
14+
@@ -44,6 +44,9 @@ function(APPLY_STANDARD_SETTINGS TARGET)
15+
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
16+
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
17+
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
18+
+ # FIXME: workaround for tray_manager deprecation issue:
19+
+ # https://github.com/leanflutter/tray_manager/issues/67
20+
+ target_compile_options(${TARGET} PRIVATE -Wno-error=deprecated-declarations) # Allow deprecated warnings
21+
endfunction()
22+
23+
# Flutter library and tool build rules.
24+
--
25+
2.53.0
26+

archlinuxcn/flclash/PKGBUILD

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Maintainer: Dee.H.Y <dongfengweixiao at hotmail dot com>
2+
# Contributor: Mark Wagie <mark dot wagie at proton dot me>
3+
# This repository is a fork of musicpod-git.
4+
# Before executing makepkg, you can set FVM_CACHE_PATH to $HOME/fvm or the path specified by the cachePath field in the $HOME/.config/fvm/.fvmrc file.
5+
6+
pkgname=flclash
7+
pkgver=0.8.92
8+
pkgrel=1
9+
pkgdesc="A multi-platform proxy client based on ClashMeta,simple and easy to use, open-source and ad-free."
10+
url="https://github.com/chen08209/FlClash"
11+
license=('GPL-3.0-or-later')
12+
arch=('x86_64' 'aarch64')
13+
depends=(
14+
'gtk3'
15+
'libayatana-appindicator'
16+
'libkeybinder3'
17+
)
18+
makedepends=(
19+
'clang'
20+
'cmake'
21+
'fvm'
22+
'git'
23+
'lld'
24+
'llvm'
25+
'ninja'
26+
'patchelf'
27+
'rustup'
28+
'go'
29+
'libayatana-appindicator'
30+
'libkeybinder3'
31+
'rsync'
32+
)
33+
34+
options=('!lto')
35+
36+
_pkgsrc="$pkgname-$pkgver"
37+
_pkgext="tar.gz"
38+
source=(
39+
"$_pkgsrc.$_pkgext"::"$url/archive/refs/tags/v$pkgver.$_pkgext"
40+
"0001-fix-build-error.patch"
41+
"com.follow.clash.desktop"
42+
"Clash.Meta"::"git+https://github.com/chen08209/Clash.Meta.git#branch=FlClash"
43+
"flutter_distributor"::"git+https://github.com/chen08209/flutter_distributor.git#branch=FlClash"
44+
"tray_manager"::"git+https://github.com/chen08209/tray_manager.git#branch=main"
45+
)
46+
sha256sums=('23cdecf4fc0c1f3a520df2c5f4a0cdc01b377c5485cb392b2d5ec9eb5b2cacc0'
47+
'b551c46a1577758c13bdd07868d41e4de817c6184114e1b10d39e04ae572a76a'
48+
'0601176d0b5df7aafb3c949417b7f0d98ab17d21b6fcc89c6f83a7e031bbe45d'
49+
'SKIP'
50+
'SKIP'
51+
'SKIP')
52+
53+
prepare() {
54+
patch -p1 -d "${srcdir}/FlClash-$pkgver" -i ${srcdir}/0001-fix-build-error.patch
55+
rsync -av "${srcdir}/Clash.Meta" "${srcdir}/FlClash-$pkgver/core/"
56+
rsync -av "${srcdir}/flutter_distributor" "${srcdir}/FlClash-$pkgver/plugins/"
57+
rsync -av "${srcdir}/tray_manager" "${srcdir}/FlClash-$pkgver/plugins/"
58+
}
59+
60+
build() {
61+
export FVM_CACHE_PATH="$SRCDEST/fvm-cache"
62+
63+
# build core
64+
cd "${srcdir}/FlClash-$pkgver/core/Clash.Meta"
65+
if [ "$CARCH" == "aarch64" ]; then
66+
export GOARCH=arm64
67+
else
68+
export GOARCH=amd64
69+
fi
70+
export GOOS=linux
71+
export CGO_ENABLED=0
72+
export TAGS="with_gvisor"
73+
go build -ldflags="-w -s" -tags="$TAGS" -o "${srcdir}/FlClash-$pkgver/libclash/linux/FlClashCore"
74+
75+
cd "${srcdir}/FlClash-$pkgver"
76+
fvm install 3.35.7
77+
fvm use 3.35.7
78+
79+
fvm flutter --disable-analytics
80+
#fvm flutter pub upgrade --major-versions
81+
fvm flutter --no-version-check pub get
82+
fvm flutter clean && fvm flutter build linux --release --dart-define=APP_ENV=stable
83+
}
84+
85+
package() {
86+
if [ $CARCH == "aarch64" ]; then
87+
FLUTTER_ARCH=arm64
88+
else
89+
FLUTTER_ARCH=x64
90+
fi
91+
92+
cd "${srcdir}/FlClash-$pkgver/build/linux/$FLUTTER_ARCH/release/bundle"
93+
94+
install -Dm755 "FlClash" "$pkgdir/usr/lib/$pkgname/FlClash"
95+
install -Dm755 "FlClashCore" "$pkgdir/usr/lib/$pkgname/FlClashCore"
96+
cp --reflink=auto -r lib/ "$pkgdir/usr/lib/$pkgname/"
97+
cp --reflink=auto -r data/ "$pkgdir/usr/lib/$pkgname/"
98+
# copy libquickjs_c_bridge_plugin.so
99+
cp --reflink=auto "../plugins/flutter_js/bundle/lib/libquickjs_c_bridge_plugin.so" "$pkgdir/usr/lib/$pkgname/lib/libquickjs_c_bridge_plugin.so"
100+
101+
# runpath
102+
patchelf --set-rpath '$ORIGIN/lib' "$pkgdir/usr/lib/$pkgname/FlClash"
103+
for i in "$pkgdir/usr/lib/$pkgname/lib"/*.so; do
104+
[ -z "$(patchelf --print-rpath "$i")" ] && continue
105+
patchelf --set-rpath '$ORIGIN' "$i"
106+
done
107+
108+
# symlink
109+
install -dm755 "${pkgdir}/usr/bin"
110+
ln -sfr "$pkgdir/usr/lib/$pkgname/FlClash" "$pkgdir/usr/bin/${pkgname}"
111+
112+
# icon
113+
install -Dm644 "$srcdir/FlClash-$pkgver/assets/images/icon.png" \
114+
"$pkgdir/usr/share/pixmaps/$pkgname.png"
115+
116+
# .desktop file
117+
install -Dm644 "$srcdir/com.follow.clash.desktop" "${pkgdir}/usr/share/applications/com.follow.clash.desktop"
118+
119+
# license
120+
install -Dm644 "${srcdir}/FlClash-$pkgver/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname/"
121+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=FlClash
4+
Categories=Network;
5+
GenericName=FlClash
6+
Icon=flclash
7+
Exec=flclash %U
8+
Categories=Network;
9+
Keywords=FlClash;Clash;ClashMeta;Proxy;
10+
StartupWMClass=com.follow.clash
11+
StartupNotify=true

archlinuxcn/flclash/lilac.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
maintainers:
2+
- github: DeeHY
3+
email: Dee.H.Y <dongfengweixiao at hotmail dot com>
4+
5+
pre_build_script: update_pkgver_and_pkgrel(_G.newver)
6+
post_build: git_pkgbuild_commit
7+
8+
update_on:
9+
- source: github
10+
github: chen08209/FlClash
11+
use_latest_release: true
12+
prefix: v

0 commit comments

Comments
 (0)