{
 "app_id": "app.xmcl.voxelum",
 "source_url": "https://raw.githubusercontent.com/flathub/app.xmcl.voxelum/master/app.xmcl.voxelum.yaml",
 "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=all",
  "--filesystem=~/.minecraft:create",
  "--filesystem=xdg-run/app/com.discordapp.Discord:create",
  "--filesystem=/run/udev:ro",
  "--filesystem=xdg-run/app/dev.vencord.Vencord:create",
  "--filesystem=xdg-download:ro",
  "--filesystem=/sys/kernel/mm/transparent_hugepage:ro",
  "--filesystem=xdg-run/discord-ipc-*:ro",
  "--filesystem=xdg-run/app/io.github.spacingbat3.webcord:create",
  "--filesystem=xdg-run/pipewire-0",
  "--filesystem=/sys/kernel/mm/hugepages:ro",
  "--filesystem=~/.minecraftx:create",
  "--talk-name=org.kde.StatusNotifierWatcher",
  "--talk-name=org.freedesktop.Notifications",
  "--talk-name=com.feralinteractive.GameMode"
 ],
 "module_count": 7,
 "fetched_at": "2026-09-17T16:06:32.304223+00:00",
 "manifest": {
  "app-id": "app.xmcl.voxelum",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "25.08",
  "sdk": "org.freedesktop.Sdk",
  "base": "org.electronjs.Electron2.BaseApp",
  "base-version": "25.08",
  "command": "xmcl-wrapper.sh",
  "finish-args": [
   "--share=ipc",
   "--socket=wayland",
   "--socket=fallback-x11",
   "--device=all",
   "--share=network",
   "--socket=pulseaudio",
   "--talk-name=org.kde.StatusNotifierWatcher",
   "--talk-name=org.freedesktop.Notifications",
   "--talk-name=com.feralinteractive.GameMode",
   "--env=PULSE_PROP=media.role=game",
   "--env=PULSE_LATENCY_MSEC=60",
   "--filesystem=xdg-run/pipewire-0",
   "--filesystem=~/.minecraftx:create",
   "--filesystem=~/.minecraft:create",
   "--filesystem=xdg-download:ro",
   "--filesystem=/run/udev:ro",
   "--filesystem=xdg-run/app/com.discordapp.Discord:create",
   "--filesystem=xdg-run/app/dev.vencord.Vencord:create",
   "--filesystem=xdg-run/app/io.github.spacingbat3.webcord:create",
   "--filesystem=xdg-run/discord-ipc-*:ro",
   "--filesystem=/sys/kernel/mm/hugepages:ro",
   "--filesystem=/sys/kernel/mm/transparent_hugepage:ro",
   "--env=ELECTRON_ENABLE_STACK_DUMPING=false",
   "--env=ELECTRON_ENABLE_LOGGING=false"
  ],
  "cleanup": [
   "/include",
   "/lib/pkgconfig"
  ],
  "modules": [
   "shared-modules/libusb/libusb.json",
   {
    "name": "flite",
    "buildsystem": "autotools",
    "config-opts": [
     "--enable-shared"
    ],
    "no-parallel-make": true,
    "cleanup": [
     "/bin",
     "/include",
     "*.a"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/festvox/flite.git",
      "tag": "v2.2",
      "commit": "e9e2e37c329dbe98bfeb27a1828ef9a71fa84f88",
      "x-checker-data": {
       "type": "git",
       "tag-pattern": "^v([\\d.]+)$"
      }
     }
    ]
   },
   {
    "name": "xrandr",
    "buildsystem": "autotools",
    "sources": [
     {
      "type": "archive",
      "url": "https://xorg.freedesktop.org/archive/individual/app/xrandr-1.5.3.tar.xz",
      "sha256": "f8dd7566adb74147fab9964680b6bbadee87cf406a7fcff51718a5e6949b841c"
     }
    ],
    "cleanup": [
     "/share/man",
     "/bin/xkeystone"
    ]
   },
   {
    "name": "gamemode",
    "buildsystem": "meson",
    "config-opts": [
     "-Dwith-sd-bus-provider=no-daemon",
     "-Dwith-examples=false"
    ],
    "post-install": [
     "install -Dm755 ../data/gamemoderun -t /app/bin"
    ],
    "sources": [
     {
      "type": "archive",
      "dest-filename": "gamemode.tar.gz",
      "url": "https://api.github.com/repos/FeralInteractive/gamemode/tarball/1.8.2",
      "sha256": "2886d4ce543c78bd2a364316d5e7fd59ef06b71de63f896b37c6d3dc97658f60"
     }
    ],
    "cleanup": [
     "/include",
     "/lib/pkgconfig",
     "/lib/libgamemodeauto.a"
    ]
   },
   {
    "name": "glxinfo",
    "buildsystem": "meson",
    "config-opts": [
     "--bindir=/app/mesa-demos",
     "-Degl=disabled",
     "-Dglut=disabled",
     "-Dosmesa=disabled",
     "-Dvulkan=disabled",
     "-Dwayland=disabled"
    ],
    "post-install": [
     "mv -v /app/mesa-demos/glxinfo /app/bin"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://archive.mesa3d.org/demos/mesa-demos-9.0.0.tar.xz",
      "sha256": "3046a3d26a7b051af7ebdd257a5f23bfeb160cad6ed952329cdff1e9f1ed496b"
     }
    ],
    "cleanup": [
     "/include",
     "/mesa-demos",
     "/share"
    ],
    "modules": [
     "shared-modules/glu/glu-9.json"
    ]
   },
   {
    "name": "XMCL",
    "buildsystem": "simple",
    "build-commands": [
     "sed -i 's|^Exec=.*|Exec=xmcl-wrapper.sh %U|' metadata/${FLATPAK_ID}.desktop",
     "install -Dm644 metadata/icons/${FLATPAK_ID}.png ${FLATPAK_DEST}/share/icons/hicolor/512x512/apps/${FLATPAK_ID}.png",
     "install -Dm644 metadata/${FLATPAK_ID}.desktop ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop",
     "install -Dm644 metadata/${FLATPAK_ID}.metainfo.xml ${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml",
     "install -Dm755 xmcl-wrapper.sh ${FLATPAK_DEST}/bin/xmcl-wrapper.sh",
     "install -Dm755 prime-run ${FLATPAK_DEST}/bin/prime-run",
     "install -d ${FLATPAK_DEST}/opt/xmcl",
     "cp -ra * ${FLATPAK_DEST}/opt/xmcl/",
     "chmod +x /app/opt/xmcl/xmcl"
    ],
    "sources": [
     {
      "type": "script",
      "dest-filename": "xmcl-wrapper.sh",
      "commands": [
       "#!/bin/bash\nexport LD_LIBRARY_PATH=/app/opt/xmcl:$LD_LIBRARY_PATH\n\n# AppImage compatibility\nexport APPIMAGE=1\n\n# Fix audio spatial positioning\nexport PULSE_PROP='media.role=game'\n\n# Ensure DISPLAY is set for Minecraft (LWJGL) under Wayland/Xwayland\nif [ -z \"$DISPLAY\" ]; then\n    if [ -e \"/tmp/.X11-unix/X0\" ]; then\n        export DISPLAY=:0\n    elif [ -e \"/tmp/.X11-unix/X1\" ]; then\n        export DISPLAY=:1\n    fi\nfi\n\nARGS=(\n  \"--enable-webrtc-pipewire-capturer\"\n  \"--enable-features=VaapiVideoDecoder,VaapiVideoEncoder\"\n  \"--disable-gpu-driver-bug-workarounds\"\n)\n\nif [[ \"$XDG_SESSION_TYPE\" == \"wayland\" ]] && [ -S \"${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-0}\" ]; then\n    ARGS+=(\"--ozone-platform-hint=auto\")\n    ARGS+=(\"--enable-wayland-ime\")\nfi\n\nexec zypak-wrapper /app/opt/xmcl/xmcl \"${ARGS[@]}\" \"$@\"\n"
      ]
     },
     {
      "type": "script",
      "dest-filename": "prime-run",
      "commands": [
       "#!/bin/bash\n# Improved prime-run for hybrid graphics\n# Detects and uses discrete GPU automatically\n\n# Check for NVIDIA\nif command -v nvidia-smi &> /dev/null; then\n    export __NV_PRIME_RENDER_OFFLOAD=1\n    export __GLX_VENDOR_LIBRARY_NAME=nvidia\n    export __VK_LAYER_NV_optimus=NVIDIA_only\nfi\n\n# Check for AMD\nif lspci | grep -i 'vga.*amd' &> /dev/null; then\n    export DRI_PRIME=1\nfi\n\nexec \"$@\"\n"
      ]
     },
     {
      "type": "archive",
      "url": "https://github.com/Voxelum/x-minecraft-launcher/releases/download/v0.70.0/xmcl-0.70.0-x64.tar.xz",
      "sha256": "f419bb361d653bed2fd550dded23854d2441214b2ec48f6d17439acae2a725f5",
      "x-checker-data": {
       "type": "json",
       "url": "https://api.github.com/repos/Voxelum/x-minecraft-launcher/releases/latest",
       "version-query": ".tag_name | sub(\"^v\"; \"\")",
       "url-query": ".assets[] | select(.name | test(\"^xmcl-[0-9.]+-x64\\\\.tar\\\\.xz$\")) | .browser_download_url"
      }
     },
     {
      "type": "archive",
      "url": "https://github.com/Voxelum/flatpak-metadata/releases/download/v0.70.0/archive.tar.gz",
      "sha256": "5eb9e3c9b8f10743ee8d37263a700ed800a0ee6f4900b030102464738de44493",
      "dest": "metadata",
      "x-checker-data": {
       "type": "json",
       "url": "https://api.github.com/repos/Voxelum/flatpak-metadata/releases/latest",
       "version-query": ".tag_name | sub(\"^v\"; \"\")",
       "url-query": ".assets[] | select(.name == \"archive.tar.gz\") | .browser_download_url"
      }
     }
    ]
   }
  ]
 }
}