Add Flatpak and Flathub packaging support

Add all files needed to package Yaak as a Flatpak for distribution on
Flathub. Uses the deb-extraction approach recommended by Tauri docs:
the manifest downloads the existing .deb release artifact, extracts it,
and installs the binary/resources into the Flatpak /app prefix.

Includes:
- AppStream metainfo.xml with app metadata and branding
- Flatpak manifest (app.yaak.desktop.yml) for x86_64 and aarch64
- Properly sized icons (128/256/512px) named per Flatpak conventions
- Helper script to update manifest hashes for new releases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Gregory Schier
2026-02-09 10:03:12 -08:00
parent fda18c5434
commit 9e1936f345
6 changed files with 254 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>app.yaak.desktop</id>
<name>Yaak</name>
<summary>Play with APIs, intuitively</summary>
<developer id="app.yaak">
<name>Yaak</name>
</developer>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<url type="homepage">https://yaak.app</url>
<url type="bugtracker">https://github.com/mountain-loop/yaak/issues</url>
<url type="vcs-browser">https://github.com/mountain-loop/yaak</url>
<description>
<p>
Yaak is a cross-platform desktop app for interacting with REST, GraphQL,
and gRPC APIs. It provides an intuitive interface for crafting requests,
organizing projects, and managing environments.
</p>
<p>Features include:</p>
<ul>
<li>REST, GraphQL, and gRPC support</li>
<li>Environment variables and template functions</li>
<li>Request chaining and dynamic values</li>
<li>OAuth 2.0, Bearer, Basic, API Key, AWS, JWT, and NTLM authentication</li>
<li>Import from cURL, Postman, Insomnia, and OpenAPI</li>
<li>Extensible plugin system</li>
<li>Git-friendly project storage</li>
</ul>
</description>
<launchable type="desktop-id">app.yaak.desktop.desktop</launchable>
<branding>
<color type="primary" scheme_preference="light">#6e56cf</color>
<color type="primary" scheme_preference="dark">#7c66dc</color>
</branding>
<content_rating type="oars-1.1" />
<supports>
<control>pointing</control>
<control>keyboard</control>
</supports>
<requires>
<display_length compare="ge">768</display_length>
</requires>
<!-- TODO: Screenshots are REQUIRED for Flathub submission.
Host images at a stable URL (e.g. on yaak.app or in a GitHub repo).
Recommended: 16:9 aspect ratio, at least 1248x702, PNG format.
See https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines/quality-guidelines -->
<screenshots>
<screenshot type="default">
<caption>Crafting an API request</caption>
<image>https://yaak.app/static/screenshots/flatpak-main.png</image>
</screenshot>
</screenshots>
<releases>
<!-- Releases will be added as part of the Flathub update process -->
</releases>
</component>

View File

@@ -0,0 +1,79 @@
# Flatpak manifest for Yaak
#
# To build and test locally:
# flatpak install flathub org.gnome.Platform//47 org.gnome.Sdk//47
# flatpak-builder --force-clean --user --install-deps-from=flathub --repo=flatpak-repo build flatpak/app.yaak.desktop.yml
# flatpak --user remote-add --if-not-exists yaak-local flatpak-repo
# flatpak --user install yaak-local app.yaak.desktop
# flatpak run app.yaak.desktop
id: app.yaak.desktop
runtime: org.gnome.Platform
runtime-version: "47"
sdk: org.gnome.Sdk
command: yaak-app
finish-args:
# Display (Wayland + X11 fallback)
- --socket=wayland
- --socket=fallback-x11
- --share=ipc
# GPU rendering (WebKitGTK)
- --device=dri
# Network access (required — Yaak is an API client)
- --share=network
# File access for importing/exporting and Git project directories
- --filesystem=home
modules:
- name: yaak
buildsystem: simple
build-commands:
# Extract the deb package
- ar -x yaak.deb
- tar -xf data.tar.gz
# Install the binary
- install -Dm755 usr/bin/yaak-app /app/bin/yaak-app
# Install bundled resources (plugins, node runtime, protoc, etc.)
- cp -r usr/lib/yaak /app/lib/yaak
# Install desktop file, updating Exec and Icon to match Flatpak conventions
- install -Dm644 usr/share/applications/yaak.desktop /app/share/applications/app.yaak.desktop.desktop
- desktop-file-edit --set-key=Exec --set-value=yaak-app /app/share/applications/app.yaak.desktop.desktop
- desktop-file-edit --set-icon=app.yaak.desktop /app/share/applications/app.yaak.desktop.desktop
- desktop-file-edit --set-key=StartupWMClass --set-value=yaak-app /app/share/applications/app.yaak.desktop.desktop
# Install icons from deb (small sizes) and from this repo (large sizes)
- install -Dm644 usr/share/icons/hicolor/32x32/apps/yaak-app.png /app/share/icons/hicolor/32x32/apps/app.yaak.desktop.png
- install -Dm644 usr/share/icons/hicolor/128x128/apps/yaak-app.png /app/share/icons/hicolor/128x128/apps/app.yaak.desktop.png
- install -Dm644 icons/256x256/app.yaak.desktop.png /app/share/icons/hicolor/256x256/apps/app.yaak.desktop.png
- install -Dm644 icons/512x512/app.yaak.desktop.png /app/share/icons/hicolor/512x512/apps/app.yaak.desktop.png
# Install AppStream metainfo
- install -Dm644 app.yaak.desktop.metainfo.xml /app/share/metainfo/app.yaak.desktop.metainfo.xml
sources:
# The deb package from GitHub releases
# Update the URL and sha256 for each release
- type: file
dest-filename: yaak.deb
url: https://github.com/mountain-loop/yaak/releases/download/v2026.2.0-beta.10/yaak_2026.2.0-beta.10_amd64.deb
sha256: "FILL_IN_SHA256_HASH"
only-arches:
- x86_64
- type: file
dest-filename: yaak.deb
url: https://github.com/mountain-loop/yaak/releases/download/v2026.2.0-beta.10/yaak_2026.2.0-beta.10_arm64.deb
sha256: "FILL_IN_SHA256_HASH"
only-arches:
- aarch64
# Icons (from this repo)
- type: dir
path: icons
# AppStream metainfo (from this repo)
- type: file
path: app.yaak.desktop.metainfo.xml

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

