Ports: Update Qt6 port to 6.4.0

While we're here, make the host path detection more portable.
This commit is contained in:
Andrew Kaster 2022-12-03 09:20:59 -07:00 committed by Linus Groh
parent ad9c24ffc2
commit b7cc7b4e02
Notes: sideshowbarker 2024-07-17 03:51:15 +09:00
9 changed files with 80 additions and 44 deletions

View file

@ -212,7 +212,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n
| [`qemu`](qemu/) | QEMU | 7.1.0 | https://qemu.org |
| [`qoi`](qoi/) | Quite OK Image Format for fast, lossless image compression | edb8d7b | https://github.com/phoboslab/qoi |
| [`qt6-qt5compat`](qt6-qt5compat/) | Qt6 Qt5Compat | 6.2.3 | https://doc.qt.io/qt-6/qtcore5-index.html |
| [`qt6-qtbase`](qt6-qtbase/) | Qt6 QtBase | 6.2.3 | https://qt.io |
| [`qt6-qtbase`](qt6-qtbase/) | Qt6 QtBase | 6.4.0 | https://qt.io |
| [`qt6-serenity`](qt6-serenity/) | QSerenityPlatform | | https://github.com/SerenityPorts/QSerenityPlatform |
| [`quake`](quake/) | Quake | 0.65 | https://github.com/SerenityOS/SerenityQuake |
| [`quake2`](quake2/) | QuakeII | 0.1 | https://github.com/shamazmazum/quake2sdl |

View file

@ -1,31 +1,36 @@
#!/usr/bin/env -S bash ../.port_include.sh
port=qt6-qtbase
version=6.2.3
workdir=qtbase-everywhere-src-${version}
useconfigure=true
files="https://download.qt.io/official_releases/qt/$(cut -d. -f1,2 <<< ${version})/${version}/submodules/qtbase-everywhere-src-${version}.tar.xz qt6-qtbase-${version}.tar.xz 34d6d0072e197241463c417ad72610c3d44e2efd6062868e9a95283103d75df4"
auth_type="sha256"
port='qt6-qtbase'
version='6.4.0'
workdir='qtbase-everywhere-src-${version}'
useconfigure='true'
files="https://download.qt.io/official_releases/qt/$(cut -d. -f1,2 <<< ${version})/${version}/submodules/qtbase-everywhere-src-${version}.tar.xz qt6-qtbase-${version}.tar.xz cb6475a0bd8567c49f7ffbb072a05516ee6671171bed55db75b22b94ead9b37d"
auth_type='sha256'
configopts=(
"-GNinja"
"-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt"
"-DCMAKE_CROSSCOMPILING=ON"
"-DQT_BUILD_TOOLS_WHEN_CROSSCOMPILING=ON"
"-DQT_HOST_PATH=/usr"
"-DQT_FEATURE_cxx20=ON"
"-DQT_FEATURE_ssl=ON"
"-DQT_FEATURE_zstd=ON"
"-DINPUT_opengl=no"
)
depends=("md4c" "zstd" "openssl")
QT_HOST_PATH=/usr
QT_HOST_CMAKE_PATH=${QT_HOST_PATH}/lib64/cmake
QT_HOST_TOOLS="HostInfo CoreTools GuiTools WidgetsTools"
QT_HOST_TOOLS_PATH="${QT_HOST_CMAKE_PATH}/Qt6%s/\n"
depends=(
"double-conversion"
"md4c"
"openssl"
"zstd"
)
QT_DISABLED_FEATURES="sql opengl dbus systemsemaphore sharedmemory dnslookup"
configure() {
QT_HOST_PATH="$(qmake6 -query QT_HOST_PREFIX)"
QT_HOST_CMAKE_PATH="$(qmake6 -query QT_HOST_LIBS)/cmake"
QT_HOST_TOOLS="HostInfo CoreTools GuiTools WidgetsTools"
QT_HOST_TOOLS_PATH="${QT_HOST_CMAKE_PATH}/Qt6%s/\n"
for host_tool in ${QT_HOST_TOOLS}; do
if [[ ! -d $(printf $QT_HOST_TOOLS_PATH $host_tool) ]]; then
echo "You need to have Qt $version installed on the host (path "$(printf $QT_HOST_TOOLS_PATH $host_tool)" is missing)"
@ -36,7 +41,7 @@ configure() {
MERGED_HOST_TOOLS=$(for host_tool in ${QT_HOST_TOOLS}; do echo "-DQt6${host_tool}_DIR=${QT_HOST_CMAKE_PATH}/Qt6${host_tool}/"; done)
MERGED_DISABLED_FEATURES=$(for feature in ${QT_DISABLED_FEATURES}; do echo "-DQT_FEATURE_${feature}=OFF"; done)
run cmake ${configopts[@]} ${MERGED_HOST_TOOLS} ${MERGED_DISABLED_FEATURES}
run cmake ${configopts[@]} "-DQT_HOST_PATH=${QT_HOST_PATH}" ${MERGED_HOST_TOOLS} ${MERGED_DISABLED_FEATURES}
}
build() {

View file

@ -15,10 +15,10 @@ Subject: [PATCH] Add a SerenityOS platform definition
create mode 100644 mkspecs/serenity-g++/qplatformdefs.h
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 6bd255b..ed466b7 100644
index bb7049e76a65cd8fea0ad4aca2f29bdbefbdc86d..df4c9d07f2984ea8ab02d54004335a2d4377f78b 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -325,6 +325,8 @@ elseif(APPLE)
@@ -326,6 +326,8 @@ elseif(APPLE)
set(QT_DEFAULT_MKSPEC macx-clang)
elseif(WASM)
set(QT_DEFAULT_MKSPEC wasm-emscripten)
@ -29,7 +29,7 @@ index 6bd255b..ed466b7 100644
set(QT_ENABLE_CXX_EXTENSIONS ON)
diff --git a/mkspecs/serenity-g++/qmake.conf b/mkspecs/serenity-g++/qmake.conf
new file mode 100644
index 0000000..3808b5a
index 0000000000000000000000000000000000000000..3808b5a269788a32d4aa74aa629b519df80d1000
--- /dev/null
+++ b/mkspecs/serenity-g++/qmake.conf
@@ -0,0 +1,25 @@
@ -60,7 +60,7 @@ index 0000000..3808b5a
+load(qt_config)
diff --git a/mkspecs/serenity-g++/qplatformdefs.h b/mkspecs/serenity-g++/qplatformdefs.h
new file mode 100644
index 0000000..1f0dd98
index 0000000000000000000000000000000000000000..1f0dd9819abb1f8dac52250d24aa8d0763f05445
--- /dev/null
+++ b/mkspecs/serenity-g++/qplatformdefs.h
@@ -0,0 +1,87 @@
@ -152,10 +152,10 @@ index 0000000..1f0dd98
+
+#endif // QPLATFORMDEFS_H
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index c8f9804..5c534c4 100644
index cbbe613e40cd20110b9aa31177d95e0a18bdf9fa..82b3f84800f8c5bf3a7a4567ea55f6a8a4681b13 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -72,6 +72,7 @@
@@ -36,6 +36,7 @@
ANDROID - Android platform
HAIKU - Haiku
WEBOS - LG WebOS
@ -163,7 +163,7 @@ index c8f9804..5c534c4 100644
The following operating systems have variants:
LINUX - both Q_OS_LINUX and Q_OS_ANDROID are defined when building for Android
@@ -165,6 +166,8 @@
@@ -129,6 +130,8 @@
# define Q_OS_VXWORKS
#elif defined(__HAIKU__)
# define Q_OS_HAIKU
@ -173,7 +173,7 @@ index c8f9804..5c534c4 100644
#else
# error "Qt has not been ported to this OS - see http://www.qt-project.org/"
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index 1e212b2..b12c819 100644
index 36dae764d75bf2c3a641ce0776f307755b4ead44..0ab63742665dd7da1259fdfbbb2cc8dab5450578 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -29,6 +29,8 @@ if (QT_FEATURE_gui)
@ -186,10 +186,10 @@ index 1e212b2..b12c819 100644
set(_default_platform "xcb")
endif()
diff --git a/util/cmake/helper.py b/util/cmake/helper.py
index e55a941..87260f3 100644
index f40ea4d61f0d1d658b6715c55cb70c1eadb59a25..d8940f09595c887771f12c0e584936907174c540 100644
--- a/util/cmake/helper.py
+++ b/util/cmake/helper.py
@@ -767,6 +767,7 @@ platform_mapping = {
@@ -696,6 +696,7 @@ platform_mapping = {
"macx": "MACOS",
"macos": "MACOS",
"macx-icc": "(MACOS AND ICC)",

View file

@ -11,7 +11,7 @@ It's probably not done in the cleanest way but it works
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/mkspecs/serenity-g++/qplatformdefs.h b/mkspecs/serenity-g++/qplatformdefs.h
index 1f0dd98..65b641e 100644
index 1f0dd9819abb1f8dac52250d24aa8d0763f05445..65b641e283a42cdc2bd6c63c1750b46e0b33ab02 100644
--- a/mkspecs/serenity-g++/qplatformdefs.h
+++ b/mkspecs/serenity-g++/qplatformdefs.h
@@ -43,6 +43,9 @@
@ -25,10 +25,10 @@ index 1f0dd98..65b641e 100644
// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
diff --git a/src/corelib/kernel/qsharedmemory_p.h b/src/corelib/kernel/qsharedmemory_p.h
index e06e7e8..7292782 100644
index 57dcb2cb93eaacf905c585c3fd24a4c9ed07418b..fefcdc9d159163f34642c1b856cf992e93d234bb 100644
--- a/src/corelib/kernel/qsharedmemory_p.h
+++ b/src/corelib/kernel/qsharedmemory_p.h
@@ -51,6 +51,7 @@
@@ -15,6 +15,7 @@
// We mean it.
//
@ -36,7 +36,7 @@ index e06e7e8..7292782 100644
#include "qsharedmemory.h"
#include <QtCore/qstring.h>
@@ -78,7 +79,7 @@ QT_END_NAMESPACE
@@ -42,7 +43,7 @@ QT_END_NAMESPACE
# include "private/qobject_p.h"
#endif
@ -46,10 +46,10 @@ index e06e7e8..7292782 100644
#endif
diff --git a/src/corelib/kernel/qsystemsemaphore_p.h b/src/corelib/kernel/qsystemsemaphore_p.h
index 56619d7..56cf868 100644
index 09fbcd2ed65a7f8e7bb9756c02209f0eb96ede44..7267c52b11a5c91e062ad20f357a627ae8888b81 100644
--- a/src/corelib/kernel/qsystemsemaphore_p.h
+++ b/src/corelib/kernel/qsystemsemaphore_p.h
@@ -51,6 +51,7 @@
@@ -15,6 +15,7 @@
// We mean it.
//

View file

@ -8,10 +8,10 @@ Subject: [PATCH] Serenity doesn't support utimensat and UTIME_NOW
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp
index 719d3b5..5490e82 100644
index 5a5c45526498f1c8b7ff84353c7d07bb5c1157da..98341c916d0da36a9f154569a23bb2fc0f6b8526 100644
--- a/qmake/library/ioutils.cpp
+++ b/qmake/library/ioutils.cpp
@@ -262,7 +262,7 @@ bool IoUtils::touchFile(const QString &targetFileName, const QString &referenceF
@@ -237,7 +237,7 @@ bool IoUtils::touchFile(const QString &targetFileName, const QString &referenceF
*errorString = fL1S("Cannot stat() reference file %1: %2.").arg(referenceFileName, fL1S(strerror(errno)));
return false;
}

View file

@ -11,10 +11,10 @@ whatever for now.
1 file changed, 6 insertions(+)
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 009aa28..9c0cb52 100644
index 4d69ca9a17d2e24911e92792062a0ab264b83758..527a8ee672d7416b7b915d33d6711e9a1aed2e46 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -2760,6 +2760,12 @@ QStringList QCoreApplication::libraryPathsLocked()
@@ -2746,6 +2746,12 @@ QStringList QCoreApplication::libraryPathsLocked()
}
#endif // Q_OS_DARWIN

View file

@ -11,10 +11,10 @@ and other related ELF objects
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index ed466b7..30668af 100644
index df4c9d07f2984ea8ab02d54004335a2d4377f78b..d46017ddcc0c439bdae478f3dcb1e342fbf4083d 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -327,6 +327,8 @@ elseif(WASM)
@@ -328,6 +328,8 @@ elseif(WASM)
set(QT_DEFAULT_MKSPEC wasm-emscripten)
elseif(SERENITYOS)
set(QT_DEFAULT_MKSPEC serenity-g++)
@ -24,15 +24,15 @@ index ed466b7..30668af 100644
# Certain POSIX defines are not set if we don't compile with -std=gnuXX
set(QT_ENABLE_CXX_EXTENSIONS ON)
diff --git a/src/corelib/global/qversiontagging.cpp b/src/corelib/global/qversiontagging.cpp
index b5e524b..a7547a3 100644
index a8191869cc87be91097e83dda3c6d2dcb566674f..fb129c8b3194ee0a34787545fcb022feaa870214 100644
--- a/src/corelib/global/qversiontagging.cpp
+++ b/src/corelib/global/qversiontagging.cpp
@@ -42,7 +42,7 @@
#define SYM QT_MANGLE_NAMESPACE(qt_version_tag)
//#define SSYM QT_STRINGIFY(SYM)
@@ -21,7 +21,7 @@ extern "C" {
//
// [1] https://sourceware.org/binutils/docs/as/Symver.html
-#if defined(Q_CC_GNU) && defined(Q_OF_ELF) && !defined(Q_OS_ANDROID)
+#if defined(Q_CC_GNU) && defined(Q_OF_ELF) && !defined(Q_OS_ANDROID) && !defined(QT_NO_VERSION_TAGGING)
-#if defined(Q_CC_GNU) && defined(Q_OF_ELF)
+#if defined(Q_CC_GNU) && defined(Q_OF_ELF) && !defined(QT_NO_VERSION_TAGGING)
# define make_versioned_symbol2(sym, m, n, separator) \
Q_CORE_EXPORT extern const char sym ## _ ## m ## _ ## n = 0; \
Q_CORE_EXPORT extern __attribute__((alias("_" SSYM))) const char sym ## _ ## m ## _ ## n; \
asm(".symver " QT_STRINGIFY(sym) "_" QT_STRINGIFY(m) "_" QT_STRINGIFY(n) ", " \

View file

@ -0,0 +1,24 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andrew Kaster <akaster@serenityos.org>
Date: Sat, 3 Dec 2022 09:08:11 -0700
Subject: [PATCH] Serenity: Disable local domain name lookup via resolv
Serenity doesn't support /etc/resolv.conf or the structures in
<resolv.h> to do Unix-like domain name resolution.
---
src/network/kernel/qhostinfo_unix.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index 12d8c04d104b56d3c8d77d338c6427604479003c..f03af1c2b24468fe3a8f5aee952c239128949b03 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -162,7 +162,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
QString QHostInfo::localDomainName()
{
-#if !defined(Q_OS_VXWORKS) && !defined(Q_OS_ANDROID)
+#if !defined(Q_OS_VXWORKS) && !defined(Q_OS_ANDROID) && !defined(Q_OS_SERENITY)
resolveLibrary(NeedResNInit);
if (local_res_ninit) {
// using thread-safe version

View file

@ -31,3 +31,10 @@ Disable version tagging
This is necessary because as of now, Serenity doesn't support DT_VERSYM
and other related ELF objects
## `0006-Serenity-Disable-local-domain-name-lookup-via-resolv.patch`
Serenity: Disable local domain name lookup via resolv
Serenity doesn't support /etc/resolv.conf or the structures in
<resolv.h> to do Unix-like domain name resolution.