Make desktop and shared-MIME database tools explicit package dependencies and emit actionable native-smoke diagnostics before launching the packaged app.
- commit
- 67d2a2eefcf260020d070d9f835d71e28d7cebe1
- parent
- b00bf2414a787120442b15f83275a3365a98fe43
- author
- Dami <dami.etoile@gmail.com>
| M | packaging/ | 2 | +- |
| M | scripts/ | 15 | ++++++++++++--- |
| M | tests/ | 2 | ++ |
@@ -4,7 +4,7 @@ Section: science
44 Priority: optional55 Architecture: @ARCH@66 Maintainer: Feline State Machine7-Depends: libgtk-3-0, libwebkit2gtk-4.1-07+Depends: libgtk-3-0, libwebkit2gtk-4.1-0, desktop-file-utils, shared-mime-info88 Description: Offline Atlas volume explorer99 Atlas opens self-contained geographic volumes with raster pyramids,1010 semantic features, and authored presentation.@@ -35,9 +35,18 @@ go run "$root/cmd/atlas" build -cache "$stage/cache" -bundles "$stage/source" \
3535 "$root/examples/sample-region.atlas-project"3636 artifact=$(find "$stage/source" -maxdepth 1 -type f -name 'sample-region-*.atlas' -print -quit)3737 test -n "$artifact"38-[[ "$(xdg-mime query filetype "$artifact")" == application/vnd.felinestatemachine.atlas ]]39-gio mime application/vnd.felinestatemachine.atlas \40- | grep -F 'dev.felinestatemachine.Atlas.desktop'38+file_type=$(xdg-mime query filetype "$artifact")39+echo "installed Atlas MIME type: $file_type"40+[[ "$file_type" == application/vnd.felinestatemachine.atlas ]] || {41+ echo "unexpected Atlas MIME type: $file_type" >&242+ exit 143+}44+handlers=$(gio mime application/vnd.felinestatemachine.atlas)45+echo "$handlers"46+grep -F 'dev.felinestatemachine.Atlas.desktop' <<<"$handlers" >/dev/null || {47+ echo "Atlas desktop handler is not registered" >&248+ exit 149+}4150 4251 mkdir -p "$stage/library" "$stage/data"4352 ATLAS_BUNDLES_DIR="$stage/library" ATLAS_DATA_DIR="$stage/data" \@@ -42,6 +42,8 @@ class NativePackagingTest(unittest.TestCase):
4242 control = (ROOT / "packaging/linux/control").read_text()4343 self.assertIn("Package: atlas-desktop", control)4444 self.assertIn("Depends: libgtk-3-0, libwebkit2gtk-4.1-0", control)45+ self.assertIn("desktop-file-utils", control)46+ self.assertIn("shared-mime-info", control)4547 4648 def test_windows_installer_registers_atlas_file(self) -> None:4749 installer = (ROOT / "packaging/windows/Atlas.iss").read_text()