mirror of
https://github.com/termux-pacman/termux-packages.git
synced 2026-01-07 11:23:23 +00:00
addpkg(x11): qt6-qtbase
This commit is contained in:
133
x11-packages/qt6-qtbase/build.sh
Normal file
133
x11-packages/qt6-qtbase/build.sh
Normal file
@@ -0,0 +1,133 @@
|
||||
TERMUX_PKG_HOMEPAGE=https://www.qt.io/
|
||||
TERMUX_PKG_DESCRIPTION="A cross-platform application and UI framework"
|
||||
TERMUX_PKG_LICENSE="GPL-3.0"
|
||||
TERMUX_PKG_LICENSE_FILE="LICENSES/GPL-3.0-only.txt"
|
||||
TERMUX_PKG_MAINTAINER="@termux"
|
||||
TERMUX_PKG_VERSION="6.7.1"
|
||||
TERMUX_PKG_SRCURL="https://download.qt.io/official_releases/qt/${TERMUX_PKG_VERSION%.*}/${TERMUX_PKG_VERSION}/submodules/qtbase-everywhere-src-${TERMUX_PKG_VERSION}.tar.xz"
|
||||
TERMUX_PKG_SHA256=b7338da1bdccb4d861e714efffaa83f174dfe37e194916bfd7ec82279a6ace19
|
||||
TERMUX_PKG_DEPENDS="brotli, double-conversion, freetype, glib, harfbuzz, libandroid-shmem, libandroid-sysv-semaphore, libc++, libdrm, libice, libicu, libjpeg-turbo, libpng, libsm, libsqlite, libuuid, libx11, libxcb, libxi, libxkbcommon, libwayland, opengl, openssl, pcre2, vulkan-loader, xcb-util-cursor, xcb-util-image, xcb-util-keysyms, xcb-util-renderutil, xcb-util-wm, zlib, zstd"
|
||||
TERMUX_PKG_BUILD_DEPENDS="libwayland-protocols, vulkan-headers, vulkan-loader-generic"
|
||||
TERMUX_PKG_HOSTBUILD=true
|
||||
TERMUX_PKG_FORCE_CMAKE=true
|
||||
TERMUX_PKG_NO_STATICSPLIT=true
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
||||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
|
||||
-DCMAKE_MESSAGE_LOG_LEVEL=STATUS
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DFEATURE_journald=OFF
|
||||
-DFEATURE_no_direct_extern_access=ON
|
||||
-DFEATURE_openssl_linked=ON
|
||||
-DFEATURE_system_sqlite=ON
|
||||
-DINSTALL_ARCHDATADIR=lib/qt6
|
||||
-DINSTALL_BINDIR=lib/qt6/bin
|
||||
-DINSTALL_DATADIR=share/qt6
|
||||
-DINSTALL_DOCDIR=share/doc/qt6
|
||||
-DINSTALL_EXAMPLESDIR=share/doc/qt6/examples
|
||||
-DINSTALL_INCLUDEDIR=include/qt6
|
||||
-DINSTALL_LIBEXECDIR=lib/qt6
|
||||
-DINSTALL_MKSPECSDIR=lib/qt6/mkspecs
|
||||
-DINSTALL_PUBLICBINDIR=${TERMUX_PREFIX}/bin
|
||||
-DQT_ALLOW_SYMLINK_IN_PATHS=OFF
|
||||
-DQT_FEATURE_freetype=ON
|
||||
-DQT_FEATURE_gui=ON
|
||||
-DQT_FEATURE_harfbuzz=ON
|
||||
-DQT_FEATURE_widgets=ON
|
||||
-DQT_FEATURE_zstd=ON
|
||||
-DQT_HOST_PATH=${TERMUX_PREFIX}/opt/qt6/cross
|
||||
"
|
||||
TERMUX_PKG_NO_SHEBANG_FIX_FILES="
|
||||
lib/qt6/bin/qmake
|
||||
lib/qt6/bin/qmake6
|
||||
lib/qt6/bin/qt-cmake
|
||||
lib/qt6/bin/qt-cmake-create
|
||||
lib/qt6/bin/qt-configure-module
|
||||
lib/qt6/bin/qtpaths
|
||||
lib/qt6/bin/qtpaths6
|
||||
opt/qt6/cross/lib/cmake/Qt6/libexec/qt-internal-ninja.in
|
||||
opt/qt6/cross/lib/cmake/Qt6/libexec/qt-internal-strip.in
|
||||
opt/qt6/cross/lib/qt6/bin/qt-cmake
|
||||
opt/qt6/cross/lib/qt6/bin/qt-cmake-create
|
||||
opt/qt6/cross/lib/qt6/bin/qt-configure-module
|
||||
opt/qt6/cross/lib/qt6/mkspecs/features/data/mac/objc_namespace.sh
|
||||
opt/qt6/cross/lib/qt6/mkspecs/features/uikit/device_destinations.sh
|
||||
opt/qt6/cross/lib/qt6/mkspecs/features/uikit/devices.py
|
||||
opt/qt6/cross/lib/qt6/qt-cmake-private
|
||||
opt/qt6/cross/lib/qt6/qt-cmake-standalone-test
|
||||
opt/qt6/cross/lib/qt6/qt-internal-configure-examples
|
||||
opt/qt6/cross/lib/qt6/qt-internal-configure-tests
|
||||
opt/qt6/cross/lib/qt6/qt-testrunner.py
|
||||
opt/qt6/cross/lib/qt6/sanitizer-testrunner.py
|
||||
"
|
||||
TERMUX_PKG_RM_AFTER_INSTALL="
|
||||
lib/objects-*
|
||||
opt/qt6/cross/lib/objects-*
|
||||
"
|
||||
|
||||
termux_step_host_build() {
|
||||
termux_setup_cmake
|
||||
termux_setup_ninja
|
||||
|
||||
cmake \
|
||||
-G Ninja \
|
||||
-S ${TERMUX_PKG_SRCDIR} \
|
||||
-DCMAKE_BUILD_TYPE=MinSizeRel \
|
||||
-DCMAKE_INSTALL_PREFIX=${TERMUX_PREFIX}/opt/qt6/cross \
|
||||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
|
||||
-DCMAKE_MESSAGE_LOG_LEVEL=STATUS \
|
||||
-DFEATURE_journald=OFF \
|
||||
-DFEATURE_openssl_linked=ON \
|
||||
-DFEATURE_system_sqlite=ON \
|
||||
-DINSTALL_ARCHDATADIR=lib/qt6 \
|
||||
-DINSTALL_BINDIR=lib/qt6/bin \
|
||||
-DINSTALL_DATADIR=share/qt6 \
|
||||
-DINSTALL_DOCDIR=share/doc/qt6 \
|
||||
-DINSTALL_EXAMPLESDIR=share/doc/qt6/examples \
|
||||
-DINSTALL_INCLUDEDIR=include/qt6 \
|
||||
-DINSTALL_LIBEXECDIR=lib/qt6 \
|
||||
-DINSTALL_MKSPECSDIR=lib/qt6/mkspecs \
|
||||
-DINSTALL_PUBLICBINDIR=${TERMUX_PREFIX}/opt/qt6/cross/bin \
|
||||
-DQT_ALLOW_SYMLINK_IN_PATHS=OFF \
|
||||
-DQT_FEATURE_freetype=ON \
|
||||
-DQT_FEATURE_gui=ON \
|
||||
-DQT_FEATURE_harfbuzz=ON \
|
||||
-DQT_FEATURE_widgets=ON \
|
||||
-DQT_FEATURE_zstd=OFF
|
||||
ninja \
|
||||
-j ${TERMUX_MAKE_PROCESSES} \
|
||||
install
|
||||
|
||||
mkdir -p ${TERMUX_PREFIX}/opt/qt6/cross/bin
|
||||
find "$PWD" -type f -name user_facing_tool_links.txt \
|
||||
-exec echo "{}" \; \
|
||||
-exec cat "{}" \; \
|
||||
-exec sed -e "s|^${TERMUX_PREFIX}/opt/qt6/cross|..|g" -i "{}" \;
|
||||
cat $PWD/user_facing_tool_links.txt | xargs -P${TERMUX_MAKE_PROCESSES} -L1 ln -sv
|
||||
find ${TERMUX_PREFIX}/opt/qt6/cross -type f -name target_qt.conf \
|
||||
-exec echo "{}" \; \
|
||||
-exec cat "{}" \;
|
||||
}
|
||||
|
||||
termux_step_pre_configure() {
|
||||
termux_setup_cmake
|
||||
termux_setup_ninja
|
||||
[[ "${TERMUX_ARCH}" == "arm" ]] && termux_setup_no_integrated_as
|
||||
|
||||
LDFLAGS+=" -landroid-shmem -landroid-sysv-semaphore"
|
||||
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+="
|
||||
-DCMAKE_C_COMPILER_AR=$(command -v llvm-ar)
|
||||
-DCMAKE_C_COMPILER_RANLIB=$(command -v llvm-ranlib)
|
||||
-DCMAKE_CXX_COMPILER_AR=$(command -v llvm-ar)
|
||||
-DCMAKE_CXX_COMPILER_RANLIB=$(command -v llvm-ranlib)
|
||||
"
|
||||
}
|
||||
|
||||
termux_step_post_make_install() {
|
||||
find ${TERMUX_PKG_BUILDDIR} -type f -name user_facing_tool_links.txt \
|
||||
-exec echo "{}" \; \
|
||||
-exec cat "{}" \;
|
||||
find ${TERMUX_PREFIX}/lib/qt6 -type f -name target_qt.conf \
|
||||
-exec echo "{}" \; \
|
||||
-exec cat "{}" \;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/cmake/QtInstallHelpers.cmake
|
||||
+++ b/cmake/QtInstallHelpers.cmake
|
||||
@@ -170,7 +170,7 @@
|
||||
" string(PREPEND qt_full_install_prefix \"$ENV\{DESTDIR}\")"
|
||||
" endif()"
|
||||
" message(STATUS \"Creating hard link ${original} -> ${linkname}\")"
|
||||
- " file(CREATE_LINK \"${original}\" \"${linkname}\" COPY_ON_ERROR)")
|
||||
+ " file(CREATE_LINK \"${original}\" \"${linkname}\" COPY_ON_ERROR SYMBOLIC)")
|
||||
|
||||
if(QT_GENERATOR_IS_MULTI_CONFIG)
|
||||
# Wrap the code in a configuration check,
|
||||
@@ -0,0 +1,5 @@
|
||||
TERMUX_SUBPKG_DESCRIPTION="Tools for cross build on the host (NOT for Termux)"
|
||||
TERMUX_SUBPKG_PLATFORM_INDEPENDENT=true
|
||||
TERMUX_SUBPKG_INCLUDE="
|
||||
opt/qt6/cross
|
||||
"
|
||||
109
x11-packages/qt6-qtbase/qt6-qtbase.patch.beforehostbuild
Normal file
109
x11-packages/qt6-qtbase/qt6-qtbase.patch.beforehostbuild
Normal file
@@ -0,0 +1,109 @@
|
||||
--- a/src/corelib/global/qsystemdetection.h
|
||||
+++ b/src/corelib/global/qsystemdetection.h
|
||||
@@ -78,7 +78,7 @@
|
||||
# define Q_OS_WEBOS
|
||||
# define Q_OS_LINUX
|
||||
#elif defined(__ANDROID__) || defined(ANDROID)
|
||||
-# define Q_OS_ANDROID
|
||||
+# define Q_OS_ANDROID_EMBEDDED
|
||||
# define Q_OS_LINUX
|
||||
#elif defined(__CYGWIN__)
|
||||
# define Q_OS_CYGWIN
|
||||
--- a/src/corelib/io/qfilesystemengine_unix.cpp
|
||||
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
|
||||
@@ -66,7 +66,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
-#if defined(Q_OS_ANDROID)
|
||||
+#if defined(Q_OS_ANDROID) || defined(__ANDROID__)
|
||||
// statx() is disabled on Android because quite a few systems
|
||||
// come with sandboxes that kill applications that make system calls outside a
|
||||
// whitelist and several Android vendors can't be bothered to update the list.
|
||||
@@ -82,7 +82,7 @@
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
enum {
|
||||
-#ifdef Q_OS_ANDROID
|
||||
+#if defined(Q_OS_ANDROID) || defined(__ANDROID__)
|
||||
// On Android, the link(2) system call has been observed to always fail
|
||||
// with EACCES, regardless of whether there are permission problems or not.
|
||||
SupportsHardlinking = false
|
||||
@@ -644,7 +644,7 @@
|
||||
{
|
||||
Q_CHECK_FILE_NAME(entry, entry);
|
||||
|
||||
-#if !defined(Q_OS_DARWIN) && !defined(Q_OS_QNX) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU) && _POSIX_VERSION < 200809L
|
||||
+#if !defined(Q_OS_DARWIN) && !defined(Q_OS_QNX) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU) && _POSIX_VERSION < 200809L && !defined(__ANDROID__)
|
||||
// realpath(X,0) is not supported
|
||||
Q_UNUSED(data);
|
||||
return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath()));
|
||||
@@ -667,7 +667,7 @@
|
||||
# endif
|
||||
};
|
||||
std::unique_ptr<char, decltype (resolved_path_deleter)> resolved_name {nullptr, resolved_path_deleter};
|
||||
-# if defined(Q_OS_DARWIN) || defined(Q_OS_ANDROID)
|
||||
+# if defined(Q_OS_DARWIN) || defined(Q_OS_ANDROID) || defined(__ANDROID__)
|
||||
// On some Android and macOS versions, realpath() will return a path even if
|
||||
// it does not exist. To work around this, we check existence in advance.
|
||||
if (!data.hasFlags(QFileSystemMetaData::ExistsAttribute))
|
||||
@@ -798,7 +798,7 @@
|
||||
|
||||
#if !defined(Q_OS_INTEGRITY) && !defined(Q_OS_WASM)
|
||||
struct group *gr = nullptr;
|
||||
-#if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID) && (__ANDROID_API__ >= 24))
|
||||
+#if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS) && (!defined(Q_OS_ANDROID) || !defined(__ANDROID__) || defined(Q_OS_ANDROID) && (__ANDROID_API__ >= 24))
|
||||
size_max = sysconf(_SC_GETGR_R_SIZE_MAX);
|
||||
if (size_max == -1)
|
||||
size_max = 1024;
|
||||
--- a/src/corelib/io/qtemporaryfile_p.h
|
||||
+++ b/src/corelib/io/qtemporaryfile_p.h
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "private/qfile_p.h"
|
||||
#include "qtemporaryfile.h"
|
||||
|
||||
-#if defined(Q_OS_LINUX) && QT_CONFIG(linkat)
|
||||
+#if defined(Q_OS_LINUX) && !defined(__ANDROID__) && QT_CONFIG(linkat)
|
||||
# include <fcntl.h>
|
||||
# ifdef O_TMPFILE
|
||||
// some early libc support had the wrong values for O_TMPFILE
|
||||
--- a/src/corelib/thread/qthread_unix.cpp
|
||||
+++ b/src/corelib/thread/qthread_unix.cpp
|
||||
@@ -61,7 +61,7 @@
|
||||
# define SCHED_IDLE 5
|
||||
#endif
|
||||
|
||||
-#if defined(Q_OS_DARWIN) || !defined(Q_OS_ANDROID) && !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
|
||||
+#if !defined(__ANDROID__) && (defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0))
|
||||
#define QT_HAS_THREAD_PRIORITY_SCHEDULING
|
||||
#endif
|
||||
|
||||
@@ -742,7 +742,7 @@
|
||||
|
||||
void QThread::terminate()
|
||||
{
|
||||
-#if !defined(Q_OS_ANDROID)
|
||||
+#if !defined(__ANDROID__)
|
||||
Q_D(QThread);
|
||||
QMutexLocker locker(&d->mutex);
|
||||
|
||||
@@ -785,7 +785,7 @@
|
||||
"Current thread was not started with QThread.");
|
||||
|
||||
Q_UNUSED(thr);
|
||||
-#if defined(Q_OS_ANDROID)
|
||||
+#if defined(Q_OS_ANDROID) || defined(__ANDROID__)
|
||||
Q_UNUSED(enabled);
|
||||
#else
|
||||
pthread_setcancelstate(enabled ? PTHREAD_CANCEL_ENABLE : PTHREAD_CANCEL_DISABLE, nullptr);
|
||||
--- a/src/network/ssl/qsslsocket.cpp
|
||||
+++ b/src/network/ssl/qsslsocket.cpp
|
||||
@@ -2958,6 +2958,7 @@
|
||||
ba("/etc/openssl/certs/"), // BlackBerry
|
||||
ba("/opt/openssl/certs/"), // HP-UX
|
||||
ba("/etc/ssl/"), // OpenBSD
|
||||
+ ba("@TERMUX_PREFIX@/etc/tls/"), // Termux
|
||||
};
|
||||
return QList<QByteArray>::fromReadOnlyData(dirs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user