{
 "app_id": "io.github.peazip.PeaZip",
 "source_url": "https://raw.githubusercontent.com/flathub/io.github.peazip.PeaZip/master/io.github.peazip.PeaZip.yml",
 "runtime": "org.kde.Platform",
 "runtime_version": "6.10",
 "sdk": "org.kde.Sdk",
 "finish_args": [
  "--share=ipc",
  "--socket=fallback-x11",
  "--socket=wayland",
  "--device=dri",
  "--filesystem=xdg-config/kdeglobals:ro",
  "--filesystem=host",
  "--allow=multiarch",
  "--talk-name=com.canonical.AppMenu.Registrar",
  "--talk-name=org.kde.kconfig.notify",
  "--talk-name=org.kde.KGlobalSettings",
  "--talk-name=org.kde.StatusNotifierWatcher",
  "--talk-name=org.freedesktop.Notifications"
 ],
 "module_count": 7,
 "fetched_at": "2026-09-19T12:47:44.533754+00:00",
 "manifest": {
  "app-id": "io.github.peazip.PeaZip",
  "runtime": "org.kde.Platform",
  "runtime-version": "6.10",
  "sdk": "org.kde.Sdk",
  "sdk-extensions": [
   "org.freedesktop.Sdk.Extension.freepascal"
  ],
  "rename-icon": "peazip",
  "rename-desktop-file": "peazip.desktop",
  "command": "peazip",
  "finish-args": [
   "--socket=wayland",
   "--socket=fallback-x11",
   "--device=dri",
   "--share=ipc",
   "--filesystem=host",
   "--talk-name=org.freedesktop.Notifications",
   "--talk-name=org.kde.StatusNotifierWatcher",
   "--talk-name=com.canonical.AppMenu.Registrar",
   "--allow=multiarch"
  ],
  "cleanup": [
   "/include",
   "/lib/pkgconfig",
   "/share/man"
  ],
  "add-extensions": {
   "io.github.peazip.PeaZip.Addon.i386": {
    "directory": "Addon/i386",
    "version": "stable",
    "autodelete": true,
    "no-autodownload": false
   }
  },
  "build-options": {
   "env": {
    "PEA_DIR": "/app/peazip"
   }
  },
  "modules": [
   {
    "name": "qt6pas",
    "config-opts": [
     "-after",
     "target.path=/app/lib"
    ],
    "buildsystem": "qmake",
    "sources": [
     {
      "type": "shell",
      "commands": [
       "cp -r /usr/lib/sdk/freepascal/share/lazarus/lcl/interfaces/qt6/cbindings/. ."
      ]
     }
    ]
   },
   {
    "name": "peazip",
    "buildsystem": "simple",
    "build-commands": [
     ". /usr/lib/sdk/freepascal/enable.sh\nlazbuild --add-package dev/metadarkstyle/metadarkstyle.lpk\nlazbuild --widgetset=qt6 --build-all --max-process-count=1 dev/project_pea.lpi dev/project_peach.lpi\n"
    ],
    "post-install": [
     "mkdir -p $FLATPAK_DEST/bin",
     "install -Dm755 -t $PEA_DIR dev/{peazip,pea}",
     "rm -r res/{conf,portable} && cp -r res $PEA_DIR/res",
     "install -Dm755 install2dolphin.sh $FLATPAK_DEST/bin/install2dolphin",
     "install -Dm644 -t $FLATPAK_DEST/share/metainfo                   ${FLATPAK_ID}.appdata.xml",
     "cd res/share/batch/freedesktop_integration\nsed -i \"s/Icon=peazip_/Icon=${FLATPAK_ID}./g\"                    peazip.desktop\ndesktop-file-install --dir=$FLATPAK_DEST/share/applications      peazip.desktop\ninstall -Dm644 -t $FLATPAK_DEST/share/icons/hicolor/256x256/apps peazip.png peazip_add.png peazip_extract.png\n",
     "rename \"peazip_\" \"${FLATPAK_ID}.\" $FLATPAK_DEST/share/icons/hicolor/*/*/*.png",
     "mkdir /app/share/licenses/io.github.peazip.PeaZip/peazip/",
     "mv /app/peazip/res/share/copying -t /app/share/licenses/io.github.peazip.PeaZip/peazip/"
    ],
    "cleanup": [
     "/share/lazarus"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/peazip/PeaZip/releases/download/11.2.0/peazip-11.2.0.src.zip",
      "sha256": "9df7c9fa27b6acf898598162105d07cfd2c07677dddefacb64e66430f3ebf131",
      "x-checker-data": {
       "type": "json",
       "is-main-source": true,
       "url": "https://api.github.com/repos/peazip/PeaZip/releases/latest",
       "version-query": ".tag_name",
       "url-query": ".assets[] | select(.name==\"peazip-\" + $version + \".src.zip\") | .browser_download_url"
      }
     },
     {
      "type": "file",
      "path": "io.github.peazip.PeaZip.appdata.xml"
     },
     {
      "type": "script",
      "dest-filename": "install2dolphin.sh",
      "commands": [
       "PEA_DIR=/app/peazip",
       "cd $PEA_DIR/res/share/batch/freedesktop_integration/KDE-servicemenus/KDE5-dolphin",
       "install -Dvm755 peazip*.desktop -t \"${HOME}/.local/share/kio/servicemenus\""
      ]
     },
     {
      "type": "shell",
      "commands": [
       "cd res/share/batch/freedesktop_integration/KDE-servicemenus/KDE5-dolphin\nsed -i  \"s/Exec=peazip/Exec=flatpak run --file-forwarding $FLATPAK_ID/g\" *.desktop\nsed -Ei \"s/ (%.)/ @@ \\1 @@/g\"                                            *.desktop\nsed -i  \"s/Icon=peazip/Icon=$FLATPAK_ID/g\"                               *.desktop\n"
      ]
     }
    ]
   },
   {
    "name": "peazip-addition",
    "cleanup": [
     "/share"
    ],
    "buildsystem": "simple",
    "build-commands": [
     "rm -rv $PEA_DIR/res/bin/*",
     "mkdir  -p $PEA_DIR/res/bin/{7z,zstd,brotli,upx}",
     "ln -vs -t $PEA_DIR/res/bin/7z     $FLATPAK_DEST/bin/{7z,7zCon.sfx}",
     "ln -vs -t $PEA_DIR/res/bin/zstd   /usr/bin/zstd",
     "ln -vs -t $PEA_DIR/res/bin/brotli $FLATPAK_DEST/bin/brotli",
     "ln -vs -t $PEA_DIR/res/bin/upx    $FLATPAK_DEST/bin/upx",
     "ln -vs -t $PEA_DIR/res/bin $FLATPAK_DEST/Addon/i386/formats/{arc,lpaq,paq,quad,zpaq,unace}",
     "ln -vs /usr/bin/unzstd      $FLATPAK_DEST/bin/unzstd",
     "ln -vs /usr/bin/zstd        $FLATPAK_DEST/bin/zstd",
     "ln -vs /usr/bin/zstdcat     $FLATPAK_DEST/bin/zstdcat",
     "ln -vs /usr/bin/zstdgrep    $FLATPAK_DEST/bin/zstdgrep",
     "ln -vs /usr/bin/zstdless    $FLATPAK_DEST/bin/zstdless",
     "ln -vs /usr/bin/zstdmt      $FLATPAK_DEST/bin/zstdmt"
    ],
    "modules": [
     "formats/7-zip.yml",
     "formats/brotli.yml",
     "formats/upx.yml"
    ]
   },
   {
    "name": "setup",
    "buildsystem": "simple",
    "build-commands": [
     "mkdir   -p $FLATPAK_DEST/Addon/i386",
     "ln      -vst $FLATPAK_DEST/lib $FLATPAK_DEST/Addon/i386/lib/i386-linux-gnu",
     "install -Dvm755 peazip.sh      $FLATPAK_DEST/bin/peazip"
    ],
    "sources": [
     {
      "type": "script",
      "dest-filename": "peazip.sh",
      "commands": [
       "export TMPDIR=\"$HOME/.cache\"",
       "exec /app/peazip/peazip \"$@\""
      ]
     }
    ]
   }
  ]
 }
}