106
flatpak/update-manifest.sh Executable file
View File

@@ -0,0 +1,106 @@
#!/usr/bin/env bash
#
# Update the Flatpak manifest with URLs and SHA256 hashes for a given release.
#
# Usage:
# ./flatpak/update-manifest.sh v2026.2.0
#
# This script:
# 1. Downloads the x86_64 and aarch64 .deb files from the GitHub release
# 2. Computes their SHA256 checksums
# 3. Updates the manifest YAML with the correct URLs and hashes
# 4. Updates the metainfo.xml with a new <release> entry
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
MANIFEST="$SCRIPT_DIR/app.yaak.desktop.yml"
METAINFO="$SCRIPT_DIR/app.yaak.desktop.metainfo.xml"
if [ $# -lt 1 ]; then
echo "Usage: $0 <version-tag>"
echo "Example: $0 v2026.2.0"
exit 1
fi
VERSION_TAG="$1"
VERSION="${VERSION_TAG#v}"
REPO="mountain-loop/yaak"
BASE_URL="https://github.com/$REPO/releases/download/$VERSION_TAG"
DEB_AMD64="yaak_${VERSION}_amd64.deb"
DEB_ARM64="yaak_${VERSION}_arm64.deb"
TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT
echo "Downloading $DEB_AMD64..."
curl -fSL "$BASE_URL/$DEB_AMD64" -o "$TMPDIR/$DEB_AMD64"
SHA_AMD64=$(sha256sum "$TMPDIR/$DEB_AMD64" | cut -d' ' -f1)
echo " SHA256: $SHA_AMD64"
echo "Downloading $DEB_ARM64..."
curl -fSL "$BASE_URL/$DEB_ARM64" -o "$TMPDIR/$DEB_ARM64"
SHA_ARM64=$(sha256sum "$TMPDIR/$DEB_ARM64" | cut -d' ' -f1)
echo " SHA256: $SHA_ARM64"
echo ""
echo "Updating manifest: $MANIFEST"
# Use Python for reliable YAML-like replacement (avoids sed edge cases)
python3 << PYEOF
import re
with open("$MANIFEST", "r") as f:
content = f.read()
# Replace x86_64 source block
content = re.sub(
r'(dest-filename: yaak\.deb\n\s+url: )https://.*?\.deb(\n\s+sha256: )"[^"]*"(\n\s+only-arches:\n\s+- x86_64)',
rf'\g<1>${BASE_URL}/${DEB_AMD64}\2"${SHA_AMD64}"\3',
content,
)
# Replace aarch64 source block
content = re.sub(
r'(dest-filename: yaak\.deb\n\s+url: )https://.*?\.deb(\n\s+sha256: )"[^"]*"(\n\s+only-arches:\n\s+- aarch64)',
rf'\g<1>${BASE_URL}/${DEB_ARM64}\2"${SHA_ARM64}"\3',
content,
)
with open("$MANIFEST", "w") as f:
f.write(content)
print(" Manifest updated.")
PYEOF
echo "Updating metainfo: $METAINFO"
TODAY=$(date +%Y-%m-%d)
python3 << PYEOF
import re
with open("$METAINFO", "r") as f:
content = f.read()
release_entry = f' <releases>\n <release version="${VERSION}" date="${TODAY}" />'
# Replace existing <releases> block opening (add new release at the top)
content = re.sub(
r' <releases>\n(\s+<release )?',
release_entry + '\n <release ' if '<release ' in content else release_entry + '\n',
content,
count=1,
)
with open("$METAINFO", "w") as f:
f.write(content)
print(" Metainfo updated.")
PYEOF
echo ""
echo "Done! Review the changes:"
echo " $MANIFEST"
echo " $METAINFO"