Skip to content

Commit eb542af

Browse files
flclash: fix hotkey manager build error
1 parent a426d29 commit eb542af

2 files changed

Lines changed: 30 additions & 9 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- a/linux/hotkey_manager_linux_plugin.cc
2+
+++ b/linux/hotkey_manager_linux_plugin.cc
3+
@@ -32,7 +32,7 @@ G_DEFINE_TYPE(HotkeyManagerLinuxPlugin,
4+
g_object_get_type())
5+
6+
void handle_key_down(const char* keystring, void* user_data) {
7+
- const char* identifier;
8+
+ const char* identifier = nullptr;
9+
10+
std::string val = keystring;
11+
auto result = std::find_if(hotkey_id_map.begin(), hotkey_id_map.end(),
12+
@@ -103,7 +103,7 @@ static FlMethodResponse* hkm_unregister(_HotkeyManagerLinuxPlugin* self,
13+
FlValue* args) {
14+
const char* identifier =
15+
fl_value_get_string(fl_value_lookup_string(args, "identifier"));
16+
- const char* keystring;
17+
+ const char* keystring = nullptr;
18+
19+
std::string val = identifier;
20+
auto result = std::find_if(hotkey_id_map.begin(), hotkey_id_map.end(),

archlinuxcn/flclash/PKGBUILD

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@ _pkgext="tar.gz"
4646
source=(
4747
"${pkgname}"::"git+https://github.com/chen08209/FlClash.git#tag=v$pkgver"
4848
"0001-fix-build-error.patch"
49+
"0002-fix-hotkey-manager.patch"
4950
"com.follow.clash.desktop"
5051
"Clash.Meta::git+https://github.com/chen08209/Clash.Meta.git"
5152
"flutter_distributor::git+https://github.com/chen08209/flutter_distributor.git"
5253
"tray_manager::git+https://github.com/chen08209/tray_manager.git"
5354
)
5455
sha256sums=('aaf8c535929ecc642637334799f8396301fbc39a3ea25b2c9a8afdabf4a7e34d'
5556
'b551c46a1577758c13bdd07868d41e4de817c6184114e1b10d39e04ae572a76a'
57+
'611a118c9c0c8674db1048f53923ebff655ba8303df7a6666710bd975512f864'
5658
'0601176d0b5df7aafb3c949417b7f0d98ab17d21b6fcc89c6f83a7e031bbe45d'
5759
'SKIP'
5860
'SKIP'
@@ -67,7 +69,14 @@ prepare() {
6769
git config submodule.plugins.tray_manager.url "$srcdir/tray_manager"
6870
git -c protocol.file.allow=always submodule update
6971

72+
export FVM_CACHE_PATH="$SRCDEST/fvm-cache"
73+
fvm install 3.35.7
74+
fvm use 3.35.7
75+
fvm flutter --disable-analytics
76+
fvm flutter --no-version-check pub get
77+
7078
patch -p1 -i "${srcdir}/0001-fix-build-error.patch"
79+
patch -p1 -d "${srcdir}/$pkgname/linux/flutter/ephemeral/.plugin_symlinks/hotkey_manager_linux" -i "${srcdir}/0002-fix-hotkey-manager.patch"
7180

7281
# go mod download
7382
cd "$srcdir/$pkgname/core"
@@ -76,8 +85,6 @@ prepare() {
7685
}
7786

7887
build() {
79-
export FVM_CACHE_PATH="$SRCDEST/fvm-cache"
80-
8188
# build core
8289
cd "$srcdir/$pkgname/core"
8390
if [ "$CARCH" == "aarch64" ]; then
@@ -92,13 +99,7 @@ build() {
9299
go build -tags="$TAGS" -o "../libclash/linux/FlClashCore"
93100

94101
cd "${srcdir}/$pkgname"
95-
fvm install 3.35.7
96-
fvm use 3.35.7
97-
98-
fvm flutter --disable-analytics
99-
#fvm flutter pub upgrade --major-versions
100-
fvm flutter --no-version-check pub get
101-
fvm flutter clean && fvm flutter build linux --release --dart-define=APP_ENV=stable
102+
fvm flutter build linux --release --dart-define=APP_ENV=stable
102103
}
103104

104105
package() {

0 commit comments

Comments
 (0)