# Animeko (Ani) repackaged as a Flatpak from the official Linux AppImage. # # The AppImage is not a build input and is not redistributed from here. It is # declared as an extra-data source, so flatpak downloads it straight from the # upstream release on the user's machine, verifies its sha256 and then runs # apply_extra to unpack and patch it. This repository ships nothing but the # desktop metadata, the entry point and two helper scripts. # # The upstream AppImage ships a jpackage (JetBrains Runtime 21) launcher that # mis-sizes its JvmlLauncherData buffer when the classpath is very long: # Animeko's 274 jars expand to roughly 37 KB, the launcher silently truncates # the classpath after ~5.3 KB and then overwrites its own environment-variable # pointer array, so setenv() dereferences garbage and the process dies with # SIGSEGV before the JVM starts. # # make-bootstrap.py moves the jar list out of Ani.cfg and into a manifest # Class-Path attribute of a single bootstrap jar, which keeps the launcher's # classpath down to one short entry. There is no AppImage here to patch, so it # runs from apply_extra at install time instead of from this build. # See README.md for the full analysis. app-id: me.him188.ani runtime: org.gnome.Platform runtime-version: '51' sdk: org.gnome.Sdk command: ani finish-args: # Streaming, BitTorrent, Bangumi/danmaku APIs, analytics. - --share=network # X11 shared memory. JCEF forces --ozone-platform=x11, and Skiko/AWT render # through XWayland, so an X11 socket is mandatory even on Wayland sessions. - --share=ipc - --socket=x11 - --socket=wayland - --socket=pulseaudio # VA-API hardware decoding for mpv/FFmpeg and GPU access for Skiko. - --device=dri # Nothing on the host filesystem is requested. Everything the app writes by # default - the media download folder, the media cache, the database and the # logs - lives under ~/.var/app/me.him188.ani/, which the sandbox provides on # its own. A user who points the app at a real path has to grant that path, # e.g. `flatpak override --user --filesystem=xdg-download me.him188.ani`, or # the same per-app in Flatseal. Should this package want to ship a broader # default, the candidates are, in increasing order of width: # - --filesystem=xdg-download # - --filesystem=xdg-videos # - --filesystem=/run/media (removable drives) # - --filesystem=/media # - --filesystem=home # System tray and notifications. Compose's tray helper registers the bus name # org.kde.StatusNotifierItem--1 over sd-bus directly. Flatpak cannot # express a wildcard for that hyphenated name, and the sandbox always gives # the app the same PID, so the exact name can be granted. - --talk-name=org.kde.StatusNotifierWatcher - --own-name=org.kde.StatusNotifierItem-2-1 - --talk-name=org.freedesktop.Notifications # Sleep and screen-saver inhibition while a video plays. Animeko offers two # paths: it shells out to `systemd-inhibit` (logind, system bus) and it calls # the org.freedesktop.ScreenSaver D-Bus interface. The GNOME runtime ships no # systemd-inhibit binary, so only the D-Bus path can work here. Without this # grant its Inhibit call fails silently and the machine suspends mid-playback. # logind is deliberately not granted: it would be the only system bus access # this package asks for, and the path that needs it cannot run anyway. - --talk-name=org.freedesktop.ScreenSaver build-options: # There is nothing to strip or debug here: the only ELF files are inside the # AppImage, which is unpacked on the user's machine, not during this build. strip: false no-debuginfo: true modules: - name: animeko buildsystem: simple build-commands: - install -Dm755 ani-wrapper "${FLATPAK_DEST}/bin/ani" # flatpak looks for exactly this path when it has extra data to apply. - install -Dm755 apply_extra "${FLATPAK_DEST}/bin/apply_extra" - install -Dm755 make-bootstrap.py "${FLATPAK_DEST}/libexec/make-bootstrap.py" - install -Dm644 me.him188.ani.desktop "${FLATPAK_DEST}/share/applications/me.him188.ani.desktop" - install -Dm644 me.him188.ani.metainfo.xml "${FLATPAK_DEST}/share/metainfo/me.him188.ani.metainfo.xml" - install -Dm644 me.him188.ani-512.png "${FLATPAK_DEST}/share/icons/hicolor/512x512/apps/me.him188.ani.png" - install -Dm644 me.him188.ani-256.png "${FLATPAK_DEST}/share/icons/hicolor/256x256/apps/me.him188.ani.png" - install -Dm644 me.him188.ani-128.png "${FLATPAK_DEST}/share/icons/hicolor/128x128/apps/me.him188.ani.png" sources: # Retrieved by flatpak on the user's machine, at install and at every # update: flatpak-builder never downloads it, it only records the entry in # the app metadata. sha256 and size are the published upstream asset # (open-ani/animeko v6.2.0, 338749944 bytes). Bumping upstream means # editing url, sha256 and size here - nothing else in this manifest. - type: extra-data filename: ani.appimage url: https://github.com/open-ani/animeko/releases/download/v6.2.0/ani-6.2.0-linux-x86_64.appimage sha256: e477ffef0f6acb9910424b6bc20e3b807c1ff9c9c39c14b9ae24e284612fc984 size: 338749944 only-arches: - x86_64 - type: file path: apply_extra - type: file path: make-bootstrap.py - type: file path: ani-wrapper - type: file path: me.him188.ani.desktop - type: file path: me.him188.ani.metainfo.xml - type: file path: icons/me.him188.ani-512.png - type: file path: icons/me.him188.ani-256.png - type: file path: icons/me.him188.ani-128.png