{
 "app_id": "org.mmass.mMass",
 "source_url": "https://raw.githubusercontent.com/flathub/org.mmass.mMass/master/org.mmass.mMass.yaml",
 "runtime": "org.freedesktop.Platform",
 "runtime_version": "25.08",
 "sdk": "org.freedesktop.Sdk",
 "finish_args": [
  "--share=network",
  "--share=ipc",
  "--socket=x11",
  "--device=all",
  "--filesystem=home"
 ],
 "module_count": 7,
 "fetched_at": "2026-09-17T16:16:05.499503+00:00",
 "manifest": {
  "id": "org.mmass.mMass",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "25.08",
  "sdk": "org.freedesktop.Sdk",
  "command": "mmass",
  "finish-args": [
   "--socket=x11",
   "--device=all",
   "--share=ipc",
   "--share=network",
   "--filesystem=home"
  ],
  "cleanup": [
   "/include",
   "/lib/wx/include",
   "/share/aclocal"
  ],
  "modules": [
   "shared-modules/python2.7/python-2.7.json",
   "shared-modules/gtk2/gtk2.json",
   "shared-modules/gtk2/gtk2-common-themes.json",
   {
    "name": "wxWidgets",
    "buildsystem": "simple",
    "build-options": {
     "cflags": "-Wno-narrowing",
     "cxxflags": "-Wno-narrowing"
    },
    "build-commands": [
     "./configure",
     "make",
     "make -C contrib/src/gizmos",
     "make -C contrib/src/stc",
     "make prefix=${FLATPAK_DEST} install",
     "make -C contrib/src/gizmos prefix=${FLATPAK_DEST} install",
     "make -C contrib/src/stc prefix=${FLATPAK_DEST} install"
    ],
    "config-opts": [
     "--disable-monolithic",
     "--disable-rpath",
     "--enable-geometry",
     "--enable-graphics_ctx",
     "--enable-optimise",
     "--enable-sound",
     "--enable-display",
     "--enable-unicode",
     "--with-gtk=2",
     "--with-python=/app/bin/python",
     "--with-gnomeprint"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://downloads.sourceforge.net/wxpython/wxPython/2.8.12.1/wxwidgets2.8_2.8.12.1.orig.tar.gz",
      "sha256": "2ce05acafd2867156a617c911ed9fc4797ac9e818e2c70de4e9080bb38694c0a"
     },
     {
      "type": "shell",
      "commands": [
       "cp /usr/share/automake-*/config.sub .",
       "cp /usr/share/automake-*/config.guess ."
      ]
     }
    ]
   },
   {
    "name": "wxPython",
    "buildsystem": "simple",
    "build-commands": [
     "cd wxPython; /app/bin/python setup.py WXPORT=gtk2 UNICODE=1 BUILD_GLCANVAS=0 EP_ADD_OPTS=1 EP_FULL_VER=0 NO_SCRIPTS=1 WX_CONFIG=\"/app/bin/wx-config --prefix=/app --no_rpath\" SYS_WX_CONFIG=\"wx-config --version=2.8.12.1 --toolkit=gtk2 --static=no\" build_ext --rpath=/app/lib build",
     "cd wxPython; /app/bin/python setup.py WXPORT=gtk2 UNICODE=1 BUILD_GLCANVAS=0 EP_ADD_OPTS=1 EP_FULL_VER=0 NO_SCRIPTS=1 WX_CONFIG=\"/app/bin/wx-config --prefix=/app --no_rpath\" SYS_WX_CONFIG=\"wx-config --version=2.8.12.1 --toolkit=gtk2 --static=no --unicode\" build_ext --rpath=/app/lib install --root=/"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://downloads.sourceforge.net/wxpython/wxPython/2.8.12.1/wxwidgets2.8_2.8.12.1.orig.tar.gz",
      "sha256": "2ce05acafd2867156a617c911ed9fc4797ac9e818e2c70de4e9080bb38694c0a"
     }
    ]
   },
   {
    "name": "numpy",
    "buildsystem": "simple",
    "build-commands": [
     "/app/bin/python setup.py build",
     "/app/bin/python setup.py install --prefix=/app --root=/ --optimize=1"
    ],
    "build-options": {
     "env": {
      "ATLAS": "None",
      "BLAS": "/app/lib",
      "LAPACK": "/app/lib"
     }
    },
    "cleanup": [
     "/bin"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://files.pythonhosted.org/packages/b7/6f/24647f014eef9b67a24adfcbcd4f4928349b4a0f8393b3d7fe648d4d2de3/numpy-1.16.6.zip",
      "sha256": "e5cf3fdf13401885e8eea8170624ec96225e2174eb0c611c6f26dd33b489e3ff"
     }
    ]
   },
   {
    "name": "mmass",
    "buildsystem": "simple",
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/xxao/mMass-Dist/blob/main/v5.5.0/mmass_v5.5.0_source.zip",
      "sha256": "e75e0792b51ed16f5b772f285b1be2031a0906fd35b02294752ccf816258508c"
     },
     {
      "type": "patch",
      "path": "disable-server.patch"
     },
     {
      "type": "shell",
      "commands": [
       "sed -i 's/\\r$//' license.txt",
       "sed -i -e '1i#!/usr/bin/python' gui/*.py",
       "sed -i -e '1i#!/usr/bin/python' mspy/*.py"
      ]
     },
     {
      "type": "file",
      "path": "mMass.desktop"
     },
     {
      "type": "file",
      "path": "mmass.appdata.xml"
     }
    ],
    "build-commands": [
     "pushd mspy && /app/bin/python setup.py build && mv -f build/lib.*/calculations.so ./calculations.so && popd"
    ],
    "post-install": [
     "pushd mspy && /app/bin/python setup.py install --skip-build --prefix=/app --root=/ && popd",
     "mkdir -p /app/lib/python2.7/mmass/configs/",
     "mkdir -p /app/lib/python2.7/mmass/gui",
     "mkdir -p /app/lib/python2.7/mmass/mspy/",
     "mkdir -p /app/share/mmass/database",
     "install -Dm0755 mspy/*.py* /app/lib/python2.7/mmass/mspy",
     "install -Dm0755 mspy/*.so /app/lib/python2.7/mmass/mspy",
     "install -Dm0644 configs/*.xml /app/lib/python2.7/mmass/configs",
     "install -Dm0755 gui/*.py* /app/lib/python2.7/mmass/gui",
     "install -Dm0644 gui/images/gtk/icon_about.png /app/lib/python2.7/mmass/gui/images/gtk",
     "install -Dm0755 mmass.py* /app/lib/python2.7/mmass",
     "ln -s /app/lib/python2.7/mmass/mmass.py /app/bin/mmass",
     "sed -i -e '1i#!/usr/bin/python' /app/lib/python2.7/mmass/mmass.py",
     "find  /app/lib/python2.7/mmass -name \"*.py\" | xargs sed -i '1s|/usr/bin/python|/app/bin/python|'",
     "install -Dm0644 *.xml /app/share/mmass/database",
     "install -m0644 *.pdf /app/lib/python2.7/mmass",
     "install -Dm0644 mMass.desktop /app/share/applications/${FLATPAK_ID}.desktop",
     "install -Dm0644 mmass.appdata.xml /app/share/metainfo/${FLATPAK_ID}.appdata.xml",
     "install -Dm0644 gui/images/gtk/icon_128.png /app/share/icons/hicolor/128x128/apps/${FLATPAK_ID}.png",
     "install -Dm0644 gui/images/gtk/icon_256.png /app/share/icons/hicolor/256x256/apps/${FLATPAK_ID}.png",
     "install -Dm0644 gui/images/gtk/icon_512.png /app/share/icons/hicolor/512x512/apps/${FLATPAK_ID}.png"
    ]
   }
  ]
 }
}