From cf79036e7a8d5b6658976f3535ed10407b9fc1c4 Mon Sep 17 00:00:00 2001 From: Uyanide Date: Sat, 1 Aug 2026 14:45:43 +0200 Subject: [PATCH] use fvm instead of flutter package --- .SRCINFO | 4 +--- PKGBUILD | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index 2feb602..1f33884 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -7,9 +7,7 @@ pkgbase = nipaplay-reload arch = aarch64 license = MIT makedepends = git - makedepends = flutter - makedepends = flutter-target-linux - makedepends = flutter-target-web + makedepends = fvm makedepends = rustup makedepends = java-environment makedepends = clang diff --git a/PKGBUILD b/PKGBUILD index 56bfc1f..5672f8c 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -24,9 +24,7 @@ depends=( # it again. The binary is able to run on glibc malloc, hence no mimalloc dependency here. makedepends=( 'git' - 'flutter' - 'flutter-target-linux' - 'flutter-target-web' # embedded web remote UI; the build script skips it when absent + 'fvm' # upstream pins its Flutter SDK in .fvmrc, and the repos ship no flutter 'rustup' # cargokit hard-requires `rustup run cargo build` 'java-environment' # the jni plugin's linux CMake needs the JNI headers 'clang' @@ -71,21 +69,31 @@ prepare() { -e 's|^Icon=.*|Icon=io.github.MCDFSteve.NipaPlay-Reload|' \ assets/linux/io.github.MCDFSteve.NipaPlay-Reload.desktop - flutter pub get + # Fetch the Flutter SDK pinned in .fvmrc. Keep fvm's cache inside $srcdir instead + # of the builder's home, and skip the local git mirror -- it only pays off when + # juggling several SDK versions, and here it would just be a few hundred MB extra. + export FVM_CACHE_PATH="${srcdir}/fvm" + export FVM_USE_GIT_CACHE=false + fvm install + + fvm flutter pub get } build() { cd "${pkgname}" + export FVM_CACHE_PATH="${srcdir}/fvm" + export FVM_USE_GIT_CACHE=false export FLUTTER_SUPPRESS_ANALYTICS=true # Match upstream CI: fvp takes its deps from the latest mdk-sdk release export FVP_DEPS_URL='https://github.com/wang-bin/mdk-sdk/releases/latest/download/' export FVP_DEPS_LATEST=1 - # Build the embedded web remote UI into assets/web/ (the script degrades on failure) - bash build_and_copy_web.sh + # Build the embedded web remote UI into assets/web/ (the script degrades on failure). + # It invokes a bare `flutter`, so it needs the pinned SDK on PATH. + fvm exec bash build_and_copy_web.sh - flutter build linux --release + fvm flutter build linux --release } package() {