Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions snapcraft/extensions/kde_neon_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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": {
Expand All @@ -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,
},
}
Expand Down
1 change: 1 addition & 0 deletions tests/spread/extensions/kde-neon-6-core24/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/spread/extensions/kde-neon-6/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
56 changes: 56 additions & 0 deletions tests/unit/extensions/test_kde_neon_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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},
Expand Down Expand Up @@ -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",
},
},
}

Expand All @@ -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": {
Expand All @@ -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},
Expand Down Expand Up @@ -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",
},
},
}

Expand Down Expand Up @@ -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": {
Expand All @@ -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},
Expand Down Expand Up @@ -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",
},
},
}

Expand All @@ -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": {
Expand All @@ -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},
Expand Down Expand Up @@ -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",
},
},
}

Expand Down
Loading