Skip to content

Commit

Permalink
kde-neon-6: Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ScarlettGatelyMoore committed Oct 4, 2024
1 parent 7bea58e commit 7ef9f48
Show file tree
Hide file tree
Showing 3 changed files with 183 additions and 36 deletions.
34 changes: 19 additions & 15 deletions snapcraft/extensions/kde_neon_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,8 @@

from .extension import Extension, get_extensions_data_dir, prepend_to_env

_QT6_SDK_SNAP = {
"core22": "kde-qt6-core22-sdk",
"core24": "kde-qt6-core24-sdk"
}
_KF6_SDK_SNAP = {
"core22": "kf6-core22-sdk",
"core24": "kf6-core24-sdk"
}
_QT6_SDK_SNAP = {"core22": "kde-qt6-core22-sdk", "core24": "kde-qt6-core24-sdk"}
_KF6_SDK_SNAP = {"core22": "kf6-core22-sdk", "core24": "kf6-core24-sdk"}


@dataclasses.dataclass
Expand All @@ -44,6 +38,8 @@ class KDESnaps6:
kf6_sdk_snap: str
content_qt6: str
content_kf6: str
gpu_plugs: Dict[str, Any]
gpu_layouts: Dict[str, Any]
qt6_builtin: bool = True
kf6_builtin: bool = True

Expand All @@ -58,8 +54,10 @@ class KDENeon6(Extension):
\b
- Common GTK themes.
- breeze GTK theme.
- Common Qt themes.
- Common Icon Themes.
- Breeze Icon theme.
- Common Sound Themes.
- The Qt6 and KDE Frameworks 6 runtime libraries and utilities.
Expand Down Expand Up @@ -95,11 +93,11 @@ def is_experimental(base: Optional[str]) -> bool:

@overrides
def get_app_snippet(self) -> Dict[str, Any]:
command_chain = ["snap/command-chain/desktop-launch"]
command_chain = ["snap/command-chain/desktop-launch6"]
if self.yaml_data["base"] == "core24":
command_chain.insert(0, "snap/command-chain/gpu-2404-wrapper")
return {
"command-chain": commandchain,
"command-chain": command_chain,
"plugs": [
"desktop",
"desktop-legacy",
Expand All @@ -124,9 +122,7 @@ def kde_snaps(self) -> KDESnaps6:
case "core22":
gpu_plugs = {}
gpu_layouts = {
"/usr/share/libdrm": {
"bind": "$SNAP/kf6-core22/usr/share/libdrm"
},
"/usr/share/libdrm": {"bind": "$SNAP/kf6-core22/usr/share/libdrm"},
}
case "core24":
gpu_plugs = {
Expand Down Expand Up @@ -176,12 +172,16 @@ def kde_snaps(self) -> KDESnaps6:
kf6_sdk_snap=kf6_sdk_snap,
content_kf6=content_kf6_snap,
kf6_builtin=kf6_builtin,
gpu_layouts=gpu_layouts,
gpu_plugs=gpu_plugs,
)

@overrides
def get_root_snippet(self) -> Dict[str, Any]:
platform_kf6_snap = self.kde_snaps.content_kf6
content_kf6_snap = self.kde_snaps.content_kf6 + "-all"
gpu_plugs = self.kde_snaps.gpu_plugs
gpu_layouts = self.kde_snaps.gpu_layouts

return {
"assumes": ["snapd2.58.3"], # for 'snapctl is-connected'
Expand All @@ -193,7 +193,7 @@ def get_root_snippet(self) -> Dict[str, Any]:
"target": "$SNAP/data-dir/themes",
"default-provider": "gtk-common-themes",
},
"gtk-theme-breeze": {
"gtk-2-theme-breeze": {
"interface": "content",
"target": "$SNAP/data-dir/themes",
"default-provider": "gtk-theme-breeze",
Expand All @@ -203,6 +203,11 @@ def get_root_snippet(self) -> Dict[str, Any]:
"target": "$SNAP/data-dir/themes",
"default-provider": "gtk-common-themes",
},
"gtk-3-theme-breeze": {
"interface": "content",
"target": "$SNAP/data-dir/themes",
"default-provider": "gtk-theme-breeze",
},
"icon-theme-breeze": {
"interface": "content",
"target": "$SNAP/data-dir/icons",
Expand Down Expand Up @@ -353,7 +358,6 @@ def get_parts_snippet(self) -> Dict[str, Any]:
if self.yaml_data["base"] == "core24":
gpu_opts["make-parameters"] = ["GPU_WRAPPER=gpu-2404-wrapper"]


if self.kde_snaps.kf6_builtin:
return {
"kde-neon-6/sdk": {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/commands/test_list_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_command(emitter, command):
gnome-3-34 core18
gnome-3-38 core20
kde-neon core18, core20, core22
kde-neon-6 core22
kde-neon-6 core22, core24
ros1-noetic core20
ros1-noetic-desktop core20
ros1-noetic-perception core20
Expand Down Expand Up @@ -96,7 +96,7 @@ def test_command_extension_dups(emitter, command):
gnome-3-34 core18
gnome-3-38 core20
kde-neon core18, core20, core22
kde-neon-6 core22
kde-neon-6 core22, core24
ros1-noetic core20
ros1-noetic-desktop core20
ros1-noetic-perception core20
Expand Down
Loading

0 comments on commit 7ef9f48

Please sign in to comment.