{
 "app_id": "media.conduit.desktop",
 "source_url": "https://raw.githubusercontent.com/davidvanderklay/conduit/main/flatpak/media.conduit.desktop.yml",
 "runtime": "org.gnome.Platform",
 "runtime_version": "50",
 "sdk": "org.gnome.Sdk",
 "finish_args": [
  "--share=ipc",
  "--share=network",
  "--socket=x11",
  "--socket=wayland",
  "--socket=pulseaudio",
  "--device=dri",
  "--filesystem=xdg-download",
  "--talk-name=org.gnome.SessionManager",
  "--talk-name=org.freedesktop.ScreenSaver"
 ],
 "module_count": 10,
 "fetched_at": "2026-10-05T15:46:52.426396+00:00",
 "manifest": {
  "app-id": "media.conduit.desktop",
  "runtime": "org.gnome.Platform",
  "runtime-version": "50",
  "sdk": "org.gnome.Sdk",
  "appstream-compose": false,
  "sdk-extensions": [
   "org.freedesktop.Sdk.Extension.node24"
  ],
  "command": "conduit",
  "finish-args": [
   "--share=ipc",
   "--share=network",
   "--socket=x11",
   "--socket=wayland",
   "--socket=pulseaudio",
   "--device=dri",
   "--filesystem=xdg-download",
   "--talk-name=org.gnome.SessionManager",
   "--talk-name=org.freedesktop.ScreenSaver"
  ],
  "cleanup": [
   "/rust"
  ],
  "build-options": {
   "no-debuginfo": true,
   "strip": false,
   "append-path": "/app/rust/bin:/usr/lib/sdk/node24/bin",
   "env": {
    "CARGO_NET_OFFLINE": "true",
    "LIBRARY_PATH": "/app/lib",
    "PKG_CONFIG_PATH": "/app/lib64/pkgconfig:/app/lib/pkgconfig:/app/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig",
    "CARGO_BUILD_JOBS": "2"
   }
  },
  "modules": [
   {
    "name": "rust-toolchain",
    "buildsystem": "simple",
    "build-commands": [
     "./install.sh --prefix=/app/rust --disable-ldconfig"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://static.rust-lang.org/dist/2026-07-16/rust-1.97.1-x86_64-unknown-linux-gnu.tar.xz",
      "sha256": "88f28fa9af20594179f85d6df67078dfd6fa93e2f6da5e1e9b0ac4997988ca4f"
     }
    ]
   },
   {
    "name": "libplacebo",
    "buildsystem": "meson",
    "config-opts": [
     "-Ddemos=false"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/haasn/libplacebo.git",
      "tag": "v7.360.1",
      "commit": "cee9b076f2c63104ccfd497fa79c39a867293ec4",
      "disable-submodules": true
     },
     {
      "type": "git",
      "url": "https://github.com/Dav1dde/glad.git",
      "commit": "73db193f853e2ee079bf3ca8a64aa2eaf6459043",
      "dest": "3rdparty/glad"
     },
     {
      "type": "git",
      "url": "https://github.com/pallets/jinja.git",
      "commit": "15206881c006c79667fe5154fe80c01c65410679",
      "dest": "3rdparty/jinja"
     },
     {
      "type": "git",
      "url": "https://github.com/pallets/markupsafe.git",
      "commit": "297fc8e356e6836a62087949245d09a28e9f1b13",
      "dest": "3rdparty/markupsafe"
     },
     {
      "type": "git",
      "url": "https://github.com/KhronosGroup/Vulkan-Headers.git",
      "commit": "450bd2232225d6c7728a4108055ac2e37cef6475",
      "dest": "3rdparty/Vulkan-Headers"
     },
     {
      "type": "git",
      "url": "https://github.com/fastfloat/fast_float.git",
      "commit": "97b54ca9e75f5303507699d27c6b4f4efe4641a1",
      "dest": "3rdparty/fast_float"
     }
    ]
   },
   {
    "name": "libass",
    "config-opts": [
     "--disable-static"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/libass/libass/releases/download/0.17.5/libass-0.17.5.tar.xz",
      "sha256": "2dca25c0e0c837ddf00b52011b3f82cac1e4ddd3ad018227806b0c2288864acc"
     }
    ]
   },
   {
    "name": "hwdata",
    "buildsystem": "autotools",
    "config-opts": [
     "--disable-blacklist"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/vcrhonek/hwdata.git",
      "tag": "v0.410",
      "commit": "8bb6c48dc2e683777e625d1c9ef02c1b25b741cd"
     }
    ]
   },
   {
    "name": "libdisplay-info",
    "buildsystem": "meson",
    "sources": [
     {
      "type": "git",
      "url": "https://gitlab.freedesktop.org/emersion/libdisplay-info.git",
      "tag": "0.4.0",
      "commit": "c67a3e9bedb05ab61c7443704a1a107e76254595"
     }
    ]
   },
   {
    "name": "libXpresent",
    "buildsystem": "simple",
    "build-commands": [
     "./configure --prefix=/app",
     "make -j${FLATPAK_BUILDER_N_JOBS}",
     "make install"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://mirror.csclub.uwaterloo.ca/x.org/individual/lib/libXpresent-1.0.1.tar.xz",
      "sha256": "b964df9e5a066daa5e08d2dc82692c57ca27d00b8cc257e8e960c9f1cf26231b"
     }
    ]
   },
   {
    "name": "libmpv",
    "buildsystem": "meson",
    "config-opts": [
     "-Dcplayer=false",
     "-Dlibmpv=true",
     "-Dbuild-date=false",
     "-Ddrm=enabled",
     "-Dx11=enabled",
     "-Degl-x11=enabled",
     "-Dvaapi=enabled",
     "-Dvaapi-drm=enabled",
     "-Dalsa=disabled",
     "-Djavascript=disabled",
     "-Dlibarchive=disabled",
     "-Dlua=disabled",
     "-Dmanpage-build=disabled",
     "-Drubberband=disabled",
     "-Duchardet=disabled"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/mpv-player/mpv/archive/refs/tags/v0.41.0.tar.gz",
      "sha256": "ee21092a5ee427353392360929dc64645c54479aefdb5babc5cfbb5fad626209"
     }
    ]
   },
   {
    "name": "wasm-pack",
    "buildsystem": "simple",
    "build-options": {
     "env": {
      "CARGO_HOME": "/run/build/wasm-pack/cargo"
     }
    },
    "build-commands": [
     "cargo build --offline --release",
     "install -Dm755 target/release/wasm-pack /app/bin/wasm-pack"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/wasm-bindgen/wasm-pack/archive/refs/tags/v0.15.0.tar.gz",
      "sha256": "04530d7c215a46cc5468796de3c69fd6620fd78612578545d57f9806aa0c64a4"
     },
     "wasm-pack-cargo-sources.json"
    ]
   },
   {
    "name": "wasm-bindgen-cli",
    "buildsystem": "simple",
    "build-options": {
     "env": {
      "CARGO_HOME": "/run/build/wasm-bindgen-cli/cargo"
     }
    },
    "build-commands": [
     "cargo build --offline --release --package wasm-bindgen-cli",
     "install -Dm755 target/release/wasm-bindgen /app/bin/wasm-bindgen",
     "install -Dm755 target/release/wasm-bindgen-test-runner /app/bin/wasm-bindgen-test-runner"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/wasm-bindgen/wasm-bindgen/archive/refs/tags/0.2.126.tar.gz",
      "sha256": "e833a30612948a00ca3d4e58247cefa00460f33dcd25d0fc1e303f9c0eeed802"
     },
     {
      "type": "file",
      "path": "wasm-bindgen-Cargo.lock",
      "dest-filename": "Cargo.lock"
     },
     "wasm-bindgen-cargo-sources.json"
    ]
   },
   {
    "name": "conduit",
    "buildsystem": "simple",
    "build-options": {
     "env": {
      "CARGO_HOME": "/run/build/conduit/cargo",
      "XDG_CACHE_HOME": "/run/build/conduit/flatpak-node/cache"
     }
    },
    "cleanup": [
     "/bin/pnpm",
     "/bin/wasm-bindgen",
     "/bin/wasm-bindgen-test-runner",
     "/bin/wasm-pack",
     "/include",
     "/lib/*.la",
     "/lib/pkgconfig"
    ],
    "build-commands": [
     "cp -a /app/rust rust-toolchain",
     "rust-std-wasm32-unknown-unknown/install.sh --prefix=\"$PWD/rust-toolchain\" --disable-ldconfig",
     "mv rust-toolchain/bin/rustc rust-toolchain/bin/rustc-real",
     "install -Dm755 rustc-wrapper rust-toolchain/bin/rustc",
     "install -Dm755 pnpm-wrapper /app/bin/pnpm",
     "pnpm install --offline --frozen-lockfile",
     "mkdir -p /run/build/conduit/cargo && printf '[source.crates-io]\\nreplace-with = \"vendored-sources\"\\n[source.vendored-sources]\\ndirectory = \"/run/build/conduit/cargo/vendor\"\\n' > /run/build/conduit/cargo/config.toml",
     "PATH=\"$PWD/rust-toolchain/bin:$PATH\" wasm-pack build packages/core --target web --out-dir pkg --no-opt",
     "pnpm --filter @conduit/web build",
     "pnpm --filter @conduit/desktop electron:main:build",
     "cargo build --offline --release -p conduit-electron-native --features linux-helper",
     "install -Dm755 target/release/conduit-electron-native /app/bin/conduit-electron-native",
     "mkdir -p /app/lib/conduit/resources/app/electron /app/lib/conduit/resources/web",
     "unzip -q flatpak-node/cache/electron/electron-v*-linux-*.zip -d /app/lib/conduit",
     "mv /app/lib/conduit/electron /app/lib/conduit/conduit",
     "node scripts/seed-flatpak-pnpm-metadata.mjs",
     "pnpm --filter @conduit/desktop deploy --prod --legacy --offline /run/build/conduit/desktop-runtime",
     "cp -a /run/build/conduit/desktop-runtime/node_modules /app/lib/conduit/resources/app/",
     "cp -a apps/desktop/electron/dist /app/lib/conduit/resources/app/electron/",
     "cp -a apps/web/dist/. /app/lib/conduit/resources/web/",
     "install -Dm644 apps/desktop/package.json /app/lib/conduit/resources/app/package.json",
     "install -Dm755 conduit-flatpak-wrapper /app/bin/conduit",
     "install -Dm644 flatpak/media.conduit.desktop.desktop /app/share/applications/media.conduit.desktop.desktop",
     "install -Dm644 flatpak/media.conduit.desktop.metainfo.xml /app/share/metainfo/media.conduit.desktop.metainfo.xml",
     "install -Dm644 apps/desktop/icons/icon.png /app/share/icons/hicolor/512x512/apps/media.conduit.desktop.png"
    ],
    "sources": [
     "cargo-sources.json",
     "node-sources.json",
     {
      "type": "archive",
      "url": "https://registry.npmjs.org/pnpm/-/pnpm-10.14.0.tgz",
      "sha256": "297534e65d5842450539c1e8022c8831ab5e1fe2eb74664787a815519542d620",
      "dest": "pnpm"
     },
     {
      "type": "archive",
      "url": "https://static.rust-lang.org/dist/2026-07-16/rust-std-1.97.1-wasm32-unknown-unknown.tar.xz",
      "sha256": "fa0edb6e9f34faae5735554d62d50875eded839dc707d0f1c01467a918d8453b",
      "dest": "rust-std-wasm32-unknown-unknown"
     },
     {
      "type": "script",
      "dest-filename": "pnpm-wrapper",
      "commands": [
       "exec node /run/build/conduit/pnpm/bin/pnpm.cjs \"$@\""
      ]
     },
     {
      "type": "inline",
      "dest-filename": "rustc-wrapper",
      "contents": "#!/bin/sh\ntoolchain=\"$(dirname \"$0\")/..\"\nexec \"$toolchain/bin/rustc-real\" --sysroot \"$toolchain\" \"$@\"\n"
     },
     {
      "type": "script",
      "dest-filename": "conduit-flatpak-wrapper",
      "commands": [
       "unset ELECTRON_RUN_AS_NODE",
       "export NODE_ENV=production",
       "export CONDUIT_ELECTRON_OZONE=\"${CONDUIT_ELECTRON_OZONE:-x11}\"",
       "if [ -z \"${CONDUIT_ELECTRON_IN_PROCESS_GPU:-}\" ] &&\n   { [ -d /sys/module/nvidia ] || [ -e /dev/nvidiactl ]; }; then\n  export CONDUIT_ELECTRON_IN_PROCESS_GPU=1\nfi\n",
       "export CONDUIT_ELECTRON_NATIVE_PLAYER=/app/bin/conduit-electron-native",
       "export LD_LIBRARY_PATH=\"/app/lib64:/app/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"",
       "export CONDUIT_FLATPAK_TRACK=stable",
       "exec /app/lib/conduit/conduit --ozone-platform=\"$CONDUIT_ELECTRON_OZONE\" --no-sandbox \"$@\""
      ]
     },
     {
      "type": "dir",
      "path": "..",
      "skip": [
       ".flatpak-builder",
       ".git",
       "flatpak-build",
       "flatpak-repo",
       "node_modules",
       "**/node_modules",
       "target"
      ]
     }
    ]
   }
  ]
 }
}