{
 "app_id": "net.sourceforge.mcomix",
 "source_url": "https://raw.githubusercontent.com/flathub/net.sourceforge.mcomix/master/net.sourceforge.mcomix.yml",
 "runtime": "org.freedesktop.Platform",
 "runtime_version": "25.08",
 "sdk": "org.freedesktop.Sdk",
 "finish_args": [
  "--share=ipc",
  "--socket=x11",
  "--socket=wayland",
  "--socket=pulseaudio",
  "--socket=fallback-x11",
  "--device=dri",
  "--filesystem=xdg-documents",
  "--filesystem=xdg-download",
  "--filesystem=xdg-pictures",
  "--filesystem=/run/media",
  "--filesystem=xdg-desktop",
  "--filesystem=/media"
 ],
 "module_count": 9,
 "fetched_at": "2026-09-17T16:13:51.307267+00:00",
 "manifest": {
  "app-id": "net.sourceforge.mcomix",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "25.08",
  "sdk": "org.freedesktop.Sdk",
  "sdk-extensions": [
   "org.freedesktop.Sdk.Extension.llvm21"
  ],
  "rename-icon": "mcomix",
  "rename-desktop-file": "mcomix.desktop",
  "rename-appdata-file": "mcomix.metainfo.xml",
  "command": "mcomix",
  "finish-args": [
   "--share=ipc",
   "--socket=fallback-x11",
   "--socket=wayland",
   "--socket=pulseaudio",
   "--device=dri",
   "--env=TMPDIR=/var/tmp",
   "--filesystem=xdg-documents",
   "--filesystem=xdg-download",
   "--filesystem=xdg-pictures",
   "--filesystem=xdg-desktop",
   "--filesystem=/media",
   "--filesystem=/run/media"
  ],
  "cleanup": [
   "/share/man"
  ],
  "modules": [
   {
    "name": "7-zip",
    "buildsystem": "simple",
    "build-commands": [
     "for bundle in Alone2 SFXCon; do\n  pushd CPP/7zip/Bundles/${bundle}\n  make -j ${FLATPAK_BUILDER_N_JOBS} -f ../../cmpl_gcc.mak\n  popd\ndone\n",
     "install -Dm755 CPP/7zip/Bundles/Alone2/b/g/7zz   $FLATPAK_DEST/bin/7z",
     "install -Dm755 CPP/7zip/Bundles/SFXCon/b/g/7zCon $FLATPAK_DEST/bin/7zCon.sfx"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/ip7z/7zip.git",
      "tag": "26.01",
      "commit": "8c63d71ff886bda90c86db28466287f977374237",
      "x-checker-data": {
       "type": "git",
       "tag-pattern": "^([\\d.]+)$"
      }
     }
    ]
   },
   {
    "name": "unrar",
    "no-autogen": true,
    "build-options": {
     "strip": true
    },
    "make-install-args": [
     "DESTDIR=$(FLATPAK_DEST)"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://www.rarlab.com/rar/unrarsrc-5.8.3.tar.gz",
      "sha256": "3591685c8f5bbcb0be09de3d0a0544adb88966b9cccb80986f6cd2b534fd91a6"
     }
    ]
   },
   {
    "name": "mcomix",
    "buildsystem": "simple",
    "build-commands": [
     "pip3 install --verbose --exists-action=i --no-index --prefix=${FLATPAK_DEST} --no-build-isolation .[fileformats]",
     "cp -a share -t /app/",
     "resize=$PWD/resize.py\ncd $FLATPAK_DEST/share/icons/hicolor\nfor x in $(ls);do\n  [ -e ${x}/apps/mcomix.png ] || continue\n  size=${x%x*}\n  python ${resize} -s ${size} ${x}/apps/mcomix.png\n  echo ${size}_ok\ndone\nrm */apps/*.svg\n"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://downloads.sourceforge.net/project/mcomix/MComix-3.1.1/mcomix-3.1.1.tar.gz",
      "sha256": "a10aaaed7bc07deb74efde93bf9a8a27e1bcbf1824a0519b264cfee582becef8",
      "x-checker-data": {
       "is-main-source": true,
       "type": "anitya",
       "project-id": 8886,
       "stable-only": true,
       "url-template": "https://downloads.sourceforge.net/project/mcomix/MComix-$version/mcomix-$version.tar.gz"
      }
     },
     {
      "type": "shell",
      "commands": [
       "sed -i \"s:constants.APPNAME:'${FLATPAK_ID}':g\" ./mcomix/run.py"
      ]
     },
     {
      "type": "script",
      "dest-filename": "resize.py",
      "commands": [
       "from PIL import Image\nfrom pathlib import Path\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"-s\", type=str,metavar='size',required=True)\nparser.add_argument(\"path\", type=str)\n\nargs = vars(parser.parse_args())\nsize: int = int(args['s'])\npath: Path = Path(args['path'])\n\nfin_img = Image.new('RGBA', (size, size), (0, 0, 0, 0))\nimg = Image.open(path)\nin_w,in_h = img.size\nrate = in_w / in_h\nw = int(size if rate > 1 else size*rate)\nh = int(size if rate <= 1 else size/rate)\nimg = img.resize((w,h), Image.Resampling.LANCZOS)\nfin_img.paste(img, (int((size-w)/2), int((size-h)/2)))\nfin_img.save(path)\n"
      ]
     }
    ],
    "modules": [
     "pymupdf.yml",
     "buildbackend.yml",
     {
      "name": "python3-pygobject",
      "buildsystem": "simple",
      "build-commands": [
       "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pycairo\" --no-build-isolation",
       "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pygobject\" --no-build-isolation"
      ],
      "sources": [
       {
        "type": "file",
        "url": "https://files.pythonhosted.org/packages/22/d9/1728840a22a4ef8a8f479b9156aa2943cd98c3907accd3849fb0d5f82bfd/pycairo-1.29.0.tar.gz",
        "sha256": "f3f7fde97325cae80224c09f12564ef58d0d0f655da0e3b040f5807bd5bd3142",
        "x-checker-data": {
         "name": "pycairo",
         "type": "pypi"
        }
       },
       {
        "type": "file",
        "url": "https://files.pythonhosted.org/packages/a2/80/09247a2be28af2c2240132a0af6c1005a2b1d089242b13a2cd782d2de8d7/pygobject-3.56.2.tar.gz",
        "sha256": "b816098969544081de9eecedb94ad6ac59c77e4d571fe7051f18bebcec074313",
        "x-checker-data": {
         "name": "pygobject",
         "type": "pypi"
        }
       }
      ]
     },
     {
      "name": "python3-pybind11",
      "buildsystem": "simple",
      "build-commands": [
       "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pybind11\" --no-build-isolation"
      ],
      "cleanup": [
       "*"
      ],
      "sources": [
       {
        "type": "file",
        "url": "https://files.pythonhosted.org/packages/b3/06/c3a23c9a0263b136c519f033a58d4641e73065fefc7754e9667ec206d992/pybind11-3.0.4-py3-none-any.whl",
        "sha256": "961720ee652da51d531b7b2451a6bd2bc042b0106e6d9baa48ecb7d58034ce63",
        "x-checker-data": {
         "type": "pypi",
         "name": "pybind11",
         "packagetype": "bdist_wheel"
        }
       }
      ]
     },
     {
      "name": "python3-Pillow",
      "buildsystem": "simple",
      "build-commands": [
       "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"Pillow\" --no-build-isolation"
      ],
      "sources": [
       {
        "type": "file",
        "url": "https://files.pythonhosted.org/packages/8c/21/c2bcdd5906101a30244eaffc1b6e6ce71a31bd0742a01eb89e660ebfac2d/pillow-12.2.0.tar.gz",
        "sha256": "a830b1a40919539d07806aa58e1b114df53ddd43213d9c8b75847eee6c0182b5",
        "x-checker-data": {
         "type": "pypi",
         "name": "Pillow"
        }
       }
      ]
     },
     {
      "name": "python3-chardet",
      "buildsystem": "simple",
      "build-commands": [
       "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"chardet\" --no-build-isolation"
      ],
      "sources": [
       {
        "type": "file",
        "url": "https://files.pythonhosted.org/packages/8c/6c/0a40afdb50a0fe041ab95553b835a8160b6cf0e81edf2ae2fe9f5224cbf9/chardet-7.4.3-py3-none-any.whl",
        "sha256": "1173b74051570cf08099d7429d92e4882d375ad4217f92a6e5240ccfb26f231e",
        "x-checker-data": {
         "type": "pypi",
         "name": "chardet",
         "packagetype": "bdist_wheel"
        }
       }
      ]
     }
    ]
   }
  ]
 }
}