app-id: com.matthiasn.lotti runtime: org.freedesktop.Platform runtime-version: '26.08' sdk: org.freedesktop.Sdk sdk-extensions: - org.freedesktop.Sdk.Extension.llvm22 command: lotti finish-args: - --share=network - --share=ipc - --socket=fallback-x11 - --socket=wayland - --socket=pulseaudio - --device=dri - --filesystem=xdg-documents/Lotti:create - --filesystem=xdg-pictures:ro - --filesystem=xdg-download/Lotti:create # flutter_secure_storage_linux uses libsecret directly. Without access to # the Secret Service, the plugin reports the unavailable service as # KeyringLocked and Matrix credentials cannot be read or persisted. - --talk-name=org.freedesktop.secrets # Cursor theme access (fixes "Unable to load from cursor theme" warning) - --env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons modules: - name: python3-jinja2 buildsystem: simple build-commands: - pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "MarkupSafe" "jinja2" --no-build-isolation sources: - type: file url: https://files.pythonhosted.org/packages/31/80/3a54838c3fb461f6fec263ebf3a3a41771bd05190238de3486aae8540c36/jinja2-3.1.4-py3-none-any.whl sha256: bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d - type: file url: https://files.pythonhosted.org/packages/87/5b/aae44c6655f3801e81aa3eef09dbbf012431987ba564d7231722f68df02d/MarkupSafe-2.1.5.tar.gz sha256: d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b - name: libplacebo buildsystem: meson config-opts: - -Dglslang=disabled - -Dshaderc=disabled - -Dvulkan=disabled - -Dd3d11=disabled - -Ddemos=false - -Dopengl=disabled - -Dtests=false sources: - type: archive url: https://github.com/haasn/libplacebo/archive/refs/tags/v6.338.2.tar.gz sha256: 2f1e624e09d72a8c9db70f910f7560e764a1c126dae42acc5b3bcef836a7aec6 - name: libass buildsystem: autotools config-opts: - --disable-static sources: - type: archive url: https://github.com/libass/libass/releases/download/0.17.1/libass-0.17.1.tar.xz sha256: f0da0bbfba476c16ae3e1cfd862256d30915911f7abaa1b16ce62ee653192784 cleanup: - /include - /lib/pkgconfig - name: libmpv buildsystem: meson config-opts: - -Dlibmpv=true - -Dlua=disabled - -Ddebug=false - -Dbuild-date=false - -Dmanpage-build=disabled - -Dvulkan=disabled sources: - type: archive url: https://github.com/mpv-player/mpv/archive/v0.41.0.tar.gz sha256: ee21092a5ee427353392360929dc64645c54479aefdb5babc5cfbb5fad626209 - name: libsecret buildsystem: meson config-opts: - -Dmanpage=false - -Dvapi=false - -Dgcrypt=false - -Dgtk_doc=false - -Dintrospection=false sources: - type: archive url: https://gitlab.gnome.org/GNOME/libsecret/-/archive/0.20.5/libsecret-0.20.5.tar.gz sha256: b33b9542222ea8866f6ff2d31c0ad373877c2277db546ca00cc7fdda9cbab1c3 - name: libkeybinder buildsystem: autotools sources: - type: archive url: https://github.com/kupferlauncher/keybinder/releases/download/keybinder-3.0-v0.3.2/keybinder-3.0-0.3.2.tar.gz sha256: e6e3de4e1f3b201814a956ab8f16dfc8a262db1937ff1eee4d855365398c6020 # ONNX Runtime for on-device TTS (flutter_onnxruntime). The plugin's CMake # otherwise downloads this binary at configure time, which fails in Flathub's # offline build sandbox. Vendor the official prebuilt runtime as a declared # source (fetched during the networked download phase) and install it into # /app so the plugin links it via ONNXRUNTIME_ROOT_DIR / CMAKE_PREFIX_PATH. - name: onnxruntime buildsystem: simple build-commands: - install -d /app/lib /app/include - cp -a lib/. /app/lib/ - cp -a include/. /app/include/ sources: - type: archive only-arches: - x86_64 url: https://github.com/microsoft/onnxruntime/releases/download/v1.27.0/onnxruntime-linux-x64-1.27.0.tgz sha256: 547e40a48f1fe73e3f812d7c88a948612c23f896b91e4e2ee1e232d7b468246f - type: archive only-arches: - aarch64 url: https://github.com/microsoft/onnxruntime/releases/download/v1.27.0/onnxruntime-linux-aarch64-1.27.0.tgz sha256: 3e4d83ac06924a32a07b6d7f91ce6f852876153fc0bbdf931bf517a140bfbe48 # NOTE: No separate flutter-sdk module - Flutter is included in lotti sources for flatpak-flutter - name: lotti buildsystem: simple build-options: append-path: /usr/lib/sdk/llvm22/bin:/var/lib/rustup/bin:/var/lib/flutter/bin prepend-ld-library-path: /usr/lib/sdk/llvm22/lib env: PUB_CACHE: /run/build/lotti/.pub-cache CARGO_HOME: /run/build/lotti/cargo RUSTUP_HOME: /var/lib/rustup FLUTTER_SUPPRESS_ANALYTICS: "true" # Resolve /app-installed deps (libmpv, onnxruntime, ...) and point # flutter_onnxruntime's CMake at the vendored ONNX Runtime in /app so it # links the pre-provided library instead of downloading one (the build # runs offline). Set here in env, not as a standalone `export` # build-command — each build-command runs in its own shell, so an export # on its own line would not carry into the `flutter build` invocation. CMAKE_PREFIX_PATH: /app ONNXRUNTIME_ROOT_DIR: /app build-commands: - flutter pub get --offline - flutter build linux --release --no-pub --verbose - | arch="x64" if [ "${FLATPAK_ARCH}" = "aarch64" ]; then arch="arm64" fi # Replace existing runtime symlinks instead of following them: the # build dependency and bundled speech runtime use opposite .so aliases. cp -r --remove-destination build/linux/${arch}/release/bundle/* /app/ - chmod +x /app/lotti - | install -D linux/com.matthiasn.lotti.desktop /app/share/applications/com.matthiasn.lotti.desktop install -D flatpak/com.matthiasn.lotti.metainfo.xml /app/share/metainfo/com.matthiasn.lotti.metainfo.xml install -D lotti-wrapper.sh /app/bin/lotti for size in 512 256 128 64 48 32 16; do install -D "flatpak/app_icon_${size}.png" "/app/share/icons/hicolor/${size}x${size}/apps/com.matthiasn.lotti.png" done sources: # App source - type: git url: https://github.com/matthiasn/lotti commit: COMMIT_PLACEHOLDER disable-lfs: true # Flutter SDK - inside lotti module as flatpak-flutter expects - type: git url: https://github.com/flutter/flutter.git tag: 3.47.4 dest: flutter disable-lfs: true - type: script dest-filename: lotti-wrapper.sh commands: - cd /app - exec ./lotti "$@"