1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# Maintainer: jmx4013 <jmx4013@proton.me>
pkgname=fushi
pkgver=2.9.1
pkgrel=1
pkgdesc='Immersion language-learning suite: EPUB reader, video subtitle lookup, audiobook sync, and one-tap Anki mining'
arch=('x86_64')
url='https://github.com/hajisensai/Fushi'
license=('GPL-3.0-or-later')
depends=('gtk3' 'libkeybinder3' 'mpv' 'wpewebkit')
makedepends=('clang' 'cmake' 'ninja' 'pkg-config' 'unzip' 'libwpe' 'wpebackend-fdo')
optdepends=('qbittorrent: fallback torrent engine when the bundled libtorrent is unavailable')
source=("https://github.com/hajisensai/Fushi/archive/refs/tags/v2.9.1.tar.gz#/fushi-2.9.1.tar.gz"
'https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.0-stable.tar.xz'
'fix-fushidicts-cstdint.patch'
'wpe-inappwebview-linux.patch'
'fushi.desktop')
sha256sums=('2a97c7e4cd4d96b5d41e48574003864957fab8b2243d232fcd900d9814404133'
'e1ec95e6c550458a34de93580cb85dac24da0e9bedb9bb42811f050ac5a0c7d5'
'8334fd0a75f8cfdfff0873b3c9ae9f0d19acfffdf59c07d4cb4d95b1e3ed2391'
'e610eb1629f86bb8812402681bd68503ca038423a684cb5fb037b4914450d83e'
'c96cbc90cca94c8e7d661003e65b9206ae6f060a29f409e509f1f5b6393dc3ec')
prepare() {
cd "${srcdir}/Fushi-${pkgver}"
patch -p1 -i "${srcdir}/fix-fushidicts-cstdint.patch"
patch -p1 -i "${srcdir}/wpe-inappwebview-linux.patch"
}
# Project is locked to Flutter 3.44.0 (the AUR flutter package is a different,
# older release), so the pinned SDK tarball is carried as a source. Dart SDK is
# bundled in that tarball; everything else resolves via pub.
#
# The v2.1.1 tag's pubspec still says 2.0.0+1210 (upstream stamps versions via
# CI flags, not pubspec), so without a fix the app would see itself as 2.0.0 and
# prompt an update to the manifest's 2.1.1 forever. flutter build --build-name/
# --build-number do NOT apply to Linux (version.json is generated from pubspec),
# so the bundle's data/flutter_assets/version.json is rewritten at package time
# to mirror the official desktop release: version=<pkgver>, build_number=<seq>
# (the releaseSequence of latest-stable-fushi.json, which the in-app updater
# compares). Bump _release_seq together with pkgver when updating.
_release_seq=16909
build() {
export FLUTTER_ROOT="${srcdir}/flutter"
export PATH="${FLUTTER_ROOT}/bin:${PATH}"
export PUB_CACHE="${srcdir}/pub-cache"
cd "${srcdir}/Fushi-${pkgver}"
bash tool/bootstrap.sh
cd fushi
flutter build linux --release
}
package() {
local srcdir_app="${srcdir}/Fushi-${pkgver}"
local bundle="${srcdir_app}/fushi/build/linux/x64/release/bundle"
local dest="${pkgdir}/usr/lib/fushi"
install -dm755 "${dest}"
cp -a "${bundle}/." "${dest}/"
install -dm755 "${pkgdir}/usr/bin"
ln -s /usr/lib/fushi/fushi "${pkgdir}/usr/bin/fushi"
# Linux has no version pipeline: overwrite the pubspec-derived version.json
# so PackageInfo (and thus the in-app updater) reports the real release.
printf '{"app_name":"fushi","version":"2.9.1","build_number":"16909","package_name":"fushi"}' > "${dest}/data/flutter_assets/version.json"
install -Dm644 "${srcdir_app}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -Dm644 "${srcdir}/fushi.desktop" "${pkgdir}/usr/share/applications/fushi.desktop"
install -Dm644 "${srcdir_app}/fushi/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png" \
"${pkgdir}/usr/share/pixmaps/fushi.png"
# flutter_onnxruntime copies only the dev symlink (-> libonnxruntime.so.1);
# the versioned real lib never lands in the bundle, so the bundle's symlink is
# broken at runtime. Ship the real .so.1.22.0 into the same lib dir.
local ort_lib
ort_lib=$(find "${srcdir_app}/fushi/build/linux/x64/release/plugins/flutter_onnxruntime" \
-type d -path '*onnxruntime-linux-x64*/lib' | head -1)
cp -a "${ort_lib}/." "${dest}/lib/"
}
|