{
 "app_id": "org.srb2.SRB2Kart-Saturn",
 "source_url": "https://raw.githubusercontent.com/flathub/org.srb2.SRB2Kart-Saturn/master/org.srb2.SRB2Kart-Saturn.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=xdg-run/app/com.discordapp.Discord:create",
  "--filesystem=xdg-run/discord-ipc-0"
 ],
 "module_count": 9,
 "fetched_at": "2026-09-19T13:12:38.732735+00:00",
 "manifest": {
  "app-id": "org.srb2.SRB2Kart-Saturn",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "25.08",
  "sdk": "org.freedesktop.Sdk",
  "command": "srb2kart.sh",
  "finish-args": [
   "--share=ipc",
   "--share=network",
   "--socket=fallback-x11",
   "--socket=pulseaudio",
   "--socket=wayland",
   "--device=all",
   "--persist=.srb2kart",
   "--filesystem=xdg-run/app/com.discordapp.Discord:create",
   "--filesystem=xdg-run/discord-ipc-0"
  ],
  "add-extensions": {
   "com.valvesoftware.Steam.Utility.gamescope": {
    "version": "stable",
    "add-ld-path": "lib",
    "no-autodownload": true,
    "autodelete": true,
    "directory": "utils/gamescope"
   }
  },
  "cleanup-commands": [
   "mkdir -p /app/utils/gamescope"
  ],
  "modules": [
   "shared-modules/glu/glu-9.json",
   {
    "name": "game-music-emu",
    "buildsystem": "cmake-ninja",
    "cleanup": [
     "/include",
     "/lib/*.so",
     "/lib/pkgconfig"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/libgme/game-music-emu/archive/refs/tags/0.6.5.tar.gz",
      "sha256": "8531678502451c2cf04248cda45c8b4645e19fcfb63e6a7ec2549641c47bb392",
      "x-checker-data": {
       "type": "anitya",
       "project-id": 866,
       "stable-only": true,
       "url-template": "https://github.com/libgme/game-music-emu/archive/refs/tags/$version.tar.gz"
      }
     }
    ]
   },
   {
    "name": "libmodplug",
    "buildsystem": "autotools",
    "cleanup": [
     "/include",
     "/lib/*.la",
     "/lib/pkgconfig"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://sourceforge.net/projects/modplug-xmms/files/libmodplug/0.8.9.0/libmodplug-0.8.9.0.tar.gz",
      "sha256": "457ca5a6c179656d66c01505c0d95fafaead4329b9dbaa0f997d00a3508ad9de",
      "x-checker-data": {
       "type": "anitya",
       "project-id": 5669,
       "url-template": "https://sourceforge.net/projects/modplug-xmms/files/libmodplug/$version/libmodplug-$version.tar.gz"
      }
     }
    ]
   },
   {
    "name": "rapidjson",
    "buildsystem": "cmake-ninja",
    "config-opts": [
     "-DRAPIDJSON_BUILD_DOC=OFF",
     "-DRAPIDJSON_BUILD_EXAMPLES=OFF",
     "-DRAPIDJSON_BUILD_TESTS=OFF",
     "-DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF"
    ],
    "cleanup": [
     "/include",
     "/lib/cmake",
     "/lib/pkgconfig",
     "/share/doc"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/Tencent/rapidjson",
      "commit": "24b5e7a8b27f42fa16b96fc70aade9106cf7102f"
     }
    ]
   },
   {
    "name": "discord-rpc",
    "buildsystem": "cmake-ninja",
    "config-opts": [
     "-DBUILD_SHARED_LIBS=ON",
     "-DBUILD_EXAMPLES=OFF"
    ],
    "cleanup": [
     "/include"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/harmonytf/discord-rpc.git",
      "commit": "deedb52ce511728458641783cb6d80c7bbdde38c"
     }
    ]
   },
   {
    "name": "libopenmpt",
    "config-opts": [
     "--disable-examples",
     "--disable-openmpt123",
     "--disable-static",
     "--disable-tests",
     "--without-portaudio",
     "--without-portaudiocpp"
    ],
    "cleanup": [
     "/include",
     "/lib/*.la",
     "/lib/*.so",
     "/lib/pkgconfig",
     "/share/doc"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-0.8.9+release.autotools.tar.gz",
      "sha256": "d7ce84fd05d686c4bcf66af40eae857afa371442db60eeda3f874bd6cf6fc318",
      "x-checker-data": {
       "type": "anitya",
       "project-id": 141468,
       "stable-only": true,
       "url-template": "https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-$version+release.autotools.tar.gz"
      }
     }
    ]
   },
   {
    "name": "libbacktrace",
    "buildsystem": "autotools",
    "no-autogen": true,
    "build-options": {
     "strip": false,
     "no-debuginfo": true
    },
    "cleanup": [
     "/include",
     "/lib/*.a",
     "/lib/*.la"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/ianlancetaylor/libbacktrace.git",
      "commit": "793921876c981ce49759114d7bb89bb89b2d3a2d"
     }
    ]
   },
   {
    "name": "srb2kart",
    "buildsystem": "simple",
    "build-options": {
     "arch": {
      "aarch64": {
       "env": {
        "ARCH_MAKE_ARGS": "LINUX64=1"
       }
      },
      "x86_64": {
       "env": {
        "ARCH_MAKE_ARGS": "LINUX64=1 X86_64=1"
       }
      }
     }
    },
    "build-commands": [
     "make -C src -j $FLATPAK_BUILDER_N_JOBS NOUPX=1 SDL=1 HAVE_DISCORDRPC=1 $ARCH_MAKE_ARGS",
     "install -D -m 755 /run/build/srb2kart/bin/lsdl2srb2kart $FLATPAK_DEST/bin/srb2kart",
     "install -D -m 644 srb2.png $FLATPAK_DEST/share/icons/hicolor/256x256/apps/$FLATPAK_ID.png",
     "install -D -m 644 src/sdl/srb2icon.png $FLATPAK_DEST/share/icons/hicolor/64x64/apps/$FLATPAK_ID.png",
     "install -D -m 755 srb2kart.sh $FLATPAK_DEST/bin/srb2kart.sh",
     "install -D -m 644 -t $FLATPAK_DEST/share/applications org.srb2.SRB2Kart-Saturn.desktop",
     "install -D -m 644 -t $FLATPAK_DEST/share/metainfo $FLATPAK_ID.metainfo.xml"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/Indev450/SRB2Kart-Saturn.git",
      "commit": "e16546db12f6aa39f09bcd0605372a9228015603"
     },
     {
      "type": "file",
      "path": "srb2kart.sh"
     },
     {
      "type": "file",
      "path": "org.srb2.SRB2Kart-Saturn.metainfo.xml"
     }
    ]
   },
   {
    "name": "srb2kart-assets",
    "buildsystem": "simple",
    "build-commands": [
     "install -t $FLATPAK_DEST/bin apply_extra"
    ],
    "sources": [
     {
      "type": "extra-data",
      "filename": "Data.zip",
      "url": "https://github.com/STJr/Kart-Public/releases/download/v1.6/AssetsLinuxOnly.zip",
      "sha256": "7a384fb99d42f0cf41d12e3ed873754f9a5ba2b993d5e54bde7962bea3accdd1",
      "size": 220991971
     },
     {
      "type": "extra-data",
      "filename": "saturn-assets.zip",
      "url": "https://github.com/Indev450/SRB2Kart-Saturn/releases/download/v10/Saturn-Extra-Files-v10.zip",
      "sha256": "3d11d28d952e4dff1f6881a831cecd611077d0b1d46167d3855e781bdf102b53",
      "size": 29104
     },
     {
      "type": "script",
      "commands": [
       "unzip Data.zip *.kart srb2.srb mdls* > /dev/null",
       "unzip saturn-assets.zip > /dev/null",
       "rm Data.zip saturn-assets.zip"
      ],
      "dest-filename": "apply_extra"
     }
    ]
   }
  ]
 }
}