-
Notifications
You must be signed in to change notification settings - Fork 386
addpkg: flclash #4682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
addpkg: flclash #4682
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9fd445e
addpkg: flclash
dongfengweixiao ad5420b
flclash: fix Go build configuration
dongfengweixiao 7e52345
flclash: explicitly declare all dependency
dongfengweixiao a426d29
flclash: optimize the reference of git submodule
dongfengweixiao eb542af
flclash: fix hotkey manager build error
dongfengweixiao 3c9d407
flclash: fix submodule config error
dongfengweixiao 0856123
flclash: use local hotkey_manager_linux
dongfengweixiao 5b2d5f4
flclash: remove redundant branch specification
RocketMaDev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| "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/" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.