Skip to content

Add materialgram (io.github.kukuruzka165.materialgram) - #2

Merged
jing2uo merged 1 commit into
mainfrom
add-materialgram
Jun 20, 2026
Merged

jing2uo merged 1 commit into
mainfrom
add-materialgram

Conversation

@jing2uo

@jing2uo jing2uo commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

io.github.kukuruzka165.materialgram — Packaging notes

1. Overview

materialgram is a Telegram Desktop fork with Material Design and extra features (GPL-3.0-or-later). This is a community package, not affiliated with or endorsed by the developer (stated in the metainfo). Upstream publishes a self-contained Linux binary per GitHub release.

2. Relationship to the Flathub build

materialgram is already published on Flathub, but that build is compiled from source against an older GNOME runtime, org.gnome.Platform//49. This package instead targets the latest freedesktop runtime, org.freedesktop.Platform//25.08, and packages upstream's official prebuilt Linux release as extra-data rather than compiling from source. Both track the same upstream version (6.7.7.1); the difference is the newer, leaner runtime base and the extra-data build approach.

3. Packaging strategy

Packaged as extra-data, in line with FlatPark's extra-data-first policy. Upstream already ships a single self-contained binary (Qt, FFmpeg, OpenSSL, etc. statically linked), so there is nothing to compile.

  • The ostree commit contains no upstream binary — only a download pointer (extra-data: URL + sha256 + size).
  • The binary is fetched and unpacked on the user's machine at install time; /app stays read-only.
  • New releases are picked up by re-resolving the latest GitHub release (see §7); no from-source build is involved.

4. Files

File Role
flatpark.yml FlatPark descriptor: catalog metadata, build mode, update entry point, policy
io.github.kukuruzka165.materialgram.yml Flatpak manifest: runtime, permissions, module, extra-data source
apply_extra.sh Install-time offline hook, installed as /app/bin/apply_extra; unpacks the release tarball into /app/extra
materialgram-wrapper Launch wrapper, installed as /app/bin/materialgram (the command)
resolve-update.sh Update resolver, emits {version, releaseDate, sources[]} JSON
*.desktop / *.metainfo.xml / *.png Desktop integration, AppStream metadata, application icon

5. Manifest highlights

  • runtime: org.freedesktop.Platform//25.08; no dependency on any desktop-environment runtime.
  • permissions (finish-args): --share=ipc, --share=network, --socket=wayland, --socket=fallback-x11, --socket=pulseaudio, --device=dri; desktop integration via --talk-name for Notifications, the KDE StatusNotifierWatcher (tray), and ScreenSaver (idle/lock), --system-talk-name=org.freedesktop.login1, plus --own-name=org.mpris.MediaPlayer2.materialgram.* (media-key control). File access is limited to --filesystem=xdg-download for the default save location; --filesystem=home is intentionally not granted (the app uses portals otherwise).
  • module: a single materialgram (buildsystem: simple) that installs the wrapper, install hook, and desktop files, and declares one extra-data source — materialgram.tar.zst (the upstream v<tag> Linux release, x86_64).
  • The extra-data source sits between the # BEGIN/END MANAGED EXTRA-DATA markers and is rewritten by FlatPark at build time from resolve-update.sh output (URL and the sha256/size pins); manual edits there are overwritten.

6. Install-time behavior (apply_extra.sh)

Runs offline. Using the tar + zstd provided by the runtime, it extracts only usr/bin/materialgram from the release tarball, moves it to the fixed path /app/extra/materialgram (referenced by the wrapper), removes the archive, and marks the binary executable. The desktop file, icon, and AppStream metainfo are shipped by the manifest at build time (extra-data is fetched too late for anything Flatpak must export).

7. Launch wrapper (materialgram-wrapper)

The upstream binary is self-contained, so the wrapper simply execs /app/extra/materialgram "$@". Flatpak already redirects $HOME into the per-app data dir, so the messenger's data stays inside the sandbox with no redirection needed, and Qt selects Wayland or xcb on its own from the sockets granted in finish-args.

8. Update mechanism (resolve-update.sh)

  • stdout carries JSON only; logs go to stderr:
    { "version": "6.7.7.1", "releaseDate": "YYYY-MM-DD",
      "sources": [ {"filename": "materialgram.tar.zst", "url": "..."} ] }
  • It computes no hashes and rewrites no manifest: it supplies the URL only; sha256/size are computed by FlatPark at build time and written back into the MANAGED block.
  • Logic: queries the GitHub releases/latest API for kukuruzka165/materialgram, takes tag_name (stripped of the v prefix) and published_at, and selects the lone materialgram-v<tag>.tar.zst asset (the macOS/win64 .zip assets are filtered out). Honors GITHUB_TOKEN if present for rate limits.

9. Policy and metadata

flatpark.yml > policy: proprietary: false, extra_data_first: true, dangerous_permissions: []. The screenshot is hotlinked from the upstream repo and does not enter R2. The desktop entry registers the tg/tonsite URL scheme handlers and a "Quit" action. content_rating is marked for social chat/audio/contacts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant