# Flatpak manifest for ViewFree. # # Built against the GNOME runtime purely for its libraries — ViewFree does not # use libadwaita and does not assume GNOME conventions, because it has to look # right on KDE, Xfce, Cinnamon, MATE and LXQt too. # # Build locally with: # flatpak run org.flatpak.Builder --user --install --force-clean \ # build packaging/flatpak/io.github.justlinuxnoob.ViewFree.yml # # `cargo-sources.json` is generated by packaging/flatpak/generate-sources.sh and # lets the build run with no network access, which Flathub requires. app-id: io.github.justlinuxnoob.ViewFree runtime: org.gnome.Platform runtime-version: '49' sdk: org.gnome.Sdk sdk-extensions: - org.freedesktop.Sdk.Extension.rust-stable command: viewfree finish-args: # Both display servers. ViewFree makes no X11-only assumptions, but falls # back cleanly where Wayland is unavailable. - --socket=wayland - --socket=fallback-x11 - --share=ipc - --device=dri # An image viewer is pointed at arbitrary files on the disk, so it needs to # be able to read them — and the batch tools need to write results back # beside them. There is no narrower permission that lets someone convert a # folder of photographs in place. - --filesystem=host # Reading and writing the *host's* mimeapps.list is what makes the one-click # "become the default image viewer" work, and what makes undoing it work. - --filesystem=xdg-config/mimeapps.list:rw - --filesystem=xdg-data/applications:rw # Opening the containing folder in the user's file manager. - --talk-name=org.freedesktop.FileManager1 # Explicitly NOT requested: --share=network. ViewFree has no telemetry, no # update check and no account system, so it has no reason to reach the # network, and saying so here makes that promise enforceable rather than # merely stated in a README. modules: - name: viewfree buildsystem: simple # Scoped to this module rather than declared at the top level: a # top-level `append-path` also applies to the finish stage, where it # displaces /app/bin from PATH and makes flatpak-builder report # "Command 'viewfree' not found" even though the binary is right there. build-options: append-path: /usr/lib/sdk/rust-stable/bin env: CARGO_HOME: /run/build/viewfree/cargo CARGO_NET_OFFLINE: 'true' # This program's whole premise is instant startup, so the slower # release profile is worth it. CARGO_PROFILE_RELEASE_LTO: 'fat' CARGO_PROFILE_RELEASE_CODEGEN_UNITS: '1' build-commands: - cargo --offline fetch --manifest-path Cargo.toml --verbose - cargo --offline build --release --verbose - install -Dm755 target/release/viewfree /app/bin/viewfree - install -Dm644 data/io.github.justlinuxnoob.ViewFree.desktop /app/share/applications/io.github.justlinuxnoob.ViewFree.desktop - install -Dm644 data/io.github.justlinuxnoob.ViewFree.metainfo.xml /app/share/metainfo/io.github.justlinuxnoob.ViewFree.metainfo.xml - install -Dm644 data/icons/io.github.justlinuxnoob.ViewFree.svg /app/share/icons/hicolor/scalable/apps/io.github.justlinuxnoob.ViewFree.svg - install -Dm644 data/integration/viewfree-servicemenu.desktop /app/share/viewfree/integration/viewfree-servicemenu.desktop - install -Dm644 data/integration/viewfree-nautilus.py /app/share/viewfree/integration/viewfree-nautilus.py sources: - type: dir path: ../.. - cargo-sources.json