{
 "app_id": "io.github.cudatext.CudaText-Qt",
 "source_url": "https://raw.githubusercontent.com/flathub/io.github.cudatext.CudaText-Qt/master/io.github.cudatext.CudaText-Qt.yml",
 "runtime": "org.kde.Platform",
 "runtime_version": "6.11",
 "sdk": "org.kde.Sdk",
 "finish_args": [
  "--share=ipc",
  "--share=network",
  "--socket=fallback-x11",
  "--socket=wayland",
  "--device=dri",
  "--filesystem=home",
  "--filesystem=xdg-config/kdeglobals:ro",
  "--talk-name=com.canonical.AppMenu.Registrar",
  "--talk-name=org.kde.kconfig.notify",
  "--talk-name=org.kde.KGlobalSettings"
 ],
 "module_count": 4,
 "fetched_at": "2026-09-17T16:10:45.056549+00:00",
 "manifest": {
  "app-id": "io.github.cudatext.CudaText-Qt",
  "runtime": "org.kde.Platform",
  "runtime-version": "6.11",
  "sdk": "org.kde.Sdk",
  "build-options": {
   "append-path": "/app/lib/sdk/freepascal/bin",
   "env": {
    "PPC_CONFIG_PATH": "/app/lib/sdk/freepascal/etc",
    "FPCDIR": "/app/lib/sdk/freepascal/fpcsrc",
    "FPC_DIR": "/app/lib/sdk/freepascal/fpcsrc",
    "LAZARUSDIR": "/app/lib/sdk/freepascal/share/lazarus"
   }
  },
  "cleanup-commands": [
   "rm -rf /app/lib/sdk/freepascal"
  ],
  "command": "cudatext",
  "finish-args": [
   "--socket=wayland",
   "--socket=fallback-x11",
   "--filesystem=home",
   "--device=dri",
   "--share=ipc",
   "--share=network"
  ],
  "modules": [
   {
    "name": "fpc",
    "sources": [
     {
      "type": "archive",
      "only-arches": [
       "x86_64"
      ],
      "url": "https://downloads.sourceforge.net/project/freepascal/Linux/3.2.2/fpc-3.2.2.x86_64-linux.tar",
      "sha256": "5adac308a5534b6a76446d8311fc340747cbb7edeaacfe6b651493ff3fe31e83"
     },
     {
      "type": "archive",
      "only-arches": [
       "aarch64"
      ],
      "url": "https://downloads.sourceforge.net/project/freepascal/Linux/3.2.2/fpc-3.2.2.aarch64-linux.tar",
      "sha256": "b39470f9b6b5b82f50fc8680a5da37d2834f2129c65c24c5628a80894d565451"
     },
     {
      "type": "archive",
      "url": "https://downloads.sourceforge.net/project/freepascal/Source/3.2.2/fpcbuild-3.2.2.tar.gz",
      "sha256": "85ef993043bb83f999e2212f1bca766eb71f6f973d362e2290475dbaaf50161f"
     },
     {
      "type": "patch",
      "options": [
       "-d",
       "fpcsrc"
      ],
      "path": "fpc-3.2.0--glibc-2.34.patch"
     }
    ],
    "buildsystem": "simple",
    "build-options": {
     "env": [
      "fpcver=3.2.2",
      "PREFIX=/app/lib/sdk/freepascal"
     ],
     "arch": {
      "aarch64": {
       "env": [
        "PPNAME=ppca64"
       ]
      },
      "x86_64": {
       "env": [
        "PPNAME=ppcx64"
       ]
      }
     }
    },
    "build-commands": [
     "mkdir -p ${PREFIX} && cp -r fpcsrc ${PREFIX}/",
     "mkdir fpcpre",
     "tar -xf binary.*.tar && tar -C fpcpre -xf base.*.tar.gz",
     "rm *.tar.gz *.tar",
     "make -C fpcsrc compiler_cycle PP=`pwd`/fpcpre/lib/fpc/${fpcver}/${PPNAME}",
     "make -C fpcsrc rtl_clean rtl_smart PP=`pwd`/fpcsrc/compiler/${PPNAME}",
     "make -C fpcsrc packages_smart utils_all PP=`pwd`/fpcsrc/compiler/${PPNAME}",
     "make -C fpcsrc compiler_distinstall rtl_distinstall packages_distinstall utils_distinstall INSTALL_PREFIX=${PREFIX} PP=`pwd`/fpcsrc/compiler/${PPNAME} FPCMAKE=`pwd`/fpcsrc/utils/fpcm/bin/${FLATPAK_ARCH}-linux/fpcmake",
     "${PREFIX}/lib/fpc/${fpcver}/samplecfg ${PREFIX}/lib/fpc/${fpcver} ${PREFIX}/etc",
     "echo '-Fl/app/lib' >> ${PREFIX}/etc/fpc.cfg",
     "ln -s ../lib/fpc/${fpcver}/${PPNAME} ${PREFIX}/bin/${PPNAME}",
     "ln -s ppca64 ${PREFIX}/bin/ppcaarch64"
    ]
   },
   {
    "name": "lazarus",
    "sources": [
     {
      "type": "archive",
      "url": "https://gitlab.com/JordanL2/lazarus/-/archive/main-2026-08-05/lazarus-main-2026-08-05.tar.gz",
      "sha256": "83ece5459a404f9124c408fb4d8eb335c1e12d7b0a090807228b9e825980aead"
     }
    ],
    "buildsystem": "simple",
    "build-options": {
     "append-path": "/app/lib/sdk/freepascal/bin",
     "env": [
      "INSTALL_PREFIX=/app/lib/sdk/freepascal"
     ]
    },
    "build-commands": [
     "find . -type f -iname makefile.fpc -exec fpcmake -Tall '{}' ';'",
     "make lazbuild OPT='-gl'",
     "touch lazarus startlazarus",
     "make install",
     "sed -i -e \"s#__LAZARUSDIR__#$LAZARUSDIR/#\" -e \"s#__FPCSRCDIR__#$FPCDIR/#\" -e \"s#/app/bin/fpc#$INSTALL_PREFIX/bin/fpc#\" tools/install/linux/environmentoptions.xml",
     "install -Dm644 -t $LAZARUSDIR tools/install/linux/environmentoptions.xml"
    ]
   },
   {
    "name": "qt6pas",
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/davidbannon/libqt6pas/archive/refs/tags/v6.2.10.tar.gz",
      "sha256": "dbcc13559f991958fb69de31d67c85575bbe278fdff0813b51787da50720d591"
     }
    ],
    "buildsystem": "qmake",
    "subdir": "cbindings",
    "build-commands": [
     "sed -e\"s/target.path = .\\+/target.path = '\\/app\\/lib'/\" -i ./Qt6Pas.pro"
    ]
   },
   {
    "name": "cudatext",
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/bgrabitmap/bgrabitmap/archive/refs/tags/v11.6.6.tar.gz",
      "sha256": "05da51650f7220b8674083c37857e9fc3686a7f1cabc41bfe4417d6f07632d25",
      "dest": "src/bgrabitmap"
     },
     {
      "type": "archive",
      "url": "https://github.com/Alexey-T/EncConv/archive/refs/tags/2024.12.15.tar.gz",
      "sha256": "c7c3b1907b2343ea87104be416135e908c894f645a0e36f55f3bd044442c50d0",
      "dest": "src/EncConv"
     },
     {
      "type": "archive",
      "url": "https://github.com/Alexey-T/ATBinHex-Lazarus/archive/refs/tags/2025.09.10.tar.gz",
      "sha256": "fe54dc3e7c616db3b4f72067b4a1cad9ba27a94248c30a1ecbaf2521997071e7",
      "dest": "src/ATBinHex-Lazarus"
     },
     {
      "type": "archive",
      "url": "https://github.com/Alexey-T/ATFlatControls/archive/refs/tags/2026.07.13.tar.gz",
      "sha256": "1496b265f37c7f6f58e9b391427495f59335bada57e6c60cc5b0d6e7d04a5533",
      "dest": "src/ATFlatControls"
     },
     {
      "type": "archive",
      "url": "https://github.com/Alexey-T/ATSynEdit/archive/refs/tags/2026.06.24.tar.gz",
      "sha256": "7b9ff03234881a98d5940ea39e9c480e9f0dd61db282a836552786d42a58ec91",
      "dest": "src/ATSynEdit"
     },
     {
      "type": "archive",
      "url": "https://github.com/Alexey-T/ATSynEdit_Cmp/archive/refs/tags/2025.02.15.tar.gz",
      "sha256": "c7d607a3320d2c6b12ade94b39713e5863b03d36599cd4a850e16832354cb8ab",
      "dest": "src/ATSynEdit_Cmp"
     },
     {
      "type": "archive",
      "url": "https://github.com/Alexey-T/EControl/archive/refs/tags/2026.07.18.tar.gz",
      "sha256": "fa416a3edfb2fb22b1ddb0175b603bfa30569770cfbe234176dfaba82a283b5f",
      "dest": "src/EControl"
     },
     {
      "type": "archive",
      "url": "https://github.com/Alexey-T/ATSynEdit_Ex/archive/refs/tags/2026.07.08.tar.gz",
      "sha256": "e31d9f5cf88c6802397227614ac772c982e881029dfe39f886323b91e2fc129f",
      "dest": "src/ATSynEdit_Ex"
     },
     {
      "type": "archive",
      "url": "https://github.com/Alexey-T/Python-for-Lazarus/archive/refs/tags/2024.10.15.tar.gz",
      "sha256": "82364066b53a125cbd0183dce96a9d2f27288a04222b696b630a1e0bb3c92580",
      "dest": "src/Python-for-Lazarus"
     },
     {
      "type": "archive",
      "url": "https://github.com/Alexey-T/Emmet-Pascal/archive/refs/tags/2023.12.02.tar.gz",
      "sha256": "9f8967e651253fc7027e8bef4115a45e9fb3b1c85536d1bd390da9c4d8a2efe0",
      "dest": "src/Emmet-Pascal"
     },
     {
      "type": "archive",
      "url": "https://github.com/Alexey-T/CudaText/archive/refs/tags/1.235.1.0.tar.gz",
      "sha256": "857ac025dc04bdec0154c5afccde04d7c610b2bcd482870877bea83fa90b9f12",
      "dest": "src/CudaText"
     },
     {
      "type": "file",
      "path": "io.github.cudatext.CudaText-Qt.appdata.xml"
     }
    ],
    "buildsystem": "simple",
    "build-options": {
     "arch": {
      "x86_64": {
       "env": {
        "PPC": "ppcx64"
       }
      },
      "aarch64": {
       "env": {
        "PPC": "ppca64"
       }
      }
     }
    },
    "build-commands": [
     "lazbuild --ws=qt6 -q --compiler=$PPC --pcp=. --lazarusdir=\"$LAZARUSDIR\" \"./src/bgrabitmap/bgrabitmap/bgrabitmappack.lpk\"",
     "lazbuild --ws=qt6 -q --pcp=. --lazarusdir=\"$LAZARUSDIR\" \"./src/EncConv/encconv/encconv_package.lpk\"",
     "lazbuild --ws=qt6 -q --pcp=. --lazarusdir=\"$LAZARUSDIR\" \"./src/ATBinHex-Lazarus/atbinhex/atbinhex_package.lpk\"",
     "lazbuild --ws=qt6 -q --pcp=. --lazarusdir=\"$LAZARUSDIR\" \"./src/ATFlatControls/atflatcontrols/atflatcontrols_package.lpk\"",
     "lazbuild --ws=qt6 -q --pcp=. --lazarusdir=\"$LAZARUSDIR\" \"./src/ATSynEdit/atsynedit/atsynedit_package.lpk\"",
     "lazbuild --ws=qt6 -q --pcp=. --lazarusdir=\"$LAZARUSDIR\" \"./src/ATSynEdit_Cmp/atsynedit_cmp/atsynedit_cmp_package.lpk\"",
     "lazbuild --ws=qt6 -q --pcp=. --lazarusdir=\"$LAZARUSDIR\" \"./src/EControl/econtrol/econtrol_package.lpk\"",
     "lazbuild --ws=qt6 -q --pcp=. --lazarusdir=\"$LAZARUSDIR\" \"./src/ATSynEdit_Ex/atsynedit_ex/atsynedit_ex_package.lpk\"",
     "lazbuild --ws=qt6 -q --pcp=. --lazarusdir=\"$LAZARUSDIR\" \"./src/Python-for-Lazarus/python4lazarus/python4lazarus_package.lpk\"",
     "lazbuild --ws=qt6 -q --pcp=. --lazarusdir=\"$LAZARUSDIR\" \"./src/Emmet-Pascal/emmet/emmet_package.lpk\"",
     "sed -i -e\"s/\\/usr\\/share\\/cudatext/\\\\$FLATPAK_DEST\\/share\\/cudatext/g\" src/CudaText/app/proc_globdata.pas",
     "lazbuild --ws=qt6 -q --pcp=. --lazarusdir=\"$LAZARUSDIR\" \"./src/CudaText/app/cudatext.lpi\"",
     "install -Dm755 src/CudaText/app/cudatext -t $FLATPAK_DEST/bin",
     "mkdir -p $FLATPAK_DEST/share/cudatext",
     "cp -r src/CudaText/app/data $FLATPAK_DEST/share/cudatext/",
     "cp -r src/CudaText/app/py $FLATPAK_DEST/share/cudatext/",
     "cp -r src/CudaText/app/settings_default $FLATPAK_DEST/share/cudatext/",
     "desktop-file-edit --set-key=Icon --set-value=\"io.github.cudatext.CudaText-Qt\" src/CudaText/setup/debfiles/cudatext.desktop",
     "install -D src/CudaText/setup/debfiles/cudatext.desktop $FLATPAK_DEST/share/applications/io.github.cudatext.CudaText-Qt.desktop",
     "install -D src/CudaText/setup/debfiles/cudatext-512.png $FLATPAK_DEST/share/icons/hicolor/512x512/apps/io.github.cudatext.CudaText-Qt.png",
     "install -D io.github.cudatext.CudaText-Qt.appdata.xml $FLATPAK_DEST/share/metainfo/io.github.cudatext.CudaText-Qt.metainfo.xml"
    ]
   }
  ]
 }
}