diff --git a/snapcraft/extensions/kde_neon_6.py b/snapcraft/extensions/kde_neon_6.py index 0588dadca1..4c63115240 100644 --- a/snapcraft/extensions/kde_neon_6.py +++ b/snapcraft/extensions/kde_neon_6.py @@ -22,6 +22,7 @@ import re from typing import Any +from craft_application.errors import CraftValidationError from overrides import overrides from .extension import Extension, get_extensions_data_dir, prepend_to_env @@ -189,6 +190,9 @@ def get_root_snippet(self) -> dict[str, Any]: content_kf6_snap = self.kde_snaps.content_kf6 + "-all" gpu_plugs = self.kde_snaps.gpu_plugs gpu_layouts = self.kde_snaps.gpu_layouts + if not (base := self.yaml_data.get("base")): + raise CraftValidationError("The 'base' key is required.") + lxqt_support_snap = f"lxqt-support-{base}" return { "assumes": ["snapd2.58.3"], # for cups support @@ -221,12 +225,26 @@ def get_root_snippet(self) -> dict[str, Any]: "default-provider": platform_kf6_snap, "target": "$SNAP/kf6", }, + lxqt_support_snap: { + "content": lxqt_support_snap, + "interface": "content", + "target": f"$SNAP/{lxqt_support_snap}", + "default-provider": lxqt_support_snap, + }, **gpu_plugs, }, "environment": { "SNAP_DESKTOP_RUNTIME": "$SNAP/kf6", "GTK_USE_PORTAL": "1", "PLATFORM_PLUG": platform_kf6_snap, + "LD_LIBRARY_PATH": ( + f"$SNAP/{lxqt_support_snap}/usr/lib/" + "${CRAFT_ARCH_TRIPLET_BUILD_FOR}:${LD_LIBRARY_PATH}" + ), + "QT_PLUGIN_PATH": ( + f"$SNAP/{lxqt_support_snap}/usr/lib/" + "${CRAFT_ARCH_TRIPLET_BUILD_FOR}/qt6/plugins:${QT_PLUGIN_PATH}" + ), }, "hooks": { "configure": { @@ -237,6 +255,12 @@ def get_root_snippet(self) -> dict[str, Any]: "layout": { "/usr/share/X11": {"symlink": "$SNAP/kf6/usr/share/X11"}, "/usr/share/qt6": {"symlink": "$SNAP/kf6/usr/share/qt6"}, + "/usr/share/color-schemes": { + "symlink": f"$SNAP/{lxqt_support_snap}/usr/share/color-schemes" + }, + "/usr/share/Kvantum": { + "symlink": f"$SNAP/{lxqt_support_snap}/usr/share/Kvantum" + }, **gpu_layouts, }, } diff --git a/tests/spread/extensions/kde-neon-6-core24/task.yaml b/tests/spread/extensions/kde-neon-6-core24/task.yaml index 0a61d9fe7f..109e40a236 100644 --- a/tests/spread/extensions/kde-neon-6-core24/task.yaml +++ b/tests/spread/extensions/kde-neon-6-core24/task.yaml @@ -44,6 +44,7 @@ execute: | # Verify content snap was installed for dependency checks. snap list gtk-common-themes snap list kf6-core24 + snap list lxqt-support-core24 # Verify all dependencies were found. if echo "$output" | grep -q "part is missing libraries"; then diff --git a/tests/spread/extensions/kde-neon-6/task.yaml b/tests/spread/extensions/kde-neon-6/task.yaml index 812927981d..11f4eaf73f 100644 --- a/tests/spread/extensions/kde-neon-6/task.yaml +++ b/tests/spread/extensions/kde-neon-6/task.yaml @@ -44,6 +44,7 @@ execute: | # Verify content snap was installed for dependency checks. snap list gtk-common-themes snap list kf6-core22 + snap list lxqt-support-core22 # Verify all dependencies were found. if echo "$output" | grep -q "part is missing libraries"; then diff --git a/tests/unit/extensions/test_kde_neon_6.py b/tests/unit/extensions/test_kde_neon_6.py index 95252ae707..3e4fbef21a 100644 --- a/tests/unit/extensions/test_kde_neon_6.py +++ b/tests/unit/extensions/test_kde_neon_6.py @@ -177,6 +177,8 @@ def test_get_root_snippet(kde_neon_6_extension): "SNAP_DESKTOP_RUNTIME": "$SNAP/kf6", "GTK_USE_PORTAL": "1", "PLATFORM_PLUG": "kf6-core22", + "LD_LIBRARY_PATH": "$SNAP/lxqt-support-core22/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:${LD_LIBRARY_PATH}", + "QT_PLUGIN_PATH": "$SNAP/lxqt-support-core22/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/qt6/plugins:${QT_PLUGIN_PATH}", }, "hooks": { "configure": { @@ -188,6 +190,12 @@ def test_get_root_snippet(kde_neon_6_extension): "/usr/share/X11": {"symlink": "$SNAP/kf6/usr/share/X11"}, "/usr/share/qt6": {"symlink": "$SNAP/kf6/usr/share/qt6"}, "/usr/share/libdrm": {"bind": "$SNAP/kf6-core22/usr/share/libdrm"}, + "/usr/share/Kvantum": { + "symlink": "$SNAP/lxqt-support-core22/usr/share/Kvantum" + }, + "/usr/share/color-schemes": { + "symlink": "$SNAP/lxqt-support-core22/usr/share/color-schemes" + }, }, "plugs": { "desktop": {"mount-host-font-cache": False}, @@ -217,6 +225,12 @@ def test_get_root_snippet(kde_neon_6_extension): "default-provider": "kf6-core22", "target": "$SNAP/kf6", }, + "lxqt-support-core22": { + "content": "lxqt-support-core22", + "interface": "content", + "default-provider": "lxqt-support-core22", + "target": "$SNAP/lxqt-support-core22", + }, }, } @@ -229,6 +243,8 @@ def test_get_root_snippet_core24(kde_neon_6_extension_core24): "SNAP_DESKTOP_RUNTIME": "$SNAP/kf6", "GTK_USE_PORTAL": "1", "PLATFORM_PLUG": "kf6-core24", + "LD_LIBRARY_PATH": "$SNAP/lxqt-support-core24/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:${LD_LIBRARY_PATH}", + "QT_PLUGIN_PATH": "$SNAP/lxqt-support-core24/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/qt6/plugins:${QT_PLUGIN_PATH}", }, "hooks": { "configure": { @@ -241,6 +257,12 @@ def test_get_root_snippet_core24(kde_neon_6_extension_core24): "/usr/share/qt6": {"symlink": "$SNAP/kf6/usr/share/qt6"}, "/usr/share/libdrm": {"bind": "$SNAP/gpu-2404/libdrm"}, "/usr/share/drirc.d": {"symlink": "$SNAP/gpu-2404/drirc.d"}, + "/usr/share/Kvantum": { + "symlink": "$SNAP/lxqt-support-core24/usr/share/Kvantum" + }, + "/usr/share/color-schemes": { + "symlink": "$SNAP/lxqt-support-core24/usr/share/color-schemes" + }, }, "plugs": { "desktop": {"mount-host-font-cache": False}, @@ -275,6 +297,12 @@ def test_get_root_snippet_core24(kde_neon_6_extension_core24): "interface": "content", "target": "$SNAP/gpu-2404", }, + "lxqt-support-core24": { + "content": "lxqt-support-core24", + "interface": "content", + "default-provider": "lxqt-support-core24", + "target": "$SNAP/lxqt-support-core24", + }, }, } @@ -314,6 +342,8 @@ def test_get_root_snippet_with_external_sdk(kde_neon_6_extension_with_build_snap "SNAP_DESKTOP_RUNTIME": "$SNAP/kf6", "GTK_USE_PORTAL": "1", "PLATFORM_PLUG": "kf6-core22", + "LD_LIBRARY_PATH": "$SNAP/lxqt-support-core22/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:${LD_LIBRARY_PATH}", + "QT_PLUGIN_PATH": "$SNAP/lxqt-support-core22/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/qt6/plugins:${QT_PLUGIN_PATH}", }, "hooks": { "configure": { @@ -325,6 +355,12 @@ def test_get_root_snippet_with_external_sdk(kde_neon_6_extension_with_build_snap "/usr/share/X11": {"symlink": "$SNAP/kf6/usr/share/X11"}, "/usr/share/qt6": {"symlink": "$SNAP/kf6/usr/share/qt6"}, "/usr/share/libdrm": {"bind": "$SNAP/kf6-core22/usr/share/libdrm"}, + "/usr/share/Kvantum": { + "symlink": "$SNAP/lxqt-support-core22/usr/share/Kvantum" + }, + "/usr/share/color-schemes": { + "symlink": "$SNAP/lxqt-support-core22/usr/share/color-schemes" + }, }, "plugs": { "desktop": {"mount-host-font-cache": False}, @@ -354,6 +390,12 @@ def test_get_root_snippet_with_external_sdk(kde_neon_6_extension_with_build_snap "default-provider": "kf6-core22", "target": "$SNAP/kf6", }, + "lxqt-support-core22": { + "content": "lxqt-support-core22", + "interface": "content", + "default-provider": "lxqt-support-core22", + "target": "$SNAP/lxqt-support-core22", + }, }, } @@ -368,6 +410,8 @@ def test_get_root_snippet_with_external_sdk_core24( "SNAP_DESKTOP_RUNTIME": "$SNAP/kf6", "GTK_USE_PORTAL": "1", "PLATFORM_PLUG": "kf6-core24", + "LD_LIBRARY_PATH": "$SNAP/lxqt-support-core24/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:${LD_LIBRARY_PATH}", + "QT_PLUGIN_PATH": "$SNAP/lxqt-support-core24/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/qt6/plugins:${QT_PLUGIN_PATH}", }, "hooks": { "configure": { @@ -380,6 +424,12 @@ def test_get_root_snippet_with_external_sdk_core24( "/usr/share/qt6": {"symlink": "$SNAP/kf6/usr/share/qt6"}, "/usr/share/libdrm": {"bind": "$SNAP/gpu-2404/libdrm"}, "/usr/share/drirc.d": {"symlink": "$SNAP/gpu-2404/drirc.d"}, + "/usr/share/Kvantum": { + "symlink": "$SNAP/lxqt-support-core24/usr/share/Kvantum" + }, + "/usr/share/color-schemes": { + "symlink": "$SNAP/lxqt-support-core24/usr/share/color-schemes" + }, }, "plugs": { "desktop": {"mount-host-font-cache": False}, @@ -414,6 +464,12 @@ def test_get_root_snippet_with_external_sdk_core24( "interface": "content", "target": "$SNAP/gpu-2404", }, + "lxqt-support-core24": { + "content": "lxqt-support-core24", + "interface": "content", + "default-provider": "lxqt-support-core24", + "target": "$SNAP/lxqt-support-core24", + }, }, }