{
 "app_id": "org.openmsx.openMSX",
 "source_url": "https://raw.githubusercontent.com/flathub/org.openmsx.openMSX/master/org.openmsx.openMSX.yaml",
 "runtime": "org.freedesktop.Platform",
 "runtime_version": "26.08",
 "sdk": "org.freedesktop.Sdk",
 "finish_args": [
  "--share=ipc",
  "--share=network",
  "--socket=pulseaudio",
  "--socket=wayland",
  "--socket=x11",
  "--device=all",
  "--filesystem=home"
 ],
 "module_count": 5,
 "fetched_at": "2026-09-17T16:16:16.067821+00:00",
 "manifest": {
  "app-id": "org.openmsx.openMSX",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "26.08",
  "sdk": "org.freedesktop.Sdk",
  "command": "openmsx",
  "finish-args": [
   "--device=all",
   "--share=ipc",
   "--share=network",
   "--socket=x11",
   "--socket=wayland",
   "--socket=pulseaudio",
   "--filesystem=home"
  ],
  "cleanup": [
   "/include",
   "/lib/pkgconfig",
   "/share/aclocal",
   "/share/man",
   "*.la",
   "*.a",
   "/share/doc"
  ],
  "modules": [
   "shared-modules/glu/glu-9.json",
   "shared-modules/glew/glew.json",
   "shared-modules/SDL2/SDL2_ttf.json",
   {
    "name": "tcl",
    "buildsystem": "autotools",
    "sources": [
     {
      "type": "archive",
      "url": "https://sf-eu-introserv-1.dl.sourceforge.net/project/tcl/Tcl/9.0.4/tcl9.0.4-src.tar.gz",
      "sha256": "d0aed49230bc02a65c1e0229e65f34590a4b037ec40d546f32573b467f7551ea"
     }
    ],
    "x-checker-data": {
     "type": "anitya",
     "project-id": 4941,
     "stable-only": true,
     "url-template": "https://prdownloads.sourceforge.net/tcl/tcl$version-src.tar.gz"
    },
    "subdir": "unix",
    "build-options": {
     "no-debuginfo": true,
     "env": {
      "TCLSH_NATIVE": "/run/build/tcl/unix/tclsh",
      "LD_LIBRARY_PATH": "/run/build/tcl/unix"
     }
    },
    "post-install": [
     "chmod 755 ${FLATPAK_DEST}/lib/libtcl*.so"
    ],
    "cleanup": [
     "/bin",
     "/man"
    ]
   },
   {
    "name": "openmsx",
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/openMSX/openMSX",
      "tag": "RELEASE_21_0",
      "commit": "cb61db762aba16752ff649990bf85e40627777af"
     },
     {
      "type": "file",
      "path": "org.openmsx.openMSX.desktop"
     },
     {
      "type": "file",
      "path": "org.openmsx.openMSX.metainfo.xml"
     },
     {
      "type": "shell",
      "commands": [
       "sed -i 's/^INSTALL_BASE.*/INSTALL_BASE:=\\/app\\/share\\/'${FLATPAK_ID}'/' build/custom.mk",
       "sed -i \"s/distroRoot = thirdPartyInstall or None/distroRoot = '\\/app'/\" build/probe.py",
       "ln -s /usr/bin/libpng-config /app/bin/libpng-config",
       "ln -s /usr/bin/sdl2-config /app/bin/sdl2-config",
       "ln -s /usr/bin/pkg-config /app/bin/pkg-config",
       "ln -s /usr/include/SDL2 /app/include/SDL2",
       "ln -s SDL2/SDL_ttf.h /app/include/SDL_ttf.h"
      ]
     }
    ],
    "build-options": {
     "env": [
      "TCL_CONFIG=/app/lib"
     ]
    },
    "post-install": [
     "install -Dm755 /app/share/${FLATPAK_ID}/bin/openmsx /app/bin",
     "install -Dm644 org.openmsx.openMSX.desktop /app/share/applications/${FLATPAK_ID}.desktop",
     "install -Dm644 org.openmsx.openMSX.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml",
     "install -Dm644 share/icons/openMSX-logo-16.png /app/share/icons/hicolor/16x16/apps/${FLATPAK_ID}.png",
     "install -Dm644 share/icons/openMSX-logo-32.png /app/share/icons/hicolor/32x32/apps/${FLATPAK_ID}.png",
     "install -Dm644 share/icons/openMSX-logo-48.png /app/share/icons/hicolor/48x48/apps/${FLATPAK_ID}.png",
     "install -Dm644 share/icons/openMSX-logo-64.png /app/share/icons/hicolor/64x64/apps/${FLATPAK_ID}.png",
     "install -Dm644 share/icons/openMSX-logo-128.png /app/share/icons/hicolor/128x128/apps/${FLATPAK_ID}.png",
     "install -Dm644 share/icons/openMSX-logo-256.png /app/share/icons/hicolor/256x256/apps/${FLATPAK_ID}.png"
    ],
    "cleanup": [
     "/app/share/${FLATPAK_ID}/bin/openmsx",
     "/app/share/${FLATPAK_ID}/bin",
     "/app/bin/libpng-config",
     "/app/bin/pkg-config",
     "/app/bin/sdl2-config"
    ]
   }
  ]
 }
}