{
 "app_id": "com.jgraph.drawio.desktop",
 "source_url": "https://raw.githubusercontent.com/flathub/com.jgraph.drawio.desktop/master/com.jgraph.drawio.desktop.yaml",
 "runtime": "org.freedesktop.Platform",
 "runtime_version": "25.08",
 "sdk": "org.freedesktop.Sdk",
 "finish_args": [
  "--share=ipc",
  "--share=network",
  "--socket=fallback-x11",
  "--socket=wayland",
  "--device=dri",
  "--filesystem=home"
 ],
 "module_count": 1,
 "fetched_at": "2026-09-17T16:08:12.246867+00:00",
 "manifest": {
  "app-id": "com.jgraph.drawio.desktop",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "25.08",
  "sdk": "org.freedesktop.Sdk",
  "base": "org.electronjs.Electron2.BaseApp",
  "base-version": "25.08",
  "sdk-extensions": [
   "org.freedesktop.Sdk.Extension.node24"
  ],
  "command": "run.sh",
  "separate-locales": false,
  "finish-args": [
   "--share=ipc",
   "--share=network",
   "--socket=wayland",
   "--socket=fallback-x11",
   "--filesystem=home",
   "--device=dri",
   "--env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons"
  ],
  "build-options": {
   "append-path": "/usr/lib/sdk/node24/bin",
   "cflags": "-O2 -g",
   "cxxflags": "-O2 -g",
   "env": {
    "NPM_CONFIG_LOGLEVEL": "info"
   }
  },
  "modules": [
   {
    "name": "drawio",
    "buildsystem": "simple",
    "build-options": {
     "env": {
      "XDG_CACHE_HOME": "/run/build/drawio/flatpak-node/cache"
     }
    },
    "build-commands": [
     "npm config set cache $FLATPAK_BUILDER_BUILDDIR/flatpak-node/npm-cache --location=project",
     "npm ci --offline --ignore-scripts",
     "npm run sync --offline",
     "cp -rL flatpak-node/cache/node-gyp flatpak-node/cache/node-gyp-resolved",
     "rm -rf flatpak-node/cache/node-gyp",
     "mv flatpak-node/cache/node-gyp-resolved flatpak-node/cache/node-gyp",
     "mkdir -p flatpak-node/electron-dist",
     "unzip -q flatpak-node/cache/electron/electron-v*-linux-*.zip -d flatpak-node/electron-dist",
     ". flatpak-node/electron-builder-arch-args.sh; npm run release-linux --offline -- --linux dir -c.electronDist=flatpak-node/electron-dist",
     "cp -a dist/linux*unpacked $FLATPAK_DEST/main",
     "install -D -m 644 build/icon.svg $FLATPAK_DEST/share/icons/hicolor/scalable/apps/$FLATPAK_ID.svg",
     "for size in 16 32 48 64 96 128 192 256 512; do install -d $FLATPAK_DEST/share/icons/hicolor/${size}x${size}/apps; rsvg-convert -w $size -h $size -o $FLATPAK_DEST/share/icons/hicolor/${size}x${size}/apps/$FLATPAK_ID.png build/icon.svg; done",
     "install -D -m 755 -t $FLATPAK_DEST/bin run.sh",
     "install -D -m 644 -t $FLATPAK_DEST/share/applications $FLATPAK_ID.desktop",
     "install -D -m 644 -t $FLATPAK_DEST/share/metainfo $FLATPAK_ID.metainfo.xml",
     "install -D -m 644 -t $FLATPAK_DEST/share/mime/packages $FLATPAK_ID-mime.xml"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/jgraph/drawio-desktop.git",
      "tag": "v31.4.5",
      "commit": "325440d84862607a8f17a1531da185c3c92bacd7",
      "x-checker-data": {
       "type": "json",
       "url": "https://api.github.com/repos/jgraph/drawio-desktop/releases/latest",
       "tag-query": ".tag_name",
       "version-query": "$tag | sub(\"^v\"; \"\")",
       "timestamp-query": ".published_at"
      }
     },
     "generated-sources.json",
     {
      "type": "script",
      "dest-filename": "run.sh",
      "commands": [
       "export TMPDIR=\"$XDG_RUNTIME_DIR/app/$FLATPAK_ID\"",
       "exec zypak-wrapper /app/main/drawio --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime \"$@\""
      ]
     },
     {
      "type": "file",
      "path": "com.jgraph.drawio.desktop.desktop"
     },
     {
      "type": "file",
      "path": "com.jgraph.drawio.desktop.metainfo.xml"
     },
     {
      "type": "file",
      "path": "com.jgraph.drawio.desktop-mime.xml"
     }
    ]
   }
  ]
 }
}