{
 "app_id": "com.logseq.Logseq",
 "source_url": "https://raw.githubusercontent.com/flathub/com.logseq.Logseq/master/com.logseq.Logseq.yml",
 "runtime": "org.freedesktop.Platform",
 "runtime_version": "25.08",
 "sdk": "org.freedesktop.Sdk",
 "finish_args": [
  "--share=network",
  "--share=ipc",
  "--socket=x11",
  "--socket=wayland",
  "--socket=pulseaudio",
  "--socket=ssh-auth",
  "--device=dri",
  "--filesystem=home"
 ],
 "module_count": 2,
 "fetched_at": "2026-09-17T16:08:17.060333+00:00",
 "manifest": {
  "id": "com.logseq.Logseq",
  "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.node22",
   "org.freedesktop.Sdk.Extension.openjdk11"
  ],
  "separate-locales": false,
  "writable-sdk": true,
  "command": "run.sh",
  "finish-args": [
   "--device=dri",
   "--share=ipc",
   "--socket=x11",
   "--socket=wayland",
   "--socket=pulseaudio",
   "--share=network",
   "--filesystem=home",
   "--socket=ssh-auth",
   "--env=SSH_ASKPASS=/app/libexec/openssh/ssh-askpass",
   "--env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons",
   "--persist=~/.ssh"
  ],
  "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/node22/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js $@"
      ]
     }
    ]
   },
   {
    "name": "logseq",
    "buildsystem": "simple",
    "build-options": {
     "append-path": "/usr/lib/sdk/node22/bin:/usr/lib/sdk/openjdk11/bin",
     "env": {
      "HOME": "/run/build/logseq",
      "_JAVA_OPTIONS": "-Duser.home=/run/build/logseq",
      "XDG_CACHE_HOME": "/run/build/logseq/flatpak-node/cache",
      "DUGITE_CACHE_DIR": "/run/build/logseq/flatpak-node/tmp",
      "NPM_CONFIG_LOGLEVEL": "info",
      "npm_config_target": "38.4.0",
      "npm_config_runtime": "electron",
      "npm_config_nodedir": "/run/build/logseq/flatpak-node/cache/node-gyp/38.4.0",
      "npm_config_cache": "/run/build/logseq/flatpak-node/npm-cache",
      "npm_config_offline": "true",
      "ENABLE_PLUGINS": "true",
      "ENABLE_FILE_SYNC_PRODUCTION": "true"
     }
    },
    "sources": [
     {
      "type": "file",
      "url": "https://download.clojure.org/install/linux-install-1.11.1.1413.sh",
      "sha256": "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965"
     },
     {
      "type": "file",
      "url": "https://download.clojure.org/install/clojure-tools-1.11.1.1413.tar.gz",
      "sha256": "93c3a5a3adca51c5858063419abf66c83dbf24ea15e1fd92f79bf7e662381fe0"
     },
     {
      "type": "file",
      "url": "https://github.com/desktop/dugite-native/releases/download/v2.43.4/dugite-native-v2.43.4-f5c5df6-ubuntu-arm64.tar.gz",
      "sha256": "eb8b9a9343d42fd185f5f1037bcc20b94aa1cef5b858e25f1a047662aefdc38f",
      "dest-filename": "dugite-native-v2.43.4-f5c5df6-ubuntu-arm64.tar.gz",
      "dest": "flatpak-node/tmp",
      "only-arches": [
       "aarch64"
      ]
     },
     {
      "type": "git",
      "url": "https://github.com/logseq/cljs-time",
      "commit": "5704fbf48d3478eedcf24d458c8964b3c2fd59a9",
      "dest": "libs/cljs-time"
     },
     {
      "type": "file",
      "path": "com.logseq.Logseq.desktop"
     },
     {
      "type": "file",
      "path": "com.logseq.Logseq.svg"
     },
     {
      "type": "file",
      "path": "com.logseq.Logseq.metainfo.xml"
     },
     {
      "type": "script",
      "dest-filename": "run.sh",
      "commands": [
       "zypak-wrapper.sh /app/logseq/Logseq \"$@\""
      ]
     },
     {
      "type": "archive",
      "url": "https://github.com/logseq/logseq/archive/refs/tags/0.10.15.tar.gz",
      "sha256": "ff5d28c82027d3193cf75d9d0cc8eefa00a7f054234c7f164c29845580a1cccc",
      "dest": "logseq",
      "x-checker-data": {
       "type": "anitya",
       "project-id": 291486,
       "url-template": "https://github.com/logseq/logseq/archive/refs/tags/$version.tar.gz"
      }
     },
     {
      "type": "file",
      "path": "static/yarn.lock",
      "dest": "logseq/resources"
     },
     {
      "type": "patch",
      "path": "0001-force-electron-get-skip-download-checksum-from-netwo.patch",
      "options": [
       "-d",
       "logseq"
      ]
     },
     {
      "type": "patch",
      "path": "0001-bump-pdfjs-dist-version-to-4.10.38.patch",
      "options": [
       "-d",
       "logseq"
      ]
     },
     "generated-sources.json",
     "maven-sources.json"
    ],
    "build-commands": [
     "sed -i 's/curl/#curl/' linux-install-1.11.1.1413.sh",
     "chmod +x linux-install-1.11.1.1413.sh",
     "./linux-install-1.11.1.1413.sh",
     "unzip /usr/local/lib/clojure/libexec/clojure-tools-1.11.1.1413.jar clojure/tools/gitlibs/impl.clj",
     "sed -i 's/git-fetch git-dir/do/' clojure/tools/gitlibs/impl.clj",
     "zip -u /usr/local/lib/clojure/libexec/clojure-tools-1.11.1.1413.jar clojure/tools/gitlibs/impl.clj",
     "git clone --bare libs/cljs-time .gitlibs/_repos/https/github.com/logseq/cljs-time",
     "ln -s $XDG_CACHE_HOME/node-gyp $HOME/.electron-gyp",
     "yarn --offline config set yarn-offline-mirror $FLATPAK_BUILDER_BUILDDIR/flatpak-node/yarn-mirror",
     "yarn --cwd logseq --offline install --immutable --immutable-cache --inline-builds",
     "yarn --cwd logseq --offline gulp:build",
     "yarn --cwd logseq --offline cljs:release-electron",
     "yarn --cwd logseq/static --offline install --immutable --immutable-cache --inline-builds",
     "yarn --cwd logseq/static --offline electron-forge package",
     "cp -a logseq/static/out/Logseq-linux-* /app/logseq",
     "install -Dm644 -t /app/share/icons/hicolor/scalable/apps/ com.logseq.Logseq.svg",
     "install -Dm644 -t /app/share/applications com.logseq.Logseq.desktop",
     "install -Dm644 -t /app/share/metainfo com.logseq.Logseq.metainfo.xml",
     "install -Dm755 -t /app/bin/ run.sh"
    ]
   }
  ],
  "cleanup": [
   "/logseq/resources/app/node_modules/better-sqlite3/build/Release/obj.target",
   "/logseq/resources/app/node_modules/better-sqlite3/build/Release/obj",
   "/logseq/resources/app/node_modules/better-sqlite3/build/Release/sqlite3.a",
   "*.js.map"
  ]
 }
}