{
 "app_id": "org.jeffvli.feishin",
 "source_url": "https://raw.githubusercontent.com/flathub/org.jeffvli.feishin/master/org.jeffvli.feishin.yml",
 "runtime": "org.freedesktop.Platform",
 "runtime_version": "25.08",
 "sdk": "org.freedesktop.Sdk",
 "finish_args": [
  "--share=ipc",
  "--share=network",
  "--socket=fallback-x11",
  "--socket=pulseaudio",
  "--socket=wayland",
  "--device=dri",
  "--filesystem=xdg-run/app/com.discordapp.Discord:create",
  "--talk-name=org.kde.StatusNotifierWatcher",
  "--talk-name=org.kde.kwalletd5",
  "--talk-name=org.freedesktop.secrets",
  "--own-name=org.mpris.MediaPlayer2.Feishin"
 ],
 "module_count": 4,
 "fetched_at": "2026-09-17T16:15:21.276283+00:00",
 "manifest": {
  "app-id": "org.jeffvli.feishin",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "25.08",
  "sdk": "org.freedesktop.Sdk",
  "base": "org.electronjs.Electron2.BaseApp",
  "base-version": "25.08",
  "command": "feishin",
  "separate-locales": false,
  "sdk-extensions": [
   "org.freedesktop.Sdk.Extension.node24"
  ],
  "finish-args": [
   "--device=dri",
   "--share=ipc",
   "--socket=fallback-x11",
   "--socket=wayland",
   "--socket=pulseaudio",
   "--share=network",
   "--filesystem=xdg-run/app/com.discordapp.Discord:create",
   "--talk-name=org.kde.StatusNotifierWatcher",
   "--own-name=org.mpris.MediaPlayer2.Feishin",
   "--talk-name=org.freedesktop.secrets",
   "--talk-name=org.kde.kwalletd5",
   "--env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons"
  ],
  "cleanup": [
   "/share/applications/mpv.desktop",
   "/share/icons/*/*/apps/mpv*",
   "/share/metainfo/mpv.metainfo.xml",
   "/share/bash-completion",
   "/share/doc",
   "/share/fish",
   "/share/zsh",
   "/include",
   "/lib/pkgconfig",
   "/lib/*.la"
  ],
  "modules": [
   {
    "name": "mpv",
    "buildsystem": "meson",
    "config-opts": [
     "-Dbuildtype=release",
     "-Ddebug=false",
     "-Dstrip=true",
     "-Dbuild-date=false",
     "-Dmanpage-build=disabled"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/mpv-player/mpv.git",
      "x-checker-data": {
       "type": "git",
       "tag-pattern": "^v([\\d.]+)$"
      },
      "commit": "41f6a645068483470267271e1d09966ca3b9f413",
      "tag": "v0.41.0"
     }
    ],
    "post-install": [
     "install -Dm0644 ../LICENSE.LGPL -t ${FLATPAK_DEST}/share/licenses/${FLATPAK_ID}/mpv"
    ],
    "modules": [
     {
      "name": "libplacebo",
      "buildsystem": "meson",
      "config-opts": [
       "-Ddemos=false",
       "-Dshaderc=disabled"
      ],
      "sources": [
       {
        "type": "git",
        "url": "https://github.com/haasn/libplacebo.git",
        "x-checker-data": {
         "type": "git",
         "tag-pattern": "^v([\\d.]+)$"
        },
        "commit": "cee9b076f2c63104ccfd497fa79c39a867293ec4",
        "tag": "v7.360.1"
       }
      ],
      "post-install": [
       "install -Dm0644 ../LICENSE -t ${FLATPAK_DEST}/share/licenses/${FLATPAK_ID}/libplacebo"
      ]
     },
     {
      "name": "libass",
      "config-opts": [
       "--enable-shared",
       "--disable-static"
      ],
      "sources": [
       {
        "type": "git",
        "url": "https://github.com/libass/libass.git",
        "x-checker-data": {
         "type": "git",
         "tag-pattern": "^([\\d.]+)$"
        },
        "commit": "4a05d8127f525943ebf45fdc6497c9e665947f0d",
        "tag": "0.17.5"
       }
      ],
      "post-install": [
       "install -Dm0644 COPYING -t ${FLATPAK_DEST}/share/licenses/${FLATPAK_ID}/libass"
      ]
     }
    ]
   },
   {
    "name": "feishin",
    "buildsystem": "simple",
    "build-options": {
     "append-path": "/usr/lib/sdk/node24/bin:/run/build/feishin/pnpm/bin",
     "env": {
      "XDG_CACHE_HOME": "/run/build/feishin/flatpak-node/cache",
      "PNPM_CONFIG_STORE_DIR": "/run/build/feishin/flatpak-node/pnpm-store",
      "npm_config_nodedir": "/usr/lib/sdk/node24"
     }
    },
    "subdir": "main",
    "build-commands": [
     "ln ../pnpm/bin/pnpm.cjs ../pnpm/bin/pnpm",
     "chmod +x ../pnpm/bin/pnpm",
     "pnpm install --frozen-lockfile --offline --config.trustLockfile=true",
     "pnpm run build",
     "npx electron-builder --linux dir --config.electronDist=../flatpak-node/cache/electron",
     "build_dir=dist/linux*unpacked\nfor i in 128x128 256x256 512x512; do\n  install -Dm 644 ${build_dir}/resources/assets/icons/${i}.png ${FLATPAK_DEST}/share/icons/hicolor/${i}/apps/${FLATPAK_ID}.png\ndone\ncp -ar ${build_dir} /app/main\n",
     "envsubst < feishin.desktop.tmpl > ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop",
     "chmod 0644 ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop",
     "install -Dm 644 ../org.jeffvli.feishin.metainfo.xml ${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml",
     "install -Dm 755 ../feishin.sh /app/bin/feishin"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/jeffvli/feishin.git",
      "dest": "main",
      "x-checker-data": {
       "type": "git",
       "tag-pattern": "^v([\\d.]+)$"
      },
      "commit": "5c169aca8d550032c9aa6e8e2b9f624d03d42fec",
      "tag": "v1.17.0"
     },
     {
      "type": "file",
      "url": "https://github.com/jeffvli/feishin/releases/download/v1.17.0/org.jeffvli.feishin.metainfo.xml",
      "sha256": "c0e3a445a23889e3641a18d9eaebe32e6b94e358040c5b9d27167ad052206ba1",
      "x-checker-data": {
       "type": "json",
       "url": "https://api.github.com/repos/jeffvli/feishin/releases/latest",
       "tag-query": ".tag_name",
       "version-query": "$tag | sub(\"^v\"; \"\")",
       "url-query": ".assets[] | select(.name == \"org.jeffvli.feishin.metainfo.xml\") | .browser_download_url"
      }
     },
     {
      "type": "archive",
      "dest": "pnpm",
      "url": "https://registry.npmjs.org/pnpm/-/pnpm-11.5.2.tgz",
      "sha256": "749dc54fbd3dcde9e414baae32c177ca84770d3fcd69c8816d579adc3e6a2c99"
     },
     "generated-sources.json",
     {
      "type": "script",
      "dest-filename": "feishin.sh",
      "commands": [
       "for i in {0..9}; do\n    test -S $XDG_RUNTIME_DIR/discord-ipc-$i || ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-$i;\ndone\n",
       "export TMPDIR=\"$XDG_RUNTIME_DIR/app/$FLATPAK_ID\"",
       "zypak-wrapper /app/main/feishin \"$@\""
      ]
     }
    ]
   }
  ]
 }
}