- Install required tools
apt install flatpak flatpak-builder pipx appstream flatpak install flathub org.kde.Platform//6.11 org.kde.Sdk//6.11 com.riverbankcomputing.PyQt.BaseApp//6.11 org.freedesktop.Sdk.Extension.node24//25.08 download pip generator
wget https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/master/pip/flatpak-pip-generator.py download and install node generator
wget https://github.com/flatpak/flatpak-builder-tools/archive/refs/heads/master.zip unzip master.zip "flatpak-builder-tools-master/node/*" pipx install ./flatpak-builder-tools-master/node/ - Verify Python and QWebEngineView
flatpak run --command=python3 org.kde.Sdk//6.11 --version flatpak run --command=python3 com.riverbankcomputing.PyQt.BaseApp//6.11 -c "from PyQt6.QtWebEngineWidgets import QWebEngineView; print('PyQt6 WebEngine OK')" - Packaging files
make packaging/flatpak dir in the root add the following files
io.github.user_name.project_name.desktop
[Desktop Entry] Name=Uniclare Client Exec=unigui Icon=io.github.viraj_sh.UniclareClient Terminal=false Type=Application Categories=Utility; StartupWMClass=unigui io.github.user_name.project_name.metainfo.xml
<?xml version="1.0" encoding="UTF-8"?> <component type="desktop-application"> <id>io.github.viraj_sh.UniclareClient</id> <name>Uniclare Client</name> <summary>View data that is hidden on the Uniclare App or Student Portal</summary> <metadata_license>MIT</metadata_license> <project_license>MIT</project_license> <launchable type="desktop-id">io.github.viraj_sh.UniclareClient.desktop</launchable> <releases> <release version="3.0.0" date="2026-10-25"/> </releases> </component> io.github.user_name.project_name.svg or 512px png
then to verify the metinfo.xml run this command
sudo apt install appstream appstreamcli validate --pedantic packaging/flatpak/io.github.viraj_sh.UniclareClient.metainfo.xml - now generate a requirements.txt and remove pyqt related packages do not remove qtpy its still needed remove pyqt related stuff uv pip compile pyproject.toml --extra desktop -o requirements.txt grep -viE '^(pyqt6|pyqt6-qt6|pyqt6-sip|pyqt6-webengine|pyqt6-webengine-qt6)' requirements.txt > requirements.clean.txt && mv requirements.clean.txt requirements.txt
then run this
python3 flatpak-pip-generator.py \
--runtime='org.kde.Sdk//6.11' \
--prefer-wheels=pydantic-core \
--requirements-file=requirements.txt \
--output python3-deps
move this python3-deps.json into /packaging/flatpak dir
flatpak-node-generator npm web/package-lock.json -o generated-sources.json
- now make a .yml file in /package/flatpak
id: io.github.viraj_sh.uniclareclient runtime: org.kde.Platform runtime-version: '6.11' sdk: org.kde.Sdk base: com.riverbankcomputing.PyQt.BaseApp base-version: '6.11' sdk-extensions: - org.freedesktop.Sdk.Extension.node24 command: unigui cleanup-commands: - /app/cleanup-BaseApp.sh finish-args: - --share=network - --share=ipc - --socket=wayland - --socket=fallback-x11 - --device=dri - --env=PYWEBVIEW_GUI=qt modules: - python3-deps.json - name: uniclare-client buildsystem: simple build-options: append-path: /usr/lib/sdk/node24/bin build-commands: - cd web && npm ci --offline --cache=$FLATPAK_BUILDER_BUILDDIR/flatpak-node/npm-cache && npm run build - pip3 install --prefix=/app --no-deps --no-build-isolation . - install -Dm644 packaging/flatpak/io.github.viraj_sh.uniclareclient.desktop /app/share/applications/io.github.viraj_sh.uniclareclient.desktop - install -Dm644 packaging/flatpak/io.github.viraj_sh.uniclareclient.metainfo.xml /app/share/metainfo/io.github.viraj_sh.uniclareclient.metainfo.xml - install -Dm644 packaging/flatpak/io.github.viraj_sh.uniclareclient.svg /app/share/icons/hicolor/scalable/apps/io.github.viraj_sh.uniclareclient.svg sources: - type: dir path: ../.. - generated-sources.json then run this
flatpak-builder --force-clean --install-deps-from=flathub build-dir io.github.viraj_sh.uniclareclient.yml