Skip to content

Commit a322a36

Browse files
committed
fix: Resolve Flatpak build issues
- Fix YAML parsing by properly quoting runtime version - Remove pip installation modules that cause network issues - Fix launcher script formatting and variable handling - Prevent build script from overwriting existing manifest - Add console fallback module for graceful PyQt5 absence - Ensure command is properly available during Flatpak finishing This resolves the JSON deserialization warnings and network connectivity failures during CI/CD Flatpak builds.
1 parent 3dd536e commit a322a36

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

scripts/build_flatpak.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,19 @@ def create_flatpak_manifest():
114114
"--device=dri"
115115
],
116116
"modules": [
117-
{
118-
"name": "python-deps",
119-
"buildsystem": "simple",
120-
"build-commands": [
121-
"pip3 install --prefix=/app --no-deps " + " ".join(dependencies)
122-
],
123-
"sources": []
124-
},
125117
{
126118
"name": "route-planner",
127119
"buildsystem": "simple",
128120
"build-commands": [
129-
"pip3 install --prefix=/app --no-deps .",
130-
"install -Dm755 scripts/flatpak-run.sh /app/bin/route-planner",
121+
"cp -r . /app/lib/route-planner/",
122+
"mkdir -p /app/bin",
123+
"echo '#!/bin/bash' > /app/bin/route-planner",
124+
"echo 'cd /app/lib/route-planner' >> /app/bin/route-planner",
125+
"echo 'export PYTHONPATH=/app/lib/route-planner:$PYTHONPATH' >> /app/bin/route-planner",
126+
"echo 'python3 -c \"import sys; sys.path.insert(0, \\\"/app/lib/route-planner\\\"); from route_planner.core import main; main()\" \"$@\"' >> /app/bin/route-planner",
127+
"chmod +x /app/bin/route-planner",
131128
"install -Dm644 flatpak/org.routeplanner.RoutePlanner.desktop /app/share/applications/org.routeplanner.RoutePlanner.desktop",
132-
"install -Dm644 icon.png /app/share/icons/hicolor/256x256/apps/org.routeplanner.RoutePlanner.png"
129+
"mkdir -p /app/share/icons/hicolor/256x256/apps"
133130
],
134131
"sources": [
135132
{
@@ -198,14 +195,16 @@ def build_flatpak(dry_run=False):
198195

199196
# Create manifest if it doesn't exist
200197
manifest_file = project_root / "flatpak" / "org.routeplanner.RoutePlanner.yml"
201-
if not manifest_file.exists() or dry_run:
198+
if not manifest_file.exists():
202199
print("Creating Flatpak manifest...")
203200
if not dry_run:
204201
manifest_file = create_flatpak_manifest()
205202
else:
206203
# For dry run, just show what would be created
207204
print(f"Would create manifest at: {project_root / 'flatpak' / 'org.routeplanner.RoutePlanner.yml'}")
208205
print("Would create desktop file and launcher script")
206+
else:
207+
print(f"Using existing Flatpak manifest: {manifest_file}")
209208

210209
# Build Flatpak
211210
if not dry_run:

0 commit comments

Comments
 (0)