{
 "app_id": "info.cemu.Cemu",
 "source_url": "https://raw.githubusercontent.com/flathub/info.cemu.Cemu/master/info.cemu.Cemu.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=fallback-x11",
  "--device=all",
  "--filesystem=xdg-run/app/com.discordapp.Discord:ro",
  "--filesystem=~/.local/share/applications:create",
  "--filesystem=xdg-run/app/com.discordapp.DiscordCanary:ro",
  "--filesystem=xdg-run/gamescope-0:ro",
  "--filesystem=host:ro"
 ],
 "module_count": 8,
 "fetched_at": "2026-09-17T16:10:10.092444+00:00",
 "manifest": {
  "app-id": "info.cemu.Cemu",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "25.08",
  "sdk": "org.freedesktop.Sdk",
  "command": "Cemu-wrapper",
  "build-options": {
   "env": {
    "CMAKE_POLICY_VERSION_MINIMUM": "3.5"
   }
  },
  "finish-args": [
   "--device=all",
   "--socket=fallback-x11",
   "--socket=wayland",
   "--socket=pulseaudio",
   "--share=ipc",
   "--share=network",
   "--env=LC_ALL=C",
   "--filesystem=host:ro",
   "--filesystem=home/.local/share/applications:create",
   "--filesystem=xdg-run/app/com.discordapp.Discord:ro",
   "--filesystem=xdg-run/app/com.discordapp.DiscordCanary:ro",
   "--filesystem=xdg-run/gamescope-0:ro"
  ],
  "modules": [
   {
    "name": "hidapi",
    "buildsystem": "cmake-ninja",
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/libusb/hidapi/archive/refs/tags/hidapi-0.15.0.tar.gz",
      "sha256": "5d84dec684c27b97b921d2f3b73218cb773cf4ea915caee317ac8fc73cef8136",
      "x-checker-data": {
       "type": "anitya",
       "project-id": 5594,
       "stable-only": true,
       "url-template": "https://github.com/libusb/hidapi/archive/refs/tags/hidapi-$version.tar.gz"
      }
     }
    ],
    "cleanup": [
     "/include",
     "/lib/cmake",
     "/lib/pkgconfig"
    ]
   },
   {
    "name": "pugixml",
    "buildsystem": "cmake-ninja",
    "config-opts": [
     "-DBUILD_SHARED_LIBS=ON"
    ],
    "cleanup": [
     "/include",
     "/lib/cmake",
     "/lib/pkgconfig"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/zeux/pugixml/releases/download/v1.15/pugixml-1.15.tar.gz",
      "sha256": "655ade57fa703fb421c2eb9a0113b5064bddb145d415dd1f88c79353d90d511a",
      "x-checker-data": {
       "type": "anitya",
       "project-id": 3728,
       "url-template": "https://github.com/zeux/pugixml/releases/download/v$version/pugixml-$version.tar.gz"
      }
     }
    ]
   },
   {
    "name": "boost",
    "buildsystem": "simple",
    "build-commands": [
     "./bootstrap.sh --prefix=${FLATPAK_DEST} --with-toolset=gcc --with-libraries=filesystem,system,program_options,nowide",
     "./b2 install variant=release link=shared runtime-link=shared cxxflags=\"$CXXFLAGS\" linkflags=\"$LDFLAGS\" -j ${FLATPAK_BUILDER_N_JOBS}"
    ],
    "cleanup": [
     "/include",
     "/lib/cmake"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://archives.boost.org/release/1.88.0/source/boost_1_88_0.tar.bz2",
      "sha256": "46d9d2c06637b219270877c9e16155cbd015b6dc84349af064c088e9b5b12f7b",
      "x-checker-data": {
       "type": "anitya",
       "project-id": 6845,
       "stable-only": true,
       "url-template": "https://archives.boost.org/release/$version/source/boost_${major}_${minor}_${patch}.tar.bz2",
       "versions": {
        "!=": "1.87.0"
       }
      }
     }
    ]
   },
   {
    "name": "libzip",
    "buildsystem": "cmake-ninja",
    "config-opts": [
     "-DBUILD_DOC=OFF",
     "-DBUILD_EXAMPLES=OFF",
     "-DBUILD_REGRESS=OFF",
     "-DBUILD_TOOLS=OFF"
    ],
    "cleanup": [
     "/bin",
     "/include",
     "/lib/cmake",
     "/lib/pkgconfig"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://libzip.org/download/libzip-1.11.4.tar.xz",
      "mirror-urls": [
       "https://github.com/nih-at/libzip/releases/download/v1.10.1/libzip-1.10.1.tar.xz"
      ],
      "sha256": "8a247f57d1e3e6f6d11413b12a6f28a9d388de110adc0ec608d893180ed7097b",
      "x-checker-data": {
       "type": "anitya",
       "project-id": 10649,
       "url-template": "https://libzip.org/download/libzip-$version.tar.xz"
      }
     }
    ]
   },
   {
    "name": "rapidjson",
    "buildsystem": "cmake-ninja",
    "config-opts": [
     "-DRAPIDJSON_BUILD_DOC=OFF",
     "-DRAPIDJSON_BUILD_EXAMPLES=OFF",
     "-DRAPIDJSON_BUILD_TESTS=OFF"
    ],
    "cleanup": [
     "/include",
     "/lib/cmake",
     "/lib/pkgconfig",
     "/share/doc"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/Tencent/rapidjson.git",
      "commit": "a95e013b97ca6523f32da23f5095fcc9dd6067e5"
     }
    ]
   },
   {
    "name": "glm",
    "buildsystem": "cmake-ninja",
    "cleanup": [
     "*"
    ],
    "no-make-install": true,
    "post-install": [
     "install -d ${FLATPAK_DEST}/include",
     "cp -R glm ${FLATPAK_DEST}/include",
     "cp -R cmake/glm ${FLATPAK_DEST}/lib/cmake"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip",
      "sha256": "37e2a3d62ea3322e43593c34bae29f57e3e251ea89f4067506c94043769ade4c"
     }
    ]
   },
   {
    "name": "wxWidgets",
    "buildsystem": "cmake-ninja",
    "config-opts": [
     "-DwxUSE_DOC_VIEW_ARCHITECTURE=OFF",
     "-DwxUSE_HELP=OFF",
     "-DwxUSE_RICHTEXT=ON",
     "-DwxUSE_WEBVIEW=OFF",
     "-DwxUSE_STC=OFF",
     "-DwxUSE_MDI_ARCHITECTURE=OFF",
     "-DwxUSE_MDI=OFF",
     "-DwxUSE_ARCHIVE_STREAMS=OFF",
     "-DwxUSE_ACTIVEX=OFF",
     "-DwxUSE_MEDIACTRL=OFF",
     "-DwxUSE_WEBREQUEST=OFF",
     "-DwxUSE_SECRETSTORE=OFF",
     "-DwxUSE_SOUND=OFF",
     "-DwxUSE_LIBSDL=OFF",
     "-DwxUSE_RIBBON=OFF",
     "-DwxUSE_SVG=OFF",
     "-DwxUSE_WXHTML_HELP=OFF",
     "-DwxUSE_PROPGRID=ON",
     "-DwxUSE_OPENGL=ON",
     "-DwxUSE_XRC=ON"
    ],
    "cleanup": [
     "/bin",
     "/include",
     "/lib/cmake",
     "/lib/wx",
     "/share"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.8.1/wxWidgets-3.2.8.1.tar.bz2",
      "sha256": "ad0cf6c18815dcf1a6a89ad3c3d21a306cd7b5d99a602f77372ef1d92cb7d756",
      "x-checker-data": {
       "type": "anitya",
       "project-id": 5150,
       "stable-only": true,
       "url-template": "https://github.com/wxWidgets/wxWidgets/releases/download/v$version/wxWidgets-$version.tar.bz2"
      }
     }
    ]
   },
   {
    "name": "Cemu",
    "buildsystem": "cmake-ninja",
    "config-opts": [
     "-DALLOW_PORTABLE=OFF",
     "-DENABLE_VCPKG=OFF",
     "-Cfp_version_cache.txt"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/cemu-project/Cemu",
      "tag": "v2.6",
      "commit": "a6fb0a48eb437a8a41c13b782ac8ae0433bf8f98",
      "disable-submodules": true,
      "x-checker-data": {
       "is-main-source": true,
       "type": "json",
       "url": "https://api.github.com/repos/cemu-project/Cemu/releases/latest",
       "version-query": ".tag_name | sub(\"^v\"; \"\")",
       "timestamp-query": ".published_at",
       "tag-query": ".tag_name"
      }
     },
     {
      "type": "git",
      "url": "https://github.com/mozilla/cubeb",
      "commit": "2071354a69aca7ed6df3b4222e305746c2113f60",
      "dest": "dependencies/cubeb"
     },
     {
      "type": "git",
      "url": "https://github.com/Exzap/ZArchive",
      "dest": "dependencies/ZArchive",
      "tag": "v0.1.2",
      "commit": "d2c717730092c7bf8cbb033b12fd4001b7c4d932"
     },
     {
      "type": "git",
      "url": "https://github.com/ocornut/imgui",
      "dest": "dependencies/imgui",
      "commit": "f65bcf481ab34cd07d3909aab1479f409fa79f2f"
     },
     {
      "type": "script",
      "commands": [
       "for d in DiscordCanary Discord; do\n  for i in {0..9}; do\n    test -S $XDG_RUNTIME_DIR/discord-ipc-$i ||\n      ln -sf {app/com.discordapp.$d,$XDG_RUNTIME_DIR}/discord-ipc-$i;\n  done\ndone\nCemu_relwithdebinfo \"$@\"\n"
      ],
      "dest-filename": "Cemu-wrapper"
     },
     {
      "type": "script",
      "dest-filename": "dev_release_metainfo.py",
      "commands": [
       "import os\nimport xml.etree.ElementTree as ET\nmeta_file = os.environ.get('AS_META_FILE')\nversion = os.environ.get('AS_META_VERSION')\nrelease_type = os.environ.get('AS_META_TYPE')\nrelease_date = os.environ.get('AS_META_DATE')\nrelease_url = os.environ.get('AS_META_URL')\ntree = ET.parse(meta_file)\nroot = tree.getroot()\nel_releases = root.find('releases')\nfor el_release in el_releases:\n  el_releases.remove(el_release)\nel_release = ET.SubElement(el_releases, 'release')\nel_url = ET.SubElement(el_release, 'url')\nel_url.text = release_url\nel_release.attrib['type'] = release_type\nel_release.attrib['date'] = release_date\nel_release.attrib['version'] = version\nET.indent(tree, space='  ', level=0)\ntree.write(meta_file, encoding='utf8')\n"
      ]
     },
     {
      "type": "shell",
      "commands": [
       "echo \"Attempt to derive version number\"\nTAG=\"$(git describe --tag)\"\nRC=\"$?\"; if [ $RC -ne 0 ]; then exit $RC; fi\nVER=\"$(echo \"${TAG}\" | sed -E 's/v([0-9]+).([0-9]+)(-([0-9]+).*)?/\\1\\t\\2\\t\\4/g')\"\necho \"${VER}\"\nAS_META_VERSION=\"$(echo \"${VER}\" | awk -F '\\t' '{print $1 ($2 ? \".\"$2 ($3 ? \"~\"$3 : \"\") : \"\")}')\"\necho \"${AS_META_VERSION}\"\nAS_META_DATE=\"$(git log -1 --format=%ci | awk '{print $1}')\"\nAS_META_TYPE=\"$(echo \"${VER}\" | awk -F '\\t' '{print ($3 ? \"development\" : \"stable\")}')\"\nif [ \"$AS_META_TYPE\" = \"stable\" ]; then\n  AS_META_URL=\"https://github.com/cemu-project/Cemu/releases/tag/${TAG}\"\nelse\n  AS_META_URL=\"https://github.com/cemu-project/Cemu/commit/$(git rev-parse HEAD)\"\nfi\ntee fp_version_cache.txt <<CacheFile\nset(EMULATOR_VERSION_MAJOR \"$(echo \"${VER}\" | cut -f1)\" CACHE STRING \"\")\nset(EMULATOR_VERSION_MINOR \"$(echo \"${VER}\" | cut -f2)\" CACHE STRING \"\")\nset(EMULATOR_VERSION_PATCH \"$(echo \"${VER}\" | awk -F '\\t' '{print $3 ? $3 : \"0\"}')\" CACHE STRING \"\")\nCacheFile\nexport AS_META_{VERSION,DATE,TYPE,FILE,URL}\nAS_META_FILE='dist/linux/info.cemu.Cemu.metainfo.xml' python ./dev_release_metainfo.py\n"
      ]
     }
    ],
    "post-install": [
     "cp -r bin/gameProfiles ${FLATPAK_DEST}/share/Cemu/",
     "cp -r bin/resources ${FLATPAK_DEST}/share/Cemu/",
     "install -Dm644 -t ${FLATPAK_DEST}/share/appdata/ dist/linux/info.cemu.Cemu.metainfo.xml",
     "install -Dm644 -t ${FLATPAK_DEST}/share/applications/ dist/linux/info.cemu.Cemu.desktop",
     "install -Dm644 -t ${FLATPAK_DEST}/share/icons/hicolor/128x128/apps/ dist/linux/info.cemu.Cemu.png",
     "desktop-file-edit --set-key=Exec --set-value=\"${FLATPAK_DEST}/bin/Cemu-wrapper\" ${FLATPAK_DEST}/share/applications/info.cemu.Cemu.desktop",
     "install -D -t ${FLATPAK_DEST}/bin/ bin/Cemu_relwithdebinfo Cemu-wrapper"
    ]
   }
  ]
 }
}