Flatpak packaging: desktop entry, MIME, distributable bundle
org.testium.Testium.yaml uses host Python/Lua only (no bundled interpreter). build.sh exports a .flatpak bundle. README documents the install procedure.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -8,6 +8,8 @@ dist
|
|||||||
/.vscode
|
/.vscode
|
||||||
.venv/
|
.venv/
|
||||||
.flatpak-builder/
|
.flatpak-builder/
|
||||||
|
package/flatpak/repo/
|
||||||
|
package/flatpak/*.flatpak
|
||||||
crash.tx*
|
crash.tx*
|
||||||
report_test.tx*
|
report_test.tx*
|
||||||
*.autosave
|
*.autosave
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -27,7 +27,19 @@ Pre-built artifacts are published at
|
|||||||
runnable directly, no Python installation required on the host. Lua
|
runnable directly, no Python installation required on the host. Lua
|
||||||
support still needs a system `lua` interpreter and the `lua-socket` /
|
support still needs a system `lua` interpreter and the `lua-socket` /
|
||||||
`lua-cjson` modules.
|
`lua-cjson` modules.
|
||||||
* **Flatpak** — *coming soon.*
|
* **Flatpak bundle** (`testium.flatpak`) — install with:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Add Flathub (once, to fetch the KDE/PySide runtimes)
|
||||||
|
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||||
|
|
||||||
|
# Install the bundle
|
||||||
|
flatpak install --user testium.flatpak
|
||||||
|
```
|
||||||
|
|
||||||
|
After installation testium appears in the desktop application menu and the
|
||||||
|
`testium` command is available in the terminal (requires `~/.local/bin` in
|
||||||
|
`PATH`, which most modern distributions provide by default).
|
||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
|
|
||||||
|
|||||||
@@ -5,4 +5,22 @@
|
|||||||
# flatpak install flathub org.kde.Sdk//6.10
|
# flatpak install flathub org.kde.Sdk//6.10
|
||||||
# flatpak install flathub io.qt.PySide.BaseApp//6.10
|
# flatpak install flathub io.qt.PySide.BaseApp//6.10
|
||||||
|
|
||||||
flatpak-builder --user --verbose --force-clean --install build org.testium.Testium.yaml
|
set -e
|
||||||
|
|
||||||
|
# Build + install local
|
||||||
|
flatpak-builder --user --verbose --force-clean --install --repo=repo build org.testium.Testium.yaml
|
||||||
|
|
||||||
|
# Génère le bundle distribuable
|
||||||
|
flatpak build-bundle repo testium.flatpak org.testium.Testium
|
||||||
|
echo "Bundle généré : $(pwd)/testium.flatpak"
|
||||||
|
|
||||||
|
# Crée ~/.local/bin/testium pour pouvoir taper "testium" en console
|
||||||
|
WRAPPER="$HOME/.local/bin/testium"
|
||||||
|
mkdir -p "$HOME/.local/bin"
|
||||||
|
cat > "$WRAPPER" <<'EOF'
|
||||||
|
#!/bin/sh
|
||||||
|
exec flatpak run org.testium.Testium "$@"
|
||||||
|
EOF
|
||||||
|
chmod +x "$WRAPPER"
|
||||||
|
echo "Wrapper installé : $WRAPPER"
|
||||||
|
echo "Assurez-vous que ~/.local/bin est dans votre PATH."
|
||||||
|
|||||||
7
package/flatpak/org.testium.Testium-mime.xml
Normal file
7
package/flatpak/org.testium.Testium-mime.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||||
|
<mime-type type="application/x-testium">
|
||||||
|
<comment>Testium test script</comment>
|
||||||
|
<glob pattern="*.tum"/>
|
||||||
|
</mime-type>
|
||||||
|
</mime-info>
|
||||||
10
package/flatpak/org.testium.Testium.desktop
Normal file
10
package/flatpak/org.testium.Testium.desktop
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=Testium
|
||||||
|
GenericName=Test Sequencer
|
||||||
|
Comment=YAML-based test sequencer and runner
|
||||||
|
Exec=testium %f
|
||||||
|
Icon=org.testium.Testium
|
||||||
|
Type=Application
|
||||||
|
Categories=Development;
|
||||||
|
MimeType=application/x-testium;
|
||||||
|
StartupNotify=true
|
||||||
@@ -13,7 +13,9 @@ finish-args:
|
|||||||
- --socket=wayland
|
- --socket=wayland
|
||||||
- --device=dri
|
- --device=dri
|
||||||
- --share=network
|
- --share=network
|
||||||
- --filesystem=home # Optionnel : si votre testium doit lire des fichiers utilisateurs
|
- --filesystem=home
|
||||||
|
- --filesystem=/tmp
|
||||||
|
- --filesystem=host-os
|
||||||
|
|
||||||
build-options:
|
build-options:
|
||||||
build-args:
|
build-args:
|
||||||
@@ -41,18 +43,41 @@ modules:
|
|||||||
sources:
|
sources:
|
||||||
- type: dir
|
- type: dir
|
||||||
path: ../../src
|
path: ../../src
|
||||||
|
- type: file
|
||||||
|
path: org.testium.Testium.desktop
|
||||||
|
- type: file
|
||||||
|
path: org.testium.Testium-mime.xml
|
||||||
|
- type: file
|
||||||
|
path: ../../package/testium.png
|
||||||
build-commands:
|
build-commands:
|
||||||
# On installe le code source dans /app/lib/testium
|
# Code source
|
||||||
- mkdir -p /app/lib
|
- mkdir -p /app/lib
|
||||||
- cp -r . /app/lib/
|
- cp -r testium /app/lib/
|
||||||
|
- cp VERSION /app/lib/testium/VERSION
|
||||||
|
|
||||||
# Création du launcher exécutable
|
# Launcher exécutable
|
||||||
- mkdir -p /app/bin
|
- mkdir -p /app/bin
|
||||||
- |
|
- |
|
||||||
cat <<EOF > /app/bin/testium
|
cat <<EOF > /app/bin/testium
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# On ajoute le code source et l'extension PySide6 au PYTHONPATH
|
export TESTIUM_VERSION="\$(cat /app/lib/testium/VERSION 2>/dev/null || echo unknown)"
|
||||||
export PYTHONPATH="/app/lib/testium:/usr/lib/sdk/pyside6/lib/python3.13/site-packages:\$PYTHONPATH"
|
export PYTHONPATH="/app/lib/testium:/usr/lib/sdk/pyside6/lib/python3.13/site-packages:\$PYTHONPATH"
|
||||||
exec python3 /app/lib/testium "\$@"
|
# Expose host binaries (git, python3, lua, …) for subprocess lookups.
|
||||||
|
# PATH is appended (not prepended) so the main process keeps the sandbox python3.
|
||||||
|
export PATH="\$PATH:/run/host/usr/local/bin:/run/host/usr/bin:/run/host/bin"
|
||||||
|
export GIT_PYTHON_GIT_EXECUTABLE="/run/host/usr/bin/git"
|
||||||
|
exec /usr/bin/python3 /app/lib/testium "\$@"
|
||||||
EOF
|
EOF
|
||||||
- chmod +x /app/bin/testium
|
- chmod +x /app/bin/testium
|
||||||
|
|
||||||
|
# Icône
|
||||||
|
- mkdir -p /app/share/icons/hicolor/256x256/apps
|
||||||
|
- cp testium.png /app/share/icons/hicolor/256x256/apps/org.testium.Testium.png
|
||||||
|
|
||||||
|
# Entrée menu
|
||||||
|
- mkdir -p /app/share/applications
|
||||||
|
- cp org.testium.Testium.desktop /app/share/applications/
|
||||||
|
|
||||||
|
# Type MIME pour .tum
|
||||||
|
- mkdir -p /app/share/mime/packages
|
||||||
|
- cp org.testium.Testium-mime.xml /app/share/mime/packages/
|
||||||
|
|||||||
Reference in New Issue
Block a user