Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions archlinuxcn/flclash/0001-fix-build-error.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From a882bfadf9e75c8cea20759136503ede921e1ee1 Mon Sep 17 00:00:00 2001
From: Dee HY <dongfengweixiao@hotmail.com>
Date: Fri, 3 Apr 2026 13:41:47 +0800
Subject: [PATCH] fix build error

---
linux/CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)

diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt
index c419eea..c796bda 100644
--- a/linux/CMakeLists.txt
+++ b/linux/CMakeLists.txt
@@ -44,6 +44,9 @@ function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
+ # FIXME: workaround for tray_manager deprecation issue:
+ # https://github.com/leanflutter/tray_manager/issues/67
+ target_compile_options(${TARGET} PRIVATE -Wno-error=deprecated-declarations) # Allow deprecated warnings
endfunction()

# Flutter library and tool build rules.
--
2.53.0

141 changes: 141 additions & 0 deletions archlinuxcn/flclash/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Maintainer: Dee.H.Y <dongfengweixiao at hotmail dot com>
# Contributor: Mark Wagie <mark dot wagie at proton dot me>
# This repository is a fork of musicpod-git.
# 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.

pkgname=flclash
pkgver=0.8.92
pkgrel=1
pkgdesc="A multi-platform proxy client based on ClashMeta,simple and easy to use, open-source and ad-free."
url="https://github.com/chen08209/FlClash"
license=('GPL-3.0-or-later')
arch=('x86_64' 'aarch64')
depends=(
'at-spi2-core'
'cairo'
'fontconfig'
'glib2'
'glibc'
'gtk3'
'libayatana-appindicator'
'libepoxy'
'libgcc'
'libkeybinder3'
'libstdc++'
'pango'
)
makedepends=(
'clang'
'cmake'
'fvm'
'git'
'lld'
'llvm'
'ninja'
'patchelf'
'rustup'
'go'
'libayatana-appindicator'
'libkeybinder3'
)

options=('!lto')

_pkgsrc="$pkgname-$pkgver"
_pkgext="tar.gz"
source=(
"${pkgname}"::"git+https://github.com/chen08209/FlClash.git#tag=v$pkgver"
"0001-fix-build-error.patch"
"com.follow.clash.desktop"
"Clash.Meta::git+https://github.com/chen08209/Clash.Meta.git#branch=FlClash"
Comment thread
RocketMaDev marked this conversation as resolved.
Outdated
"flutter_distributor::git+https://github.com/chen08209/flutter_distributor.git#branch=FlClash"
"tray_manager::git+https://github.com/chen08209/tray_manager.git#branch=main"

)
sha256sums=('aaf8c535929ecc642637334799f8396301fbc39a3ea25b2c9a8afdabf4a7e34d'
'b551c46a1577758c13bdd07868d41e4de817c6184114e1b10d39e04ae572a76a'
'0601176d0b5df7aafb3c949417b7f0d98ab17d21b6fcc89c6f83a7e031bbe45d'
'SKIP'
'SKIP'
'SKIP')

prepare() {
cd "$srcdir/$pkgname"

git submodule init
git submodule set-url core/Clash.Meta "$srcdir/Clash.Meta"
git submodule set-url plugins/flutter_distributor "$srcdir/flutter_distributor"
git submodule set-url plugins/tray_manager "$srcdir/tray_manager"
git -c protocol.file.allow=always submodule update

patch -p1 -i "${srcdir}/0001-fix-build-error.patch"

# go mod download
cd "$srcdir/$pkgname/core"
export GOPATH="${srcdir}"
go mod download -modcacherw
}

build() {
export FVM_CACHE_PATH="$SRCDEST/fvm-cache"

# build core
cd "$srcdir/$pkgname/core"
if [ "$CARCH" == "aarch64" ]; then
export GOARCH=arm64
else
export GOARCH=amd64
fi
export GOOS=linux
export CGO_ENABLED=0
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
export TAGS="with_gvisor"
go build -tags="$TAGS" -o "../libclash/linux/FlClashCore"

cd "${srcdir}/$pkgname"
fvm install 3.35.7
fvm use 3.35.7

fvm flutter --disable-analytics
#fvm flutter pub upgrade --major-versions
fvm flutter --no-version-check pub get
fvm flutter clean && fvm flutter build linux --release --dart-define=APP_ENV=stable
}

package() {
if [ $CARCH == "aarch64" ]; then
FLUTTER_ARCH=arm64
else
FLUTTER_ARCH=x64
fi

cd "${srcdir}/$pkgname/build/linux/$FLUTTER_ARCH/release/bundle"

install -Dm755 "FlClash" "$pkgdir/usr/lib/$pkgname/FlClash"
install -Dm755 "FlClashCore" "$pkgdir/usr/lib/$pkgname/FlClashCore"
cp --reflink=auto -r lib/ "$pkgdir/usr/lib/$pkgname/"
cp --reflink=auto -r data/ "$pkgdir/usr/lib/$pkgname/"
# copy libquickjs_c_bridge_plugin.so
cp --reflink=auto "../plugins/flutter_js/bundle/lib/libquickjs_c_bridge_plugin.so" "$pkgdir/usr/lib/$pkgname/lib/libquickjs_c_bridge_plugin.so"

# runpath
patchelf --set-rpath '$ORIGIN/lib' "$pkgdir/usr/lib/$pkgname/FlClash"
for i in "$pkgdir/usr/lib/$pkgname/lib"/*.so; do
[ -z "$(patchelf --print-rpath "$i")" ] && continue
patchelf --set-rpath '$ORIGIN' "$i"
done

# symlink
install -dm755 "${pkgdir}/usr/bin"
ln -sfr "$pkgdir/usr/lib/$pkgname/FlClash" "$pkgdir/usr/bin/${pkgname}"

# icon
install -Dm644 "$srcdir/$pkgname/assets/images/icon.png" \
"$pkgdir/usr/share/pixmaps/$pkgname.png"

# .desktop file
install -Dm644 "$srcdir/com.follow.clash.desktop" "${pkgdir}/usr/share/applications/com.follow.clash.desktop"

# license
install -Dm644 "${srcdir}/$pkgname/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname/"
}
11 changes: 11 additions & 0 deletions archlinuxcn/flclash/com.follow.clash.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Name=FlClash
Categories=Network;
GenericName=FlClash
Icon=flclash
Exec=flclash %U
Categories=Network;
Keywords=FlClash;Clash;ClashMeta;Proxy;
StartupWMClass=com.follow.clash
StartupNotify=true
12 changes: 12 additions & 0 deletions archlinuxcn/flclash/lilac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
maintainers:
- github: DeeHY
email: Dee.H.Y <dongfengweixiao at hotmail dot com>

pre_build_script: update_pkgver_and_pkgrel(_G.newver)
post_build: git_pkgbuild_commit

update_on:
- source: github
github: chen08209/FlClash
use_latest_release: true
prefix: v
Loading