diff --git a/package-system/Qt/Dockerfile b/package-system/Qt/Dockerfile index 9d7caa62..82ca087c 100644 --- a/package-system/Qt/Dockerfile +++ b/package-system/Qt/Dockerfile @@ -23,6 +23,7 @@ RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ update-locale LANG=en_US.UTF-8 ENV LANG=en_US.UTF-8 +ENV ENABLE_QT_WAYLAND=0 # Install the development packages needed to build Qt from source RUN apt-get install -y qtbase5-dev \ diff --git a/package-system/Qt/Dockerfile.wayland b/package-system/Qt/Dockerfile.wayland new file mode 100644 index 00000000..69f7bc45 --- /dev/null +++ b/package-system/Qt/Dockerfile.wayland @@ -0,0 +1,58 @@ + +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# + +# This docker file uses ubuntu 20.04 as the base image to install the dependencies to build Qt from source +# + +FROM public.ecr.aws/ubuntu/ubuntu:20.04_stable + +WORKDIR /data/workspace + +# Initilize apt cache +RUN apt-get clean && apt-get update + +# Setup time zone and locale data (necessary for SSL and HTTPS packages) +RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata locales keyboard-configuration + +RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ + dpkg-reconfigure --frontend=noninteractive locales && \ + update-locale LANG=en_US.UTF-8 + +ENV LANG=en_US.UTF-8 +ENV ENABLE_QT_WAYLAND=1 + +# Install the development packages needed to build Qt from source +RUN apt-get install -y qtbase5-dev \ + build-essential \ + perl \ + python3 \ + git \ + '^libxcb.*-dev' \ + libx11-xcb-dev \ + libglu1-mesa-dev \ + libxrender-dev \ + libxi-dev \ + libxkbcommon-dev \ + libxkbcommon-x11-dev \ + libgbm-dev \ + libxext-dev \ + libfontconfig1-dev \ + libtiff-dev \ + libwayland-dev \ + libwayland-egl1-mesa \ + libwayland-server0 \ + libgles2-mesa-dev + +# Prepare a target folder within the container to install the build artifacts tp +RUN mkdir -p /data/workspace/qt + +RUN git clone --single-branch --recursive --branch v5.15.1 git://code.qt.io/qt/qtwayland.git && \ + ln -s /data/workspace/qtwayland/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/qwayland-server-qt-texture-sharing-unstable-v1.h /data/workspace/qtwayland/src/compositor/qwayland-server-qt-texture-sharing-unstable-v1.h && \ + ln -s /data/workspace/qtwayland/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/wayland-qt-texture-sharing-unstable-v1-server-protocol.h /data/workspace/qtwayland/src/compositor/wayland-qt-texture-sharing-unstable-v1-server-protocol.h + +# Copy the build script specific to this Docker script in order to execute the build +COPY docker_build_qt_linux.sh /data/workspace/ diff --git a/package-system/Qt/FindQt.cmake.wayland b/package-system/Qt/FindQt.cmake.wayland new file mode 100644 index 00000000..d50c7132 --- /dev/null +++ b/package-system/Qt/FindQt.cmake.wayland @@ -0,0 +1,288 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +if(TARGET 3rdParty::Qt::Core) # Check we are not called multiple times + return() +endif() + +set(QT_PACKAGE_NAME qt) + +set(QT_PATH "${CMAKE_CURRENT_LIST_DIR}/qt-wayland" CACHE STRING "The root path to Qt" FORCE) +mark_as_advanced(QT_PATH) +if(NOT EXISTS ${QT_PATH}) + message(FATAL_ERROR "Cannot find 3rdParty library ${QT_PACKAGE_NAME} on path ${QT_PATH}") +endif() + +# Force-set QtCore's version here to ensure CMake detects Qt's existence and allows AUTOMOC to work +set(Qt5Core_VERSION_MAJOR "5" CACHE STRING "Qt's major version" FORCE) +set(Qt5Core_VERSION_MINOR "15" CACHE STRING "Qt's minor version" FORCE) +set(Qt5Core_VERSION_PATCH "2" CACHE STRING "Qt's patch version" FORCE) +mark_as_advanced(Qt5Core_VERSION_MAJOR) +mark_as_advanced(Qt5Core_VERSION_MINOR) +mark_as_advanced(Qt5Core_VERSION_PATCH) + +set(QT5_COMPONENTS + Core + Concurrent + Gui + LinguistTools + Network + OpenGL + Svg + Test + Widgets + Xml +) + +include(${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/Qt_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) + +list(APPEND CMAKE_PREFIX_PATH ${QT_LIB_PATH}/cmake/Qt5) + +# Clear the cache for found DIRs +unset(Qt5_DIR CACHE) +foreach(component ${QT5_COMPONENTS}) + unset(Qt5${component}_DIR CACHE) +endforeach() +unset(Qt5Positioning_DIR CACHE) +unset(Qt5PrintSupport_DIR CACHE) +unset(Qt5Qml_DIR CACHE) +unset(Qt5QmlModels_DIR CACHE) +unset(Qt5Quick_DIR CACHE) + +# Populate the Qt5 configurations +find_package(Qt5 + COMPONENTS ${QT5_COMPONENTS} + REQUIRED + NO_CMAKE_PACKAGE_REGISTRY +) + +# Now create libraries that wrap the dependency so we can refer to them in our format +foreach(component ${QT5_COMPONENTS}) + if(TARGET Qt5::${component}) + + # Convert the includes to system includes + get_target_property(system_includes Qt5::${component} INTERFACE_INCLUDE_DIRECTORIES) + set_target_properties(Qt5::${component} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "") # Clear it in case someone refers to it + ly_target_include_system_directories(TARGET Qt5::${component} + INTERFACE ${system_includes} + ) + + # Alias the target with our prefix + add_library(3rdParty::Qt::${component} ALIAS Qt5::${component}) + mark_as_advanced(Qt5${component}_DIR) # Hiding from GUI + + # Qt only has debug and release, we map the configurations we use in o3de. We map all the configurations + # except debug to release + foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES) + string(TOUPPER ${conf} UCONF) + ly_qt_configuration_mapping(${UCONF} MAPPED_CONF) + set_target_properties(Qt5::${component} PROPERTIES + MAP_IMPORTED_CONFIG_${UCONF} ${MAPPED_CONF} + ) + endforeach() + + endif() +endforeach() + +# Some extra DIR variables we want to hide from GUI +mark_as_advanced(Qt5_DIR) # Hiding from GUI +mark_as_advanced(Qt5LinguistTools_DIR) # Hiding from GUI, this variable comes from the LinguistTools module +mark_as_advanced(Qt5Positioning_DIR) +mark_as_advanced(Qt5PrintSupport_DIR) +mark_as_advanced(Qt5Qml_DIR) +mark_as_advanced(Qt5QmlModels_DIR) +mark_as_advanced(Qt5Quick_DIR) + +# Special case for Qt::Gui, we are using the private headers... +ly_target_include_system_directories(TARGET Qt5::Gui + INTERFACE "${Qt5Gui_PRIVATE_INCLUDE_DIRS}" +) + +# Another special case: Qt:Widgets, we are also using private headers +ly_target_include_system_directories(TARGET Qt5::Widgets + INTERFACE "${Qt5Widgets_PRIVATE_INCLUDE_DIRS}" +) + +# Qt plugins/translations/aux files. +# We create libraries that wraps them so they get deployed properly. +# This used to be deployed through winqtdeploy/macqtdeploy, however, those tools +# are old and unmaintaned, macqtdeploy takes long times to run +add_library(3rdParty::Qt::Core::Translations INTERFACE IMPORTED GLOBAL) +file(GLOB tranlation_files ${QT_PATH}/translations/qt_*.qm) +if(tranlation_files) + ly_add_target_files(TARGETS 3rdParty::Qt::Core::Translations + FILES ${tranlation_files} + OUTPUT_SUBDIRECTORY translations + ) +endif() +ly_add_dependencies(Qt5::Core 3rdParty::Qt::Core::Translations) + +# plugins, each platform will define the files it has and the OUTPUT_SUBDIRECTORY +set(QT_PLUGINS + Network + Gui + Widgets +) +foreach(plugin ${QT_PLUGINS}) + add_library(3rdParty::Qt::${plugin}::Plugins INTERFACE IMPORTED GLOBAL) + ly_add_dependencies(Qt5::${plugin} 3rdParty::Qt::${plugin}::Plugins) +endforeach() +include(${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/QtPlugin_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) + +# UIC executable +unset(QT_UIC_EXECUTABLE CACHE) +find_program(QT_UIC_EXECUTABLE uic HINTS "${QT_PATH}/bin") +mark_as_advanced(QT_UIC_EXECUTABLE) # Hiding from GUI + +# RCC executable +unset(AUTORCC_EXECUTABLE CACHE) +find_program(AUTORCC_EXECUTABLE rcc HINTS "${QT_PATH}/bin") +mark_as_advanced(AUTORCC_EXECUTABLE) # Hiding from GUI +set(Qt5Core_RCC_EXECUTABLE "${AUTORCC_EXECUTABLE}" CACHE FILEPATH "Qt's resource compiler, used by qt5_add_resources" FORCE) +mark_as_advanced(Qt5Core_RCC_EXECUTABLE) # Hiding from GUI + +# LRELEASE executable +unset(QT_LRELEASE_EXECUTABLE CACHE) +find_program(QT_LRELEASE_EXECUTABLE lrelease HINTS "${QT_PATH}/bin") +mark_as_advanced(QT_LRELEASE_EXECUTABLE) # Hiding from GUI +if(NOT QT_LRELEASE_EXECUTABLE) + message(FATAL_ERROR "Qt's lrelease executbale not found") +endif() +set(Qt5_LRELEASE_EXECUTABLE "${QT_LRELEASE_EXECUTABLE}" CACHE FILEPATH "Qt's lrelease executable, used by qt5_add_translation" FORCE) +mark_as_advanced(Qt5_LRELEASE_EXECUTABLE) # Hiding from GUI + +#! ly_qt_uic_target: handles qt's ui files by injecting uic generation +# +# AUTOUIC has issues to detect changes in UIC files and trigger regeneration: +# https://gitlab.kitware.com/cmake/cmake/-/issues/18741 +# So instead, we are going to manually wrap the files. We dont use qt5_wrap_ui because +# it outputs to ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h and we want to follow the +# same folder structure that AUTOUIC uses +# +function(ly_qt_uic_target TARGET) + + get_target_property(all_ui_sources ${TARGET} SOURCES) + list(FILTER all_ui_sources INCLUDE REGEX "^.*\\.ui$") + if(NOT all_ui_sources) + message(FATAL_ERROR "Target ${TARGET} contains AUTOUIC but doesnt have any .ui file") + endif() + + if(AUTOGEN_BUILD_DIR) + set(gen_dir ${AUTOGEN_BUILD_DIR}) + else() + set(gen_dir ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_autogen/include) + endif() + + foreach(ui_source ${all_ui_sources}) + + get_filename_component(filename ${ui_source} NAME_WE) + get_filename_component(dir ${ui_source} DIRECTORY) + if(IS_ABSOLUTE ${dir}) + file(RELATIVE_PATH dir ${CMAKE_CURRENT_SOURCE_DIR} ${dir}) + endif() + + set(outfolder ${gen_dir}/${dir}) + set(outfile ${outfolder}/ui_${filename}.h) + get_filename_component(infile ${ui_source} ABSOLUTE) + + file(MAKE_DIRECTORY ${outfolder}) + add_custom_command(OUTPUT ${outfile} + COMMAND ${QT_UIC_EXECUTABLE} -o ${outfile} ${infile} + MAIN_DEPENDENCY ${infile} VERBATIM + COMMENT "UIC ${infile}" + ) + + set_source_files_properties(${infile} PROPERTIES SKIP_AUTOUIC TRUE) + set_source_files_properties(${outfile} PROPERTIES + SKIP_AUTOMOC TRUE + SKIP_AUTOUIC TRUE + GENERATED TRUE + ) + list(APPEND all_ui_wrapped_sources ${outfile}) + + endforeach() + + # Add files to the target + target_sources(${TARGET} PRIVATE ${all_ui_wrapped_sources}) + source_group("Generated Files" FILES ${all_ui_wrapped_sources}) + + # Add include directories relative to the generated folder + # query for the property first to avoid the "NOTFOUND" in a list + get_property(has_includes TARGET ${TARGET} PROPERTY INCLUDE_DIRECTORIES SET) + if(has_includes) + get_property(all_include_directories TARGET ${TARGET} PROPERTY INCLUDE_DIRECTORIES) + foreach(dir ${all_include_directories}) + if(IS_ABSOLUTE ${dir}) + file(RELATIVE_PATH dir ${CMAKE_CURRENT_SOURCE_DIR} ${dir}) + endif() + list(APPEND new_includes ${gen_dir}/${dir}) + endforeach() + endif() + list(APPEND new_includes ${gen_dir}) + target_include_directories(${TARGET} PRIVATE ${new_includes}) + +endfunction() + +#! ly_add_translations: adds translations (ts) to a target. +# +# This wrapper will generate a qrc file with those translations and add the files under "prefix" and add them to +# the indicated targets. These files will be added under the "Generated Files" filter +# +# \arg:TARGETS name of the targets that the translations will be added to +# \arg:PREFIX prefix where the translation will be located within the qrc file +# \arg:FILES translation files to add +# +function(ly_add_translations) + + set(options) + set(oneValueArgs PREFIX) + set(multiValueArgs TARGETS FILES) + + cmake_parse_arguments(ly_add_translations "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + # Validate input arguments + if(NOT ly_add_translations_TARGETS) + message(FATAL_ERROR "You must provide at least one target") + endif() + if(NOT ly_add_translations_FILES) + message(FATAL_ERROR "You must provide at least a translation file") + endif() + + qt5_add_translation(TRANSLATED_FILES ${ly_add_translations_FILES}) + + set(qrc_file_contents +" + +") + foreach(file ${TRANSLATED_FILES}) + get_filename_component(filename ${file} NAME) + string(APPEND qrc_file_contents " ${filename} +") + endforeach() + string(APPEND qrc_file_contents " + +") + set(qrc_file_path ${CMAKE_CURRENT_BINARY_DIR}/i18n_${ly_add_translations_PREFIX}.qrc) + file(WRITE + ${qrc_file_path} + ${qrc_file_contents} + ) + set_source_files_properties( + ${TRANSLATED_FILES} + ${qrc_file_path} + PROPERTIES + GENERATED TRUE + SKIP_AUTORCC TRUE + ) + qt5_add_resources(RESOURCE_FILE ${qrc_file_path}) + + foreach(target ${ly_add_translations_TARGETS}) + target_sources(${target} PRIVATE "${TRANSLATED_FILES};${qrc_file_path};${RESOURCE_FILE}") + endforeach() + +endfunction() diff --git a/package-system/Qt/build-linux-aarch64.sh b/package-system/Qt/build-linux-aarch64.sh deleted file mode 100755 index 9c66c2d6..00000000 --- a/package-system/Qt/build-linux-aarch64.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# - -# TEMP_FOLDER and TARGET_INSTALL_ROOT get set from the pull_and_build_from_git.py script - -TIFF_PACKAGE=tiff-4.2.0.15-rev3-linux-aarch64 -ZLIB_PACKAGE=zlib-1.2.11-rev5-linux-aarch64 -OPENSSL_PACKAGE=OpenSSL-1.1.1t-rev1-linux-aarch64 - -./build-linux.sh $TIFF_PACKAGE $ZLIB_PACKAGE $OPENSSL_PACKAGE - -exit $? diff --git a/package-system/Qt/build-linux-x86.sh b/package-system/Qt/build-linux-x86.sh deleted file mode 100755 index eb440e27..00000000 --- a/package-system/Qt/build-linux-x86.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# - -# TEMP_FOLDER and TARGET_INSTALL_ROOT get set from the pull_and_build_from_git.py script - -TIFF_PACKAGE=tiff-4.2.0.15-rev3-linux -ZLIB_PACKAGE=zlib-1.2.11-rev5-linux -OPENSSL_PACKAGE=OpenSSL-1.1.1t-rev1-linux - -./build-linux.sh $TIFF_PACKAGE $ZLIB_PACKAGE $OPENSSL_PACKAGE - -exit $? diff --git a/package-system/Qt/build-linux.sh b/package-system/Qt/build-linux.sh index e5530d7a..e6e1a8a3 100755 --- a/package-system/Qt/build-linux.sh +++ b/package-system/Qt/build-linux.sh @@ -18,6 +18,9 @@ ZLIB_FOLDER_NAME=$2 # Arg 3: The openssl package name OPENSSL_FOLDER_NAME=$3 +# Arg 4: Addition optional arg +EXTRA_ARG=$4 + # Make sure docker is installed DOCKER_VERSION=$(docker --version) if [ $? -ne 0 ] @@ -33,10 +36,19 @@ cp docker_build_qt_linux.sh temp/ pushd temp +# Check if we are building the wayland variation +if [ "$EXTRA_ARG" = "wayland" ] +then + DOCKERFILE=Dockerfile.wayland + DOCKER_IMAGE_NAME=qt_linux_3p_wayland +else + DOCKERFILE=Dockerfile + DOCKER_IMAGE_NAME=qt_linux_3p +fi + # Build the Docker Image echo "Building the docker build script" -DOCKER_IMAGE_NAME=qt_linux_3p -docker build -f ../Dockerfile -t ${DOCKER_IMAGE_NAME}:latest . +docker build -f ../$DOCKERFILE -t ${DOCKER_IMAGE_NAME}:latest . if [ $? -ne 0 ] then echo "Error occurred creating Docker image ${DOCKER_IMAGE_NAME}:latest." @@ -74,7 +86,7 @@ fi # Copy the build artifacts from the Docker Container echo "Copying the built contents from the docker container for image ${DOCKER_IMAGE_NAME}" -docker cp $CONTAINER_ID:/data/workspace/qt/. $TARGET_INSTALL_ROOT +docker cp --follow-link $CONTAINER_ID:/data/workspace/qt/. $TARGET_INSTALL_ROOT if [ $? -ne 0 ] then echo "Error occurred copying build artifacts from Docker image ${DOCKER_IMAGE_NAME}:latest." diff --git a/package-system/Qt/build_config.json b/package-system/Qt/build_config.json index b996304c..bd1bc8df 100644 --- a/package-system/Qt/build_config.json +++ b/package-system/Qt/build_config.json @@ -57,7 +57,10 @@ ["zlib-1.2.11-rev5-linux", "9be5ea85722fc27a8645a9c8a812669d107c68e6baa2ca0740872eaeb6a8b0fc", ""] ], "custom_build_cmd": [ - "./build-linux-x86.sh" + "./build-linux.sh", + "tiff-4.2.0.15-rev3-linux", + "zlib-1.2.11-rev5-linux", + "OpenSSL-1.1.1t-rev1-linux" ], "custom_install_cmd": [ "{python}", "copy_platform_cmakes.py" @@ -72,7 +75,10 @@ ["zlib-1.2.11-rev5-linux-aarch64", "ce9d1ed2883d77ffc69c7982c078595c1f89ca55ec19d89fe7e6beb05f774775", ""] ], "custom_build_cmd": [ - "./build-linux-aarch64.sh" + "./build-linux.sh", + "tiff-4.2.0.15-rev3-linux-aarch64", + "zlib-1.2.11-rev5-linux-aarch64", + "OpenSSL-1.1.1t-rev1-linux-aarch64" ], "custom_install_cmd": [ "{python}", "copy_platform_cmakes.py" diff --git a/package-system/Qt/build_config_wayland.json b/package-system/Qt/build_config_wayland.json new file mode 100644 index 00000000..15caad56 --- /dev/null +++ b/package-system/Qt/build_config_wayland.json @@ -0,0 +1,53 @@ +{ + "git_url": "https://github.com/o3de/qt5.git", + "git_tag": "5.15.1-o3de", + "git_commit": "b3a1a6947422928e8aecb14ad607199e9720d266", + "package_name": "qt-wayland", + "package_url": "https://www.qt.io/", + "package_license": "LGPL-3.0", + "package_license_file": "qt/LICENSE.LGPLv3", + "cmake_find_source": "FindQt.cmake.wayland", + "cmake_find_target": "FindQt.cmake", + "Platforms": { + "Linux": { + "Linux": { + "package_version": "5.15.2-rev9", + "patch_file": "qt-linux.patch", + "depends_on_packages": [ + ["OpenSSL-1.1.1t-rev1-linux", "63aea898b7afe8faccd0c7261e62d2f8b7b870f678a4520d5be81e5815542b39", ""], + ["tiff-4.2.0.15-rev3-linux", "2377f48b2ebc2d1628d9f65186c881544c92891312abe478a20d10b85877409a", ""], + ["zlib-1.2.11-rev5-linux", "9be5ea85722fc27a8645a9c8a812669d107c68e6baa2ca0740872eaeb6a8b0fc", ""] + ], + "custom_build_cmd": [ + "./build-linux.sh", + "tiff-4.2.0.15-rev3-linux", + "zlib-1.2.11-rev5-linux", + "OpenSSL-1.1.1t-rev1-linux", + "wayland" + ], + "custom_install_cmd": [ + "{python}", "copy_platform_cmakes.py" + ] + }, + "Linux-aarch64": { + "package_version": "5.15.2-rev9", + "patch_file": "qt-linux.patch", + "depends_on_packages": [ + ["OpenSSL-1.1.1t-rev1-linux-aarch64", "f32721bec9c82d1bd7fb244d78d5dc4e2a47e7b808bb36027236ad377e241ea5", ""], + ["tiff-4.2.0.15-rev3-linux-aarch64", "429461014b21a530dcad597c2d91072ae39d937a04b7bbbf5c34491c41767f7f", ""], + ["zlib-1.2.11-rev5-linux-aarch64", "ce9d1ed2883d77ffc69c7982c078595c1f89ca55ec19d89fe7e6beb05f774775", ""] + ], + "custom_build_cmd": [ + "./build-linux.sh", + "tiff-4.2.0.15-rev3-linux-aarch64", + "zlib-1.2.11-rev5-linux-aarch64", + "OpenSSL-1.1.1t-rev1-linux-aarch64", + "wayland" + ], + "custom_install_cmd": [ + "{python}", "copy_platform_cmakes.py" + ] + } + } + } +} diff --git a/package-system/Qt/docker_build_qt_linux.sh b/package-system/Qt/docker_build_qt_linux.sh index 84cc65f1..7fcc2846 100755 --- a/package-system/Qt/docker_build_qt_linux.sh +++ b/package-system/Qt/docker_build_qt_linux.sh @@ -23,7 +23,6 @@ echo " " $TIFF_PACKAGE_DIR echo " " $ZLIB_PACKAGE_DIR echo " " $OPENSSL_PACKAGE_DIR - # Base the Tiff of the dependent tiff O3DE package (static) TIFF_PREFIX=$TIFF_PACKAGE_DIR/tiff TIFF_INCDIR=$TIFF_PREFIX/include @@ -45,41 +44,81 @@ INSTALL_PATH=/data/workspace/qt [[ -d $BUILD_PATH ]] || mkdir $BUILD_PATH cd $BUILD_PATH -echo Configuring Qt... -../src/configure -prefix ${INSTALL_PATH} \ - -opensource \ - -nomake examples \ - -nomake tests \ - -confirm-license \ - -no-icu \ - -dbus \ - -no-separate-debug-info \ - -release \ - -force-debug-info \ - -qt-libpng \ - -qt-libjpeg \ - -no-feature-vnc \ - -no-feature-linuxfb \ - --tiff=system \ - -qt-zlib \ - -v \ - -no-cups \ - -no-glib \ - -no-feature-renameat2 \ - -no-feature-getentropy \ - -no-feature-statx \ - -no-egl \ - -qpa xcb \ - -xcb-xlib \ - -openssl \ - -I $TIFF_INCDIR \ - -I $ZLIB_INCDIR \ - -I $OPENSSL_INCDIR \ - -L $TIFF_LIBDIR \ - -L $ZLIB_LIBDIR \ - -L $OPENSSL_LIBDIR \ - -c++std c++1z \ - -fontconfig +if [ "$ENABLE_QT_WAYLAND" -eq 1 ] +then + echo Configuring Qt for wayland ... + + ../src/configure -prefix ${INSTALL_PATH} \ + -opensource \ + -nomake examples \ + -nomake tests \ + -confirm-license \ + -no-icu \ + -dbus \ + -no-separate-debug-info \ + -release \ + -force-debug-info \ + -qt-libpng \ + -qt-libjpeg \ + -no-feature-vnc \ + -no-feature-linuxfb \ + --tiff=system \ + -qt-zlib \ + -v \ + -no-cups \ + -no-glib \ + -no-feature-renameat2 \ + -no-feature-getentropy \ + -no-feature-statx \ + -no-egl \ + -feature-wayland-server \ + -qpa wayland \ + -I $TIFF_INCDIR \ + -I $ZLIB_INCDIR \ + -I $OPENSSL_INCDIR \ + -L $TIFF_LIBDIR \ + -L $ZLIB_LIBDIR \ + -L $OPENSSL_LIBDIR \ + -c++std c++1z \ + -fontconfig +else + echo Configuring Qt for xcb ... + + ../src/configure -prefix ${INSTALL_PATH} \ + -opensource \ + -nomake examples \ + -nomake tests \ + -confirm-license \ + -no-icu \ + -dbus \ + -no-separate-debug-info \ + -release \ + -force-debug-info \ + -qt-libpng \ + -qt-libjpeg \ + -no-feature-vnc \ + -no-feature-linuxfb \ + --tiff=system \ + -qt-zlib \ + -v \ + -no-cups \ + -no-glib \ + -no-feature-renameat2 \ + -no-feature-getentropy \ + -no-feature-statx \ + -no-egl \ + -qpa xcb \ + -xcb-xlib \ + -openssl \ + -I $TIFF_INCDIR \ + -I $ZLIB_INCDIR \ + -I $OPENSSL_INCDIR \ + -L $TIFF_LIBDIR \ + -L $ZLIB_LIBDIR \ + -L $OPENSSL_LIBDIR \ + -c++std c++1z \ + -fontconfig +fi if [ $? -ne 0 ] then echo "Failed to configure Qt" @@ -117,4 +156,34 @@ for qtlib in "${qtarray[@]}"; do echo $qtlib installed. done +if [ "$ENABLE_QT_WAYLAND" -eq 1 ] +then + cd /data/workspace/qtwayland + + /data/workspace/build/qtbase/bin/qmake + if [ $? -ne 0 ] + then + echo "qmake failed for qtwayland" + exit 1 + fi + make + if [ $? -ne 0 ] + then + echo "make failed for qtwayland" + exit 1 + fi + + make install + if [ $? -ne 0 ] + then + echo "make install failed for qtwayland" + exit 1 + fi + + rm ${INSTALL_PATH}/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/qwayland-server-qt-texture-sharing-unstable-v1.h + cp /data/workspace/qtwayland/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/qwayland-server-qt-texture-sharing-unstable-v1.h ${INSTALL_PATH}/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/ + rm ${INSTALL_PATH}/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/wayland-qt-texture-sharing-unstable-v1-server-protocol.h + cp /data/workspace/qtwayland/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/wayland-qt-texture-sharing-unstable-v1-server-protocol.h ${INSTALL_PATH}/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/ +fi + echo Qt installed successfully! diff --git a/package_build_list_host_linux-aarch64.json b/package_build_list_host_linux-aarch64.json index 8041f529..e382e7aa 100644 --- a/package_build_list_host_linux-aarch64.json +++ b/package_build_list_host_linux-aarch64.json @@ -35,6 +35,7 @@ "pyside2-5.15.2.1-py3.10-rev7-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Linux-aarch64 --clean", "python-3.10.13-rev2-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/python --platform-name Linux-aarch64 --clean", "qt-5.15.2-rev9-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Linux-aarch64 --clean", + "qt-wayland-5.15.2-rev9-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --build-config-file build_config_wayland.json --platform-name Linux-aarch64 --package-root ../../package-system/Qt/temp --clean", "sdformat-13.5.0-rev2-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/sdformat --platform-name Linux-aarch64 --clean", "SPIRVCross-1.3.275.0-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/SPIRVCross --platform-name Linux-aarch64 --clean", "SQLite-3.37.2-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/sqlite --platform-name Linux-aarch64 --clean", @@ -76,6 +77,7 @@ "pyside2-5.15.2.1-py3.10-rev7-linux-aarch64": "package-system/pyside2/temp/pyside2-linux-aarch64", "python-3.10.13-rev2-linux-aarch64": "package-system/python/temp/python-linux-aarch64", "qt-5.15.2-rev9-linux-aarch64": "package-system/Qt/temp/qt-linux-aarch64", + "qt-wayland-5.15.2-rev9-linux": "package-system/Qt/temp/qt-wayland-linux-aarch64", "sdformat-13.5.0-rev2-linux-aarch64": "package-system/sdformat/temp/sdformat-linux-aarch64", "SPIRVCross-1.3.275.0-rev1-linux-aarch64": "package-system/SPIRVCross/temp/SPIRVCross-linux-aarch64", "SQLite-3.37.2-rev1-linux-aarch64": "package-system/sqlite/temp/SQLite-linux-aarch64", diff --git a/package_build_list_host_linux.json b/package_build_list_host_linux.json index 4d369a72..fe18b0ce 100644 --- a/package_build_list_host_linux.json +++ b/package_build_list_host_linux.json @@ -47,6 +47,7 @@ "python-3.10.13-rev2-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/python --platform-name Linux-aarch64 --clean", "mikkelsen-1.0.0.4-linux": "package-system/mikkelsen/build_package_image.py", "qt-5.15.2-rev9-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Linux --package-root ../../package-system/Qt/temp --clean", + "qt-wayland-5.15.2-rev9-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --build-config-file build_config_wayland.json --platform-name Linux --package-root ../../package-system/Qt/temp --clean", "zlib-1.2.11-rev5-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Linux --package-root ../../package-system --clean", "lz4-1.9.4-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/lz4 --platform-name Linux --package-root ../../package-system/lz4/temp --clean", "expat-2.4.2-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/expat --platform-name Linux --package-root ../../package-system/expat/temp --clean", @@ -98,6 +99,7 @@ "SQLite-3.37.2-rev1-linux": "package-system/SQLite-linux", "xxhash-0.7.4-rev1-multiplatform": "package-system/xxhash-multiplatform", "qt-5.15.2-rev9-linux": "package-system/Qt/temp/qt-linux", + "qt-wayland-5.15.2-rev9-linux": "package-system/Qt/temp/qt-wayland-linux", "zlib-1.2.11-rev5-linux": "package-system/zlib-linux", "lz4-1.9.4-rev2-linux": "package-system/lz4/temp/lz4-linux", "expat-2.4.2-rev2-linux": "package-system/expat/temp/expat-linux",