Add Flatpak packaging (com.hotconfig.LightGUIRust)

Flatpak manifest (GNOME Platform 48, GTK 3, rust-stable SDK extension)
+ launcher, desktop file, metainfo and app icon. Builds the designer,
xframe-palette and xframe-layout with cargo --offline from the vendored
crates (flatpak/cargo-sources.json, generated from Cargo.lock with
flatpak-cargo-generator.py), installs them under /app/share/lightgui-rust/,
and launches the combined IDE. The XFrame icons come from the C repo
(second git source). build-flatpak.sh builds the Flatpak and a
single-file bundle.
This commit is contained in:
cnmcdee committed 2026-11-29 15:07:42 +00:00
1 parent aed11c9bd4
commit a3f6c6d62c
7 files changed
+1220

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
# Build the LightGUI Rust Flatpak and a single-file bundle.
# Run from the repo root: bash flatpak/build-flatpak.sh
# Outputs: LightGUIRust.flatpak (single-file bundle) in the repo root.
# The cargo-sources.json (flatpak/cargo-sources.json) is generated from
# Cargo.lock with flatpak-cargo-generator.py; regenerate it after any
# Cargo.lock change: flatpak-cargo-generator.py Cargo.lock -o flatpak/cargo-sources.json
set -e
cd "$(dirname "$0")/.."
MANIFEST=flatpak/com.hotconfig.LightGUIRust.yaml
APP_ID=com.hotconfig.LightGUIRust
BUILD_DIR=${BUILD_DIR:-/tmp/flatpak-build-lightgui-rust}
REPO_DIR=${REPO_DIR:-/tmp/flatpak-repo-lightgui-rust}
flatpak-builder --force-clean --repo="$REPO_DIR" "$BUILD_DIR" "$MANIFEST"
flatpak build-bundle "$REPO_DIR" LightGUIRust.flatpak "$APP_ID" --runtime-repo=https://dl.flathub.org/repo/flathub.flatpakrepo
ls -lh LightGUIRust.flatpak
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Name=LightGUI (Rust)
GenericName=GUI Designer
Comment=Visual GUI designer for GTK 3, rewritten in Rust
Exec=lightgui-rust
Icon=com.hotconfig.LightGUIRust
Terminal=false
Categories=Development;IDE;GUIDesigner;
Keywords=GTK;GUI;designer;widgets;IDE;Rust;
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>com.hotconfig.LightGUIRust</id>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<name>LightGUI (Rust)</name>
<summary>Visual GUI designer for GTK 3, rewritten in Rust</summary>
<description>
<p>LightGUI in Rust is the entire LightGUI designer ported from C++/GTK3 to Rust: the same designer, the same 547 XFrame widgets, the same project format, rebuilt with gtk-rs 0.18 for the designer and x11rb for the raw-X11 widgets.</p>
<p>It opens the same six windows as the C++ version, uses the same 583-entry combined palette, and its code generator reproduces the C++ output byte-for-byte where it counts.</p>
</description>
<launchable type="desktop-id">com.hotconfig.LightGUIRust.desktop</launchable>
<url type="homepage">https://github.com/cnmcdee/lightgui_rust</url>
<url type="vcs-browser">https://github.com/cnmcdee/lightgui_rust</url>
<provides>
<id>com.hotconfig.LightGUIRust.desktop</id>
</provides>
</component>
+44
View File
@@ -0,0 +1,44 @@
app-id: com.hotconfig.LightGUIRust
runtime: org.gnome.Platform
runtime-version: '48'
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
command: lightgui-rust
finish-args:
- --share=ipc
- --socket=fallback-x11
- --socket=wayland
- --device=dri
- --filesystem=home
build-options:
append-path: /usr/lib/sdk/rust-stable/bin
env:
CARGO_HOME: /run/build/lightgui-rust/cargo
modules:
- name: lightgui-rust
buildsystem: simple
sources:
- type: git
url: https://github.com/cnmcdee/lightgui_rust.git
branch: main
- cargo-sources.json
- type: git
url: https://github.com/cnmcdee/lightgui.git
branch: main
dest: lightgui-icons
build-commands:
- cd lightgui_rust
- mkdir -p .cargo
- printf '[source.crates-io]\nreplace-with = "vendored-sources"\n[source.vendored-sources]\ndirectory = "%s/vendor"\n' "$CARGO_HOME" > .cargo/config.toml
- cargo --offline fetch --verbose
- cargo --offline build --release --verbose
- install -Dm755 target/release/lightgui-designer /app/share/lightgui-rust/lightgui-designer
- install -Dm755 target/release/xframe-palette /app/share/lightgui-rust/xframe-palette
- install -Dm755 target/release/xframe-layout /app/share/lightgui-rust/xframe-layout
- mkdir -p /app/share/lightgui-rust/widgets/icons
- cp ../lightgui-icons/widgets/icons/* /app/share/lightgui-rust/widgets/icons/
- install -Dm755 flatpak/lightgui-rust-launcher /app/bin/lightgui-rust
- install -Dm644 flatpak/com.hotconfig.LightGUIRust.desktop /app/share/applications/com.hotconfig.LightGUIRust.desktop
- install -Dm644 flatpak/com.hotconfig.LightGUIRust.metainfo.xml /app/share/metainfo/com.hotconfig.LightGUIRust.metainfo.xml
- install -Dm644 flatpak/icon.png /app/share/icons/hicolor/512x512/apps/com.hotconfig.LightGUIRust.png
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

+32
View File
@@ -0,0 +1,32 @@
#!/bin/sh
# LightGUI Rust Flatpak launcher — start the combined IDE
# (designer + XFrame palette + layout), mirroring the C `ide` script.
# Binaries and icons live under /app/share/lightgui-rust/.
ROOT=/app/share/lightgui-rust
export LIGHTGUI_ICONS="$ROOT/widgets/icons"
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
echo "lightgui-rust: no display (DISPLAY and WAYLAND_DISPLAY are unset)." >&2
exit 1
fi
PAL_PID=""
LAY_PID=""
cleanup() {
[ -n "$PAL_PID" ] && kill "$PAL_PID" 2>/dev/null
[ -n "$LAY_PID" ] && kill "$LAY_PID" 2>/dev/null
}
trap cleanup EXIT INT TERM
(cd "$ROOT" && ./xframe-palette) &
PAL_PID=$!
(cd "$ROOT" && ./xframe-layout) &
LAY_PID=$!
(cd "$ROOT" && ./lightgui-designer) &
DESIGNER_PID=$!
wait "$DESIGNER_PID"
STATUS=$?
cleanup
trap - EXIT INT TERM
exit "$STATUS"