diff --git a/schema/snapcraft.json b/schema/snapcraft.json index 02ef004f627..ad0952bdc35 100644 --- a/schema/snapcraft.json +++ b/schema/snapcraft.json @@ -915,8 +915,7 @@ "gnome-3-34", "gnome-3-38", "kde-neon", - "qt5-15", - "qt6-5", + "qt6-8", "ros1-noetic", "ros1-noetic-desktop", "ros1-noetic-perception", diff --git a/snapcraft/extensions/qt_framework.py b/snapcraft/extensions/qt_framework.py index 9b753787169..9a80472340b 100644 --- a/snapcraft/extensions/qt_framework.py +++ b/snapcraft/extensions/qt_framework.py @@ -23,12 +23,8 @@ from .extension import Extension, prepend_to_env -_SDK_SNAP = {"core22": "qt-framework-sdk"} - _CONTENT_SNAP = { - "qt6-6": {"core22": "qt-framework-6-6-core22"}, - "qt6-5": {"core22": "qt-framework-6-5-core22"}, - "qt5-15": {"core22": "qt-framework-5-15-core22"}, + "qt6-8": "qt-framework-6-8", } @@ -100,7 +96,7 @@ def get_app_snippet(self) -> Dict[str, Any]: def qt_snaps(self) -> QTSnaps: """Return the QT related snaps to use to construct the environment.""" base = self.yaml_data["base"] - sdk_snap = _SDK_SNAP[base] + sdk_snap = "qt-framework-sdk" sdk_channel = f"{self.name[2:].replace('-','.')}/stable" build_snaps: List[str] = [] @@ -121,7 +117,7 @@ def qt_snaps(self) -> QTSnaps: sdk = {"snap": sdk_snap, "channel": sdk_channel} # The same except the trailing -sd - content = _CONTENT_SNAP[self.name][base] + content = _CONTENT_SNAP[self.name] return QTSnaps(sdk=sdk, content=content, builtin=builtin) diff --git a/snapcraft/extensions/registry.py b/snapcraft/extensions/registry.py index bfb6a07050b..3ae3ff4d995 100644 --- a/snapcraft/extensions/registry.py +++ b/snapcraft/extensions/registry.py @@ -22,11 +22,8 @@ from .gnome import GNOME from .kde_neon import KDENeon -<<<<<<< HEAD from .kde_neon_6 import KDENeon6 -======= from .qt_framework import QTFramework ->>>>>>> 36e75bee (Add QT extension) from .ros2_humble import ROS2HumbleExtension from .ros2_humble_desktop import ROS2HumbleDesktopExtension from .ros2_humble_ros_base import ROS2HumbleRosBaseExtension @@ -53,9 +50,7 @@ "ros2-jazzy-desktop": ROS2JazzyDesktopExtension, "kde-neon": KDENeon, "kde-neon-6": KDENeon6, - "qt6-6": QTFramework, - "qt6-5": QTFramework, - "qt5-15": QTFramework, + "qt6-8": QTFramework, } diff --git a/tests/spread/extensions/qt5-15/task.yaml b/tests/spread/extensions/qt5-15/task.yaml deleted file mode 100644 index 864fd3d948c..00000000000 --- a/tests/spread/extensions/qt5-15/task.yaml +++ /dev/null @@ -1,51 +0,0 @@ -summary: Build and run a basic qt 5.15 snap using extensions - -systems: - - ubuntu-22.04 - - ubuntu-22.04-64 - - ubuntu-22.04-amd64 - -environment: - SNAP_DIR: ../snaps/qt5-15-hello - -prepare: | - #shellcheck source=tests/spread/tools/snapcraft-yaml.sh - . "$TOOLS_DIR/snapcraft-yaml.sh" - set_base "$SNAP_DIR/snap/snapcraft.yaml" - -restore: | - cd "$SNAP_DIR" - snapcraft clean - rm -f ./*.snap - - #shellcheck source=tests/spread/tools/snapcraft-yaml.sh - . "$TOOLS_DIR/snapcraft-yaml.sh" - restore_yaml "snap/snapcraft.yaml" - -execute: | - cd "$SNAP_DIR" - output="$(snapcraft)" - snap install qt5-15-hello_*.snap --dangerous - - [ "$(qt5-15-hello)" = "hello world" ] - - # Verify that the extension command chain went through the proper setup procedure - snap_user_data="$HOME/snap/qt5-15-hello/current" - [ -d "$snap_user_data/.config" ] - [ -d "$snap_user_data/.local" ] - [ -f "$snap_user_data/.last_revision" ] - [ "$(cat "$snap_user_data/.last_revision")" = "SNAP_DESKTOP_LAST_REVISION=x1" ] - - - # Verify content snap was installed for dependency checks. - snap list gtk-common-themes - if [[ "$SPREAD_SYSTEM" =~ ubuntu-22.04 ]]; then - snap list qt-framework-5-15-core22 - fi - - - # Verify all dependencies were found. - if echo "$output" | grep -q "part is missing libraries"; then - echo "failed to find content snaps' libraries" - exit 1 - fi diff --git a/tests/spread/extensions/qt6-6/task.yaml b/tests/spread/extensions/qt6-6/task.yaml deleted file mode 100644 index 94857ccffb5..00000000000 --- a/tests/spread/extensions/qt6-6/task.yaml +++ /dev/null @@ -1,51 +0,0 @@ -summary: Build and run a basic qt 6.6 snap using extensions - -systems: - - ubuntu-22.04 - - ubuntu-22.04-64 - - ubuntu-22.04-amd64 - -environment: - SNAP_DIR: ../snaps/qt6-6-hello - -prepare: | - #shellcheck source=tests/spread/tools/snapcraft-yaml.sh - . "$TOOLS_DIR/snapcraft-yaml.sh" - set_base "$SNAP_DIR/snap/snapcraft.yaml" - -restore: | - cd "$SNAP_DIR" - snapcraft clean - rm -f ./*.snap - - #shellcheck source=tests/spread/tools/snapcraft-yaml.sh - . "$TOOLS_DIR/snapcraft-yaml.sh" - restore_yaml "snap/snapcraft.yaml" - -execute: | - cd "$SNAP_DIR" - output="$(snapcraft)" - snap install qt6-6-hello_*.snap --dangerous - - [ "$(qt6-6-hello)" = "hello world" ] - - # Verify that the extension command chain went through the proper setup procedure - snap_user_data="$HOME/snap/qt6-6-hello/current" - [ -d "$snap_user_data/.config" ] - [ -d "$snap_user_data/.local" ] - [ -f "$snap_user_data/.last_revision" ] - [ "$(cat "$snap_user_data/.last_revision")" = "SNAP_DESKTOP_LAST_REVISION=x1" ] - - - # Verify content snap was installed for dependency checks. - snap list gtk-common-themes - if [[ "$SPREAD_SYSTEM" =~ ubuntu-22.04 ]]; then - snap list qt-framework-6-6-core22 - fi - - - # Verify all dependencies were found. - if echo "$output" | grep -q "part is missing libraries"; then - echo "failed to find content snaps' libraries" - exit 1 - fi diff --git a/tests/spread/extensions/qt6-5/task.yaml b/tests/spread/extensions/qt6-8/task.yaml similarity index 84% rename from tests/spread/extensions/qt6-5/task.yaml rename to tests/spread/extensions/qt6-8/task.yaml index 1c58ea45f85..75554575896 100644 --- a/tests/spread/extensions/qt6-5/task.yaml +++ b/tests/spread/extensions/qt6-8/task.yaml @@ -6,7 +6,7 @@ systems: - ubuntu-22.04-amd64 environment: - SNAP_DIR: ../snaps/qt6-5-hello + SNAP_DIR: ../snaps/qt6-8-hello prepare: | #shellcheck source=tests/spread/tools/snapcraft-yaml.sh @@ -25,12 +25,12 @@ restore: | execute: | cd "$SNAP_DIR" output="$(snapcraft)" - snap install qt6-5-hello_*.snap --dangerous + snap install qt6-8-hello_*.snap --dangerous - [ "$(qt6-5-hello)" = "hello world" ] + [ "$(qt6-8-hello)" = "hello world" ] # Verify that the extension command chain went through the proper setup procedure - snap_user_data="$HOME/snap/qt6-5-hello/current" + snap_user_data="$HOME/snap/qt6-8-hello/current" [ -d "$snap_user_data/.config" ] [ -d "$snap_user_data/.local" ] [ -f "$snap_user_data/.last_revision" ] @@ -40,7 +40,7 @@ execute: | # Verify content snap was installed for dependency checks. snap list gtk-common-themes if [[ "$SPREAD_SYSTEM" =~ ubuntu-22.04 ]]; then - snap list qt-framework-6-5-core22 + snap list qt-framework-6-8-core22 fi diff --git a/tests/spread/extensions/snaps/qt5-15-hello/CMakeLists.txt b/tests/spread/extensions/snaps/qt5-15-hello/CMakeLists.txt deleted file mode 100644 index d5853b5da97..00000000000 --- a/tests/spread/extensions/snaps/qt5-15-hello/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(hello) - -set (QT_MIN_VERSION "5.7.0") -find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core) - -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") - -add_executable(hello hello.cpp) -target_include_directories(hello PRIVATE ${Qt5Core_INCLUDE_DIRS}) -target_link_libraries(hello PRIVATE Qt5::Core) - -install(TARGETS hello RUNTIME DESTINATION bin) diff --git a/tests/spread/extensions/snaps/qt5-15-hello/snap/snapcraft.yaml b/tests/spread/extensions/snaps/qt5-15-hello/snap/snapcraft.yaml deleted file mode 100644 index 631ed5cb13d..00000000000 --- a/tests/spread/extensions/snaps/qt5-15-hello/snap/snapcraft.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: qt5-15-hello -version: "1.0" -summary: Test the qt5-15 extension -description: It simply prints a hello world - -base: core22 -grade: devel -confinement: strict - -apps: - qt5-15-hello: - command: usr/local/bin/hello - extensions: [qt5-15] - -parts: - hello: - plugin: cmake - source: . - build-packages: - - libpcre2-16-0 - - libglib2.0-0 - - libdouble-conversion3 - - libb2-1 diff --git a/tests/spread/extensions/snaps/qt6-5-hello/CMakeLists.txt b/tests/spread/extensions/snaps/qt6-5-hello/CMakeLists.txt deleted file mode 100644 index 244fca5599c..00000000000 --- a/tests/spread/extensions/snaps/qt6-5-hello/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(hello) - -set (QT_MIN_VERSION "6.5.0") -find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core) - -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") - -add_executable(hello hello.cpp) -target_include_directories(hello PRIVATE ${Qt6Core_INCLUDE_DIRS}) -target_link_libraries(hello PRIVATE Qt6::Core) - -install(TARGETS hello RUNTIME DESTINATION bin) diff --git a/tests/spread/extensions/snaps/qt6-5-hello/hello.cpp b/tests/spread/extensions/snaps/qt6-5-hello/hello.cpp deleted file mode 100644 index 7011be0c9a0..00000000000 --- a/tests/spread/extensions/snaps/qt6-5-hello/hello.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -int main() -{ - QString s("hello world"); - std::cout << s.toUtf8().constData() << std::endl; -} diff --git a/tests/spread/extensions/snaps/qt6-5-hello/snap/snapcraft.yaml b/tests/spread/extensions/snaps/qt6-5-hello/snap/snapcraft.yaml deleted file mode 100644 index 2b26f6bf9f5..00000000000 --- a/tests/spread/extensions/snaps/qt6-5-hello/snap/snapcraft.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: qt6-5-hello -version: "1.0" -summary: Test the qt6-5 extension -description: It simply prints a hello world - -base: core22 -grade: devel -confinement: strict - -apps: - qt6-5-hello: - command: usr/local/bin/hello - extensions: [qt6-5] - -parts: - hello: - plugin: cmake - source: . - build-packages: - - libglib2.0-0 - - libdouble-conversion3 - - libb2-1 diff --git a/tests/spread/extensions/snaps/qt6-6-hello/hello.cpp b/tests/spread/extensions/snaps/qt6-6-hello/hello.cpp deleted file mode 100644 index 7011be0c9a0..00000000000 --- a/tests/spread/extensions/snaps/qt6-6-hello/hello.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -int main() -{ - QString s("hello world"); - std::cout << s.toUtf8().constData() << std::endl; -} diff --git a/tests/spread/extensions/snaps/qt6-6-hello/CMakeLists.txt b/tests/spread/extensions/snaps/qt6-8-hello/CMakeLists.txt similarity index 92% rename from tests/spread/extensions/snaps/qt6-6-hello/CMakeLists.txt rename to tests/spread/extensions/snaps/qt6-8-hello/CMakeLists.txt index 244fca5599c..a0b6db7c67a 100644 --- a/tests/spread/extensions/snaps/qt6-6-hello/CMakeLists.txt +++ b/tests/spread/extensions/snaps/qt6-8-hello/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) project(hello) -set (QT_MIN_VERSION "6.5.0") +set (QT_MIN_VERSION "6.8.0") find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") diff --git a/tests/spread/extensions/snaps/qt5-15-hello/hello.cpp b/tests/spread/extensions/snaps/qt6-8-hello/hello.cpp similarity index 100% rename from tests/spread/extensions/snaps/qt5-15-hello/hello.cpp rename to tests/spread/extensions/snaps/qt6-8-hello/hello.cpp diff --git a/tests/spread/extensions/snaps/qt6-6-hello/snap/snapcraft.yaml b/tests/spread/extensions/snaps/qt6-8-hello/snap/snapcraft.yaml similarity index 80% rename from tests/spread/extensions/snaps/qt6-6-hello/snap/snapcraft.yaml rename to tests/spread/extensions/snaps/qt6-8-hello/snap/snapcraft.yaml index bdea8da8cf8..6bc93bad681 100644 --- a/tests/spread/extensions/snaps/qt6-6-hello/snap/snapcraft.yaml +++ b/tests/spread/extensions/snaps/qt6-8-hello/snap/snapcraft.yaml @@ -1,6 +1,6 @@ -name: qt6-6-hello +name: qt6-8-hello version: "1.0" -summary: Test the qt6-6 extension +summary: Test the qt6-8 extension description: It simply prints a hello world base: core22 @@ -10,7 +10,7 @@ confinement: strict apps: qt6-6-hello: command: usr/local/bin/hello - extensions: [qt6-6] + extensions: [qt6-8] parts: hello: diff --git a/tests/unit/commands/test_list_extensions.py b/tests/unit/commands/test_list_extensions.py index 886bd888c05..1516a76f3cc 100644 --- a/tests/unit/commands/test_list_extensions.py +++ b/tests/unit/commands/test_list_extensions.py @@ -49,9 +49,7 @@ def test_command(emitter, command): gnome-3-38 core20 kde-neon core18, core20, core22 kde-neon-6 core22 - qt5-15 core22 - qt6-5 core22 - qt6-6 core22 + qt6-8 core22, core24 ros1-noetic core20 ros1-noetic-desktop core20 ros1-noetic-perception core20 @@ -100,9 +98,7 @@ def test_command_extension_dups(emitter, command): gnome-3-38 core20 kde-neon core18, core20, core22 kde-neon-6 core22 - qt5-15 core22 - qt6-5 core22 - qt6-6 core22 + qt6-8 core22, core24 ros1-noetic core20 ros1-noetic-desktop core20 ros1-noetic-perception core20 diff --git a/tests/unit/extensions/test_qt_framework.py b/tests/unit/extensions/test_qt_framework.py index f44040598ba..91503475508 100644 --- a/tests/unit/extensions/test_qt_framework.py +++ b/tests/unit/extensions/test_qt_framework.py @@ -26,19 +26,7 @@ fixture_variables = "name,yaml_data,arch,target_arch" base_values = [ ( - "qt6-6", - {"base": "core22", "parts": {}}, - "amd64", - "amd64", - ), - ( - "qt6-5", - {"base": "core22", "parts": {}}, - "amd64", - "amd64", - ), - ( - "qt5-15", + "qt6-8", {"base": "core22", "parts": {}}, "amd64", "amd64", @@ -47,28 +35,10 @@ builtin_stable_values = [ ( - "qt6-6", + "qt6-8", { "base": "core22", - "parts": {"part1": {"build-snaps": ["qt-framework-sdk/6.5/stable"]}}, - }, - "amd64", - "amd64", - ), - ( - "qt6-5", - { - "base": "core22", - "parts": {"part1": {"build-snaps": ["qt-framework-sdk/6.5/stable"]}}, - }, - "amd64", - "amd64", - ), - ( - "qt5-15", - { - "base": "core22", - "parts": {"part1": {"build-snaps": ["qt-framework-sdk/5.15/stable"]}}, + "parts": {"part1": {"build-snaps": ["qt-framework-sdk/6.8/stable"]}}, }, "amd64", "amd64", @@ -77,28 +47,10 @@ builtin_edge_values = [ ( - "qt6-6", + "qt6-8", { "base": "core22", - "parts": {"part1": {"build-snaps": ["qt-framework-sdk/6.5/edge"]}}, - }, - "amd64", - "amd64", - ), - ( - "qt6-5", - { - "base": "core22", - "parts": {"part1": {"build-snaps": ["qt-framework-sdk/6.5/edge"]}}, - }, - "amd64", - "amd64", - ), - ( - "qt5-15", - { - "base": "core22", - "parts": {"part1": {"build-snaps": ["qt-framework-sdk/5.15/edge"]}}, + "parts": {"part1": {"build-snaps": ["qt-framework-sdk/6.8/edge"]}}, }, "amd64", "amd64", @@ -206,7 +158,7 @@ def test_get_root_snippet_with_external_sdk(qt_framework_extension, name, yaml_d "target": "$SNAP/data-dir/sounds", "default-provider": "gtk-common-themes", }, - f"qt-framework-{qt_framework_extension.name[2:]}-core22": { + f"qt-framework-{qt_framework_extension.name[2:]}": { "interface": "content", "default-provider": _CONTENT_SNAP[name][yaml_data["base"]], "target": "$SNAP/qt-framework", diff --git a/tests/unit/extensions/test_registry.py b/tests/unit/extensions/test_registry.py index 6145357e1ce..470d94a4f8a 100644 --- a/tests/unit/extensions/test_registry.py +++ b/tests/unit/extensions/test_registry.py @@ -35,9 +35,7 @@ def test_get_extension_names(): "ros2-jazzy-desktop", "kde-neon", "kde-neon-6", - "qt6-6", - "qt6-5", - "qt5-15", + "qt6-8", "fake-extension-experimental", "fake-extension-extra", "fake-extension",