Skip to content

Commit 9fd445e

Browse files
addpkg: flclash
1 parent 596ad95 commit 9fd445e

4 files changed

Lines changed: 162 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: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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+
)
32+
33+
options=('!lto')
34+
35+
_pkgsrc="$pkgname-$pkgver"
36+
_pkgext="tar.gz"
37+
source=(
38+
"${pkgname}"::"git+https://github.com/chen08209/FlClash.git#tag=v$pkgver"
39+
"0001-fix-build-error.patch"
40+
"com.follow.clash.desktop"
41+
)
42+
sha256sums=('aaf8c535929ecc642637334799f8396301fbc39a3ea25b2c9a8afdabf4a7e34d'
43+
'b551c46a1577758c13bdd07868d41e4de817c6184114e1b10d39e04ae572a76a'
44+
'0601176d0b5df7aafb3c949417b7f0d98ab17d21b6fcc89c6f83a7e031bbe45d')
45+
46+
prepare() {
47+
cd "$srcdir/$pkgname"
48+
git submodule update --init --recursive
49+
patch -p1 -i "${srcdir}/0001-fix-build-error.patch"
50+
}
51+
52+
build() {
53+
export FVM_CACHE_PATH="$SRCDEST/fvm-cache"
54+
55+
# build core
56+
cd "${srcdir}/flclash/core"
57+
if [ "$CARCH" == "aarch64" ]; then
58+
export GOARCH=arm64
59+
else
60+
export GOARCH=amd64
61+
fi
62+
export GOOS=linux
63+
export CGO_ENABLED=0
64+
export TAGS="with_gvisor"
65+
go build -ldflags="-w -s" -tags="$TAGS" -o "../libclash/linux/FlClashCore"
66+
67+
cd "${srcdir}/flclash"
68+
fvm install 3.35.7
69+
fvm use 3.35.7
70+
71+
fvm flutter --disable-analytics
72+
#fvm flutter pub upgrade --major-versions
73+
fvm flutter --no-version-check pub get
74+
fvm flutter clean && fvm flutter build linux --release --dart-define=APP_ENV=stable
75+
}
76+
77+
package() {
78+
if [ $CARCH == "aarch64" ]; then
79+
FLUTTER_ARCH=arm64
80+
else
81+
FLUTTER_ARCH=x64
82+
fi
83+
84+
cd "${srcdir}/flclash/build/linux/$FLUTTER_ARCH/release/bundle"
85+
86+
install -Dm755 "FlClash" "$pkgdir/usr/lib/$pkgname/FlClash"
87+
install -Dm755 "FlClashCore" "$pkgdir/usr/lib/$pkgname/FlClashCore"
88+
cp --reflink=auto -r lib/ "$pkgdir/usr/lib/$pkgname/"
89+
cp --reflink=auto -r data/ "$pkgdir/usr/lib/$pkgname/"
90+
# copy libquickjs_c_bridge_plugin.so
91+
cp --reflink=auto "../plugins/flutter_js/bundle/lib/libquickjs_c_bridge_plugin.so" "$pkgdir/usr/lib/$pkgname/lib/libquickjs_c_bridge_plugin.so"
92+
93+
# runpath
94+
patchelf --set-rpath '$ORIGIN/lib' "$pkgdir/usr/lib/$pkgname/FlClash"
95+
for i in "$pkgdir/usr/lib/$pkgname/lib"/*.so; do
96+
[ -z "$(patchelf --print-rpath "$i")" ] && continue
97+
patchelf --set-rpath '$ORIGIN' "$i"
98+
done
99+
100+
# symlink
101+
install -dm755 "${pkgdir}/usr/bin"
102+
ln -sfr "$pkgdir/usr/lib/$pkgname/FlClash" "$pkgdir/usr/bin/${pkgname}"
103+
104+
# icon
105+
install -Dm644 "$srcdir/flclash/assets/images/icon.png" \
106+
"$pkgdir/usr/share/pixmaps/$pkgname.png"
107+
108+
# .desktop file
109+
install -Dm644 "$srcdir/com.follow.clash.desktop" "${pkgdir}/usr/share/applications/com.follow.clash.desktop"
110+
111+
# license
112+
install -Dm644 "${srcdir}/flclash/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname/"
113+
}
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)