{
 "app_id": "social.whalebird.WhalebirdDesktop",
 "source_url": "https://raw.githubusercontent.com/flathub/social.whalebird.WhalebirdDesktop/master/social.whalebird.WhalebirdDesktop.yaml",
 "runtime": "org.freedesktop.Platform",
 "runtime_version": "23.08",
 "sdk": "org.freedesktop.Sdk",
 "finish_args": [
  "--share=network",
  "--share=ipc",
  "--socket=x11",
  "--socket=pulseaudio",
  "--device=dri",
  "--talk-name=org.kde.StatusNotifierWatcher",
  "--talk-name=org.freedesktop.Notifications",
  "--talk-name=org.gtk.vfs.*",
  "--talk-name=com.canonical.AppMenu.Registrar",
  "--talk-name=org.freedesktop.secrets",
  "--talk-name=com.canonical.indicator.application",
  "--talk-name=com.canonical.Unity.LauncherEntry"
 ],
 "module_count": 2,
 "fetched_at": "2026-09-17T16:17:25.431909+00:00",
 "manifest": {
  "app-id": "social.whalebird.WhalebirdDesktop",
  "base": "org.electronjs.Electron2.BaseApp",
  "base-version": "23.08",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "23.08",
  "command": "start-whalebird.sh",
  "sdk": "org.freedesktop.Sdk",
  "sdk-extensions": [
   "org.freedesktop.Sdk.Extension.node18"
  ],
  "separate-locales": false,
  "finish-args": [
   "--share=ipc",
   "--socket=x11",
   "--socket=pulseaudio",
   "--share=network",
   "--device=dri",
   "--talk-name=org.freedesktop.secrets",
   "--talk-name=org.freedesktop.Notifications",
   "--talk-name=org.gtk.vfs.*",
   "--talk-name=org.kde.StatusNotifierWatcher",
   "--talk-name=com.canonical.AppMenu.Registrar",
   "--talk-name=com.canonical.indicator.application",
   "--talk-name=com.canonical.Unity.LauncherEntry",
   "--env=FLATPAK_HOST=1",
   "--env=GTK_USE_PORTAL=1"
  ],
  "modules": [
   {
    "name": "node-gyp",
    "buildsystem": "simple",
    "build-commands": [
     "install -Dm755  node-gyp /app/bin"
    ],
    "cleanup": [
     "*"
    ],
    "sources": [
     {
      "type": "script",
      "dest-filename": "node-gyp",
      "commands": [
       "node /usr/lib/sdk/node18/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js $@"
      ]
     }
    ]
   },
   {
    "name": "whalebird",
    "buildsystem": "simple",
    "build-options": {
     "append-path": "/usr/lib/sdk/node18/bin",
     "env": {
      "npm_config_nodedir": "/usr/lib/sdk/node18",
      "XDG_CACHE_HOME": "/run/build/whalebird/flatpak-node/cache/",
      "ELECTRON_SKIP_BINARY_DOWNLOAD": "1",
      "OFFLINE": "1",
      "TMPDIR": "/run/build/whalebird/flatpak-node/tmp"
     }
    },
    "build-commands": [
     "jq 'del(.linux.target)'  <<<$(<electron-builder.json) > electron-builder.json",
     "jq '.linux.target[0].target=\"dir\"' <<<$(<electron-builder.json) > electron-builder.json",
     "HOME=$PWD yarn config --offline set yarn-offline-mirror ./flatpak-node/yarn-mirror",
     "HOME=$PWD yarn config --offline set better-sqlite3_local_prebuilds \"${PWD}/flatpak-node/prebuild-mirror\"",
     "yarn --offline",
     "yarn --offline build",
     "yarn --offline package:linux",
     "cp -r build/linux-*unpacked /app/whalebird",
     "install -Dm755 -t /app/bin ./start-whalebird.sh"
    ],
    "post-install": [
     "install -D flatpak-data/social.whalebird.WhalebirdDesktop.desktop -t /app/share/applications/",
     "install -D flatpak-data/social.whalebird.WhalebirdDesktop.metainfo.xml -t /app/share/metainfo/",
     "install -Dm644 build/icons/icon.iconset/icon_16x16.png /app/share/icons/hicolor/16x16/apps/$FLATPAK_ID.png",
     "install -Dm644 build/icons/icon.iconset/icon_32x32.png /app/share/icons/hicolor/32x32/apps/$FLATPAK_ID.png",
     "install -Dm644 build/icons/icon.iconset/icon_128x128.png /app/share/icons/hicolor/128x128/apps/$FLATPAK_ID.png",
     "install -Dm644 build/icons/icon.iconset/icon_256x256.png /app/share/icons/hicolor/256x256/apps/$FLATPAK_ID.png"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/h3poteto/whalebird-desktop.git",
      "tag": "v5.1.1",
      "commit": "edaff504169f00013bbbc551f04944e2bf5ee047"
     },
     {
      "type": "file",
      "url": "https://github.com/WiseLibs/better-sqlite3/releases/download/v8.2.0/better-sqlite3-v8.2.0-electron-v110-linux-x64.tar.gz",
      "sha256": "b157a5c4adf3a0b2170a865e15b43c47f15f3949639ff48dfea3791dfcefec7f",
      "dest": "flatpak-node/prebuild-mirror"
     },
     {
      "type": "script",
      "dest-filename": "start-whalebird.sh",
      "commands": [
       "export TMPDIR=$XDG_RUNTIME_DIR/app/$FLATPAK_ID",
       "FLATPAK_HOST=1 zypak-wrapper.sh /app/whalebird/whalebird \"$@\""
      ]
     },
     "generated-sources.json"
    ]
   }
  ]
 }
}