{
 "app_id": "org.srb2.SRB2Kart",
 "source_url": "https://raw.githubusercontent.com/flathub/org.srb2.SRB2Kart/master/org.srb2.SRB2Kart.yaml",
 "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:create",
  "--filesystem=xdg-run/discord-ipc-0"
 ],
 "module_count": 8,
 "fetched_at": "2026-09-17T16:16:37.312939+00:00",
 "manifest": {
  "app-id": "org.srb2.SRB2Kart",
  "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"
  ],
  "cleanup": [
   "/include",
   "/lib/cmake",
   "/lib/pkgconfig",
   "/share/man",
   "*.la",
   "*.a"
  ],
  "modules": [
   "shared-modules/glu/glu-9.json",
   {
    "name": "libgme",
    "buildsystem": "cmake-ninja",
    "config-opts": [
     "-DCMAKE_INSTALL_LIBDIR=lib"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/libgme/game-music-emu/releases/download/0.6.4/libgme-0.6.4-src.tar.gz",
      "sha256": "6f94eac735d86bca998a7ce1170d007995191ef6d4388345a0dc5ffa1de0bafa",
      "x-checker-data": {
       "type": "anitya",
       "project-id": 866,
       "stable-only": true,
       "url-template": "https://github.com/libgme/game-music-emu/releases/download/$version/libgme-$version-src.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": "sdl2-mixer",
    "buildsystem": "autotools",
    "cleanup": [
     "/include",
     "/lib/*.la",
     "/lib/*.a",
     "/lib/pkgconfig"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.1/SDL2_mixer-2.8.1.tar.gz",
      "sha256": "cb760211b056bfe44f4a1e180cc7cb201137e4d1572f2002cc1be728efd22660",
      "x-checker-data": {
       "type": "anitya",
       "project-id": 4782,
       "url-template": "https://github.com/libsdl-org/SDL_mixer/releases/download/release-$version/SDL2_mixer-$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",
     "-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
     "-DCMAKE_INSTALL_LIBDIR=lib"
    ],
    "cleanup": [
     "/include",
     "/lib/cmake",
     "/lib/pkgconfig",
     "/share/doc"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/Tencent/rapidjson/archive/24b5e7a8b27f42fa16b96fc70aade9106cf7102f.tar.gz",
      "sha256": "2d2601a82d2d3b7e143a3c8d43ef616671391034bc46891a9816b79cf2d3e7a8"
     }
    ]
   },
   {
    "name": "discord-rpc",
    "build-options": {
     "cflags": "-O3 -Wno-error",
     "cxxflags": "-O3 -Wno-error"
    },
    "buildsystem": "cmake-ninja",
    "config-opts": [
     "-DBUILD_SHARED_LIBS=ON",
     "-DBUILD_EXAMPLES=OFF",
     "-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
     "-DCMAKE_INSTALL_LIBDIR=lib"
    ],
    "cleanup": [
     "/include"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/discord/discord-rpc.git",
      "commit": "963aa9f3e5ce81a4682c6ca3d136cddda614db33"
     }
    ]
   },
   {
    "name": "srb2kart",
    "buildsystem": "simple",
    "build-options": {
     "env": {
      "LDFLAGS": "-L/app/lib -L/app/lib64",
      "CPPFLAGS": "-I/app/include",
      "CFLAGS": "-O3 -std=gnu17 -I/app/include",
      "CXXFLAGS": "-O3 -std=gnu++17 -I/app/include",
      "PKG_CONFIG_PATH": "/app/lib/pkgconfig:/app/share/pkgconfig"
     },
     "arch": {
      "arm": {
       "env": {
        "ARCH_MAKE_ARGS": "LINUX=1 NONX86=1"
       }
      },
      "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  HAVE_GME=1 GME_CFLAGS=\"-I/app/include\" GME_LDFLAGS=\"-L/app/lib -lgme\" HAVE_LIBXMP=1 LIBXMP_CFLAGS=\"-I/app/include\" LIBXMP_LDFLAGS=\"-L/app/lib -lxmp\" HAVE_FLUIDSYNTH=1 FLUID_CFLAGS=\"-I/app/include\" FLUID_LDFLAGS=\"-L/app/lib -lfluidsynth\" $ARCH_MAKE_ARGS\n",
     "install -D -m 755 bin/Linux*/Release/lsdl2srb2kart $FLATPAK_DEST/bin/srb2kart",
     "install -D -m 644 srb2.png $FLATPAK_DEST/share/icons/hicolor/256x256/apps/$FLATPAK_ID.png",
     "install -D -m 755 srb2kart.sh $FLATPAK_DEST/bin/srb2kart.sh",
     "install -D -m 644 -t $FLATPAK_DEST/share/applications $FLATPAK_ID.desktop",
     "install -D -m 644 -t $FLATPAK_DEST/share/metainfo $FLATPAK_ID.metainfo.xml"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/STJr/Kart-Public/archive/refs/tags/v1.6.tar.gz",
      "sha256": "924489e33ebb7e41bae3b84a65be2aae2ca01e2050938bff1e702b39848958d6",
      "x-checker-data": {
       "type": "anitya",
       "project-id": 18640,
       "stable-only": true,
       "url-template": "https://github.com/STJr/Kart-Public/archive/refs/tags/v$version.tar.gz"
      }
     },
     {
      "type": "file",
      "path": "srb2kart.sh"
     },
     {
      "type": "file",
      "path": "org.srb2.SRB2Kart.desktop"
     },
     {
      "type": "file",
      "path": "org.srb2.SRB2Kart.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": "script",
      "commands": [
       "unzip Data.zip *.kart srb2.srb mdls* > /dev/null",
       "rm Data.zip"
      ],
      "dest-filename": "apply_extra"
     }
    ]
   }
  ]
 }
}