{
 "app_id": "net.shadps4.shadPS4",
 "source_url": "https://raw.githubusercontent.com/flathub/net.shadps4.shadPS4/master/net.shadps4.shadPS4.yaml",
 "runtime": "org.kde.Platform",
 "runtime_version": "6.11",
 "sdk": "org.kde.Sdk",
 "finish_args": [
  "--share=ipc",
  "--share=network",
  "--socket=fallback-x11",
  "--socket=pulseaudio",
  "--socket=wayland",
  "--device=all",
  "--filesystem=home",
  "--filesystem=/media",
  "--filesystem=xdg-config/kdeglobals:ro",
  "--filesystem=/run/media",
  "--filesystem=xdg-run/gamescope-0:ro",
  "--filesystem=xdg-run/app/com.discordapp.Discord:create",
  "--filesystem=xdg-run/discord-ipc-0",
  "--allow=bluetooth",
  "--talk-name=com.canonical.AppMenu.Registrar",
  "--talk-name=org.kde.kconfig.notify",
  "--talk-name=org.kde.KGlobalSettings",
  "--talk-name=org.kde.StatusNotifierWatcher"
 ],
 "module_count": 4,
 "fetched_at": "2026-09-18T12:13:40.929434+00:00",
 "manifest": {
  "app-id": "net.shadps4.shadPS4",
  "runtime": "org.kde.Platform",
  "runtime-version": "6.11",
  "sdk": "org.kde.Sdk",
  "command": "net.shadps4.shadPS4.sh",
  "finish-args": [
   "--device=all",
   "--allow=bluetooth",
   "--socket=wayland",
   "--socket=fallback-x11",
   "--share=ipc",
   "--socket=pulseaudio",
   "--filesystem=home",
   "--filesystem=/media",
   "--filesystem=/run/media",
   "--filesystem=xdg-run/gamescope-0:ro",
   "--filesystem=xdg-run/discord-ipc-0",
   "--filesystem=xdg-run/app/com.discordapp.Discord:create",
   "--talk-name=org.kde.StatusNotifierWatcher",
   "--share=network"
  ],
  "sdk-extensions": [
   "org.freedesktop.Sdk.Extension.llvm21"
  ],
  "modules": [
   {
    "name": "shadps4-qtlauncher",
    "buildsystem": "cmake-ninja",
    "builddir": true,
    "build-options": {
     "append-path": "/usr/lib/sdk/llvm21/bin",
     "prepend-ld-library-path": "/usr/lib/sdk/llvm21/lib"
    },
    "config-opts": [
     "-DENABLE_UPDATER=OFF",
     "-DHIDE_VERSION_MANAGER=ON",
     "-DCMAKE_C_COMPILER=clang",
     "-DCMAKE_CXX_COMPILER=clang++",
     "-DCMAKE_BUILD_TYPE=RelWithDebInfo",
     "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO=ON"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/shadps4-emu/shadps4-qtlauncher.git",
      "tag": "shadPS4QtLauncher-2026-09-12-864dc30bc5372d7ad95ef609188942ecd77bf6f4",
      "commit": "864dc30bc5372d7ad95ef609188942ecd77bf6f4",
      "x-checker-data": {
       "type": "json",
       "url": "https://api.github.com/repos/shadps4-emu/shadps4-qtlauncher/releases",
       "tag-query": ".[0].tag_name",
       "version-query": ".[0].tag_name | capture(\".*(?<v>\\\\d{4}-\\\\d{2}-\\\\d{2})\").v"
      }
     },
     {
      "type": "file",
      "path": "dist/versions.json"
     },
     {
      "type": "file",
      "path": "dist/qt_ui.ini"
     },
     {
      "type": "script",
      "dest-filename": "net.shadps4.shadPS4.sh",
      "commands": [
       "for i in {0..9}; do\n  if [[ ! -S \"${XDG_RUNTIME_DIR}/discord-ipc-$i\" ]]; then\n    ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-$i\n  fi\ndone\nmkdir -p \"${XDG_DATA_HOME}/shadPS4QtLauncher/\"\nfor config_file in versions.json qt_ui.ini; do\n  if [[ ! -f ${XDG_DATA_HOME}/shadPS4QtLauncher/${config_file} ]]; then\n    echo \"Installing default ${config_file}...\"\n    cp /app/etc/default/shadps4/${config_file} ${XDG_DATA_HOME}/shadPS4QtLauncher/\n  fi\ndone\nshadPS4QtLauncher \"$@\"\n"
      ]
     }
    ],
    "post-install": [
     "mv /app/share/applications/net.shadps4.shadps4-qtlauncher.desktop /app/share/applications/${FLATPAK_ID}.desktop",
     "desktop-file-edit --set-key=Exec --set-value=${FLATPAK_ID}.sh /app/share/applications/${FLATPAK_ID}.desktop",
     "install -D -m755 -t /app/bin/ ${FLATPAK_BUILDER_BUILDDIR}/${FLATPAK_ID}.sh",
     "install -D -m644 -t /app/etc/default/shadps4 ${FLATPAK_BUILDER_BUILDDIR}/versions.json",
     "install -D -m644 -t /app/etc/default/shadps4 ${FLATPAK_BUILDER_BUILDDIR}/qt_ui.ini"
    ]
   },
   {
    "name": "fmtlib",
    "buildsystem": "cmake-ninja",
    "builddir": true,
    "build-options": {
     "append-path": "/usr/lib/sdk/llvm21/bin",
     "prepend-ld-library-path": "/usr/lib/sdk/llvm21/lib"
    },
    "config-opts": [
     "-DCMAKE_CXX_COMPILER=clang++",
     "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/fmtlib/fmt/releases/download/12.1.0/fmt-12.1.0.zip",
      "sha256": "695fd197fa5aff8fc67b5f2bbc110490a875cdf7a41686ac8512fb480fa8ada7"
     }
    ],
    "cleanup": [
     "/include",
     "/lib"
    ]
   },
   {
    "name": "abseil",
    "buildsystem": "cmake-ninja",
    "builddir": true,
    "build-options": {
     "append-path": "/usr/lib/sdk/llvm21/bin",
     "prepend-ld-library-path": "/usr/lib/sdk/llvm21/lib"
    },
    "config-opts": [
     "-DCMAKE_CXX_COMPILER=clang++",
     "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/abseil/abseil-cpp/releases/download/20250512.1/abseil-cpp-20250512.1.tar.gz",
      "sha256": "9b7a064305e9fd94d124ffa6cc358592eb42b5da588fb4e07d09254aa40086db"
     }
    ],
    "cleanup": [
     "/include",
     "/lib"
    ]
   },
   {
    "name": "shadps4",
    "buildsystem": "cmake-ninja",
    "builddir": true,
    "build-options": {
     "append-path": "/usr/lib/sdk/llvm21/bin",
     "prepend-ld-library-path": "/usr/lib/sdk/llvm21/lib"
    },
    "config-opts": [
     "-DCMAKE_C_COMPILER=clang",
     "-DCMAKE_CXX_COMPILER=clang++",
     "-DCMAKE_BUILD_TYPE=RelWithDebInfo",
     "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO=ON",
     "-DENABLE_SYSTEM_LIBRARIES=ON",
     "-DSPDLOG_FMT_EXTERNAL=ON",
     "-Dprotobuf_FORCE_FETCH_DEPENDENCIES=OFF",
     "-Dprotobuf_LOCAL_DEPENDENCIES_ONLY=ON"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/shadps4-emu/shadPS4.git",
      "tag": "v.0.18.0",
      "commit": "e3ce810f3a653f43ac64ebab63023de281a4103a",
      "x-checker-data": {
       "type": "json",
       "url": "https://api.github.com/repos/shadps4-emu/shadps4/releases/latest",
       "tag-query": ".tag_name",
       "version-query": ".tag_name | sub(\"^v.\"; \"\")"
      }
     },
     {
      "type": "file",
      "path": "dist/net.shadps4.shadPS4.metainfo.xml"
     },
     {
      "type": "patch",
      "path": "patches/net.shadps4.shadPS4.protobuf.patch"
     }
    ],
    "post-install": [
     "install -D -m755 -t /app/share/metainfo/ ${FLATPAK_BUILDER_BUILDDIR}/${FLATPAK_ID}.metainfo.xml"
    ]
   }
  ]
 }
}