{
 "app_id": "org.sugarlabs.Physics",
 "source_url": "https://raw.githubusercontent.com/flathub/org.sugarlabs.Physics/master/org.sugarlabs.Physics.json",
 "runtime": "org.gnome.Platform",
 "runtime_version": "50",
 "sdk": "org.gnome.Sdk",
 "finish_args": [
  "--share=ipc",
  "--socket=x11",
  "--socket=pulseaudio",
  "--device=dri"
 ],
 "module_count": 6,
 "fetched_at": "2026-09-17T16:16:42.185861+00:00",
 "manifest": {
  "app-id": "org.sugarlabs.Physics",
  "base": "org.sugarlabs.BaseApp",
  "base-version": "26.04",
  "runtime": "org.gnome.Platform",
  "runtime-version": "50",
  "sdk": "org.gnome.Sdk",
  "separate-locales": false,
  "command": "sugarapp",
  "finish-args": [
   "--socket=x11",
   "--socket=pulseaudio",
   "--share=ipc",
   "--device=dri",
   "--env=SUGAR_BUNDLE_ID=org.sugarlabs.Physics",
   "--env=SUGAR_BUNDLE_PATH=/app/share/sugar/activities/Physics.activity/"
  ],
  "cleanup": [
   "/include",
   "/lib/pkgconfig",
   "/lib/python3.**/pygame/examples",
   "/lib/python3.*/*/pygame/docs",
   "/share/aclocal",
   "/share/info",
   "/share/man",
   "/share/sugar/activities/Physics.activity/po"
  ],
  "cleanup-commands": [
   "rm -rf /app/share/gir-1.0"
  ],
  "modules": [
   "shared-modules/SDL2/SDL2_ttf.json",
   "shared-modules/SDL2/SDL2_image.json",
   {
    "name": "pygame2",
    "buildsystem": "simple",
    "build-commands": [
     "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pygame\" --no-build-isolation"
    ],
    "build-options": {
     "env": {
      "PORTMIDI_INC_PORTTIME": "1",
      "PYGAME_EXTRA_BASE": "/app"
     },
     "arch": {
      "aarch64": {
       "env": {
        "ORIGLIBDIRS": "/lib:/lib64:/lib/aarch64-linux-gnu"
       }
      },
      "x86_64": {
       "env": {
        "ORIGLIBDIRS": "/lib:/lib64:/lib/x86_64-linux-gnu"
       }
      }
     }
    },
    "sources": [
     {
      "type": "file",
      "url": "https://files.pythonhosted.org/packages/49/cc/08bba60f00541f62aaa252ce0cfbd60aebd04616c0b9574f755b583e45ae/pygame-2.6.1.tar.gz",
      "sha256": "56fb02ead529cee00d415c3e007f75e0780c655909aaa8e8bf616ee09c9feb1f",
      "x-checker-data": {
       "type": "pypi",
       "name": "pygame"
      }
     }
    ]
   },
   {
    "name": "swig",
    "cleanup": [
     "*"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/swig/swig.git",
      "tag": "v4.4.1",
      "commit": "c7b01379fa00ff152bc22d4dd0e0d5bb862282d9",
      "x-checker-data": {
       "type": "git",
       "tag-pattern": "^(?:v|rel-)([\\d.]+)$"
      }
     }
    ]
   },
   {
    "name": "box2d",
    "buildsystem": "simple",
    "build-commands": [
     "python3 setup.py build_ext --inplace",
     "pip3 install --no-index --find-links \"file://${PWD}\" --prefix=${FLATPAK_DEST} . --no-build-isolation"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/pybox2d/pybox2d.git",
      "tag": "2.3.10",
      "commit": "ed9d7b04f7099a15984c727dbce46c13abd64409",
      "x-checker-data": {
       "type": "git",
       "tag-pattern": "^([\\d.]+)$"
      }
     }
    ]
   },
   {
    "name": "physics",
    "buildsystem": "simple",
    "build-commands": [
     "python3 setup.py install --prefix=/app --skip-install-desktop-file --skip-install-mime"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/sugarlabs/physics.git",
      "commit": "cfd17b82b783f1ce4952ccdef6a8ddbe3d8f3e46"
     },
     {
      "type": "patch",
      "path": "physics-port.patch"
     },
     {
      "type": "patch",
      "path": "physics-fix-destroy.patch"
     },
     {
      "type": "patch",
      "path": "physics-monitors.patch"
     },
     {
      "type": "patch",
      "path": "physics-fix-save.patch"
     },
     {
      "type": "patch",
      "path": "physics-fix-sugargame.patch"
     },
     {
      "type": "patch",
      "path": "physics-fix-remove-joint.patch"
     },
     {
      "type": "patch",
      "path": "physics-info.patch"
     }
    ],
    "post-install": [
     "sugarapp-gen-appdata activity/activity.info appdata",
     "sugarapp-gen-desktop activity/activity.info desktop --mimetypes activity/mimetypes.xml",
     "install -D activity/mimetypes.xml /app/share/mime/packages/org.sugarlabs.Physics.xml",
     "install -D appdata /app/share/metainfo/org.sugarlabs.Physics.appdata.xml",
     "install -D desktop /app/share/applications/org.sugarlabs.Physics.desktop",
     "install -D activity/activity-physics.svg /app/share/icons/hicolor/scalable/apps/org.sugarlabs.Physics.svg"
    ]
   }
  ]
 }
}