From eaf157e539348f0935e98212bd2918d1ab8684e5 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Thu, 13 Sep 2018 02:45:54 +0300 Subject: [PATCH] initialize qt5-base --- x11-packages/qt5-base/build.sh | 95 +++++++++++++++++++ x11-packages/qt5-base/execinfo.h | 6 ++ x11-packages/qt5-base/mkspec.diff | 81 ++++++++++++++++ .../qt5-base/qsystemdetection.h.patch | 12 +++ x11-packages/qt5-base/qthread_unix.cpp.patch | 47 +++++++++ ...-plugins-geoservices-geoservices.pro.patch | 14 +++ ...-src-plugins-sensors-linux-linux.pro.patch | 10 ++ ...-src-serialport-qserialport_unix.cpp.patch | 11 +++ 8 files changed, 276 insertions(+) create mode 100644 x11-packages/qt5-base/build.sh create mode 100644 x11-packages/qt5-base/execinfo.h create mode 100644 x11-packages/qt5-base/mkspec.diff create mode 100644 x11-packages/qt5-base/qsystemdetection.h.patch create mode 100644 x11-packages/qt5-base/qthread_unix.cpp.patch create mode 100644 x11-packages/qt5-base/qtlocation-src-plugins-geoservices-geoservices.pro.patch create mode 100644 x11-packages/qt5-base/qtsensors-src-plugins-sensors-linux-linux.pro.patch create mode 100644 x11-packages/qt5-base/qtserialport-src-serialport-qserialport_unix.cpp.patch diff --git a/x11-packages/qt5-base/build.sh b/x11-packages/qt5-base/build.sh new file mode 100644 index 000000000..b72f13624 --- /dev/null +++ b/x11-packages/qt5-base/build.sh @@ -0,0 +1,95 @@ +TERMUX_PKG_MAINTAINER="Leonid Plyushch @xeffyr" + +TERMUX_PKG_HOMEPAGE=http://qt-project.org/ +TERMUX_PKG_DESCRIPTION="A cross-platform application and UI framework" +TERMUX_PKG_VERSION=5.11.1 +TERMUX_PKG_SRCURL="http://download.qt.io/official_releases/qt/${TERMUX_PKG_VERSION%.*}/$TERMUX_PKG_VERSION/single/qt-everywhere-src-$TERMUX_PKG_VERSION.tar.xz" +TERMUX_PKG_SHA256=39602cb08f9c96867910c375d783eed00fc4a244bffaa93b801225d17950fb2b +#TERMUX_PKG_DEPENDS="libsqlite, libjpeg-turbo, libpng, pcre2, openssl, libandroid-support, freetype, harfbuzz, libwebp, postgresql, mariadb, fontconfig, libopus, libevent, jsoncpp, libprotobuf" +TERMUX_PKG_DEPENDS="libsqlite, libjpeg-turbo, libpng, pcre2, openssl, libandroid-support, freetype, harfbuzz, libwebp, fontconfig, libopus, libevent, jsoncpp" +TERMUX_PKG_BUILD_IN_SRC=true + +termux_step_pre_configure () { + #if [ $TERMUX_ARCH_BITS = 32 ]; then + # CPPFLAGS+=" -DTERMUX_EXPOSE_FILE_OFFSET64=1" + #fi + #LDFLAGS+=" -llog -lpcre2-16 -lpng16 -ljpeg -lsqlite3 -lssl -lfreetype -lharfbuzz -lz -lfontconfig -lwebp -lpq -lmariadb" + LDFLAGS+=" -llog -lpcre2-16 -lpng16 -ljpeg -lsqlite3 -lssl -lfreetype -lharfbuzz -lz -lfontconfig -lwebp" + #CPPFLAGS+=" -I$TERMUX_PKG_SRCDIR/include -I$TERMUX_PREFIX/include/freetype2 -I$TERMUX_PREFIX/include/fontconfig -I$TERMUX_PREFIX/include/mysql -I$TERMUX_PKG_BUILDER_DIR" + CPPFLAGS+=" -I$TERMUX_PKG_SRCDIR/include -I$TERMUX_PREFIX/include/freetype2 -I$TERMUX_PREFIX/include/fontconfig -I$TERMUX_PKG_BUILDER_DIR" + #CFLAGS+=" $CPPFLAGS" + #CXXFLAGS+=" $CPPFLAGS" + sed -e "s|@TERMUX_HOST_PLATFORM@|$TERMUX_HOST_PLATFORM|g" \ + -e "s|@CFLAGS@|$CPPFLAGS $CFLAGS|" \ + -e "s|@CXXFLAGS@|$CPPFLAGS $CXXFLAGS|" \ + -e "s|@LDFLAGS@|$LDFLAGS|" $TERMUX_PKG_BUILDER_DIR/mkspec.diff | patch -p1 +} + +termux_step_configure () { + export PKG_CONFIG_SYSROOT_DIR="${TERMUX_PREFIX}" + + $TERMUX_PKG_SRCDIR/configure \ + -prefix "${TERMUX_PREFIX}" \ + -xplatform linux-termux-clang \ + -plugindir "$TERMUX_PREFIX/libexec/Qt" \ + -opensource \ + -confirm-license \ + -debug \ + -no-compile-examples \ + -gui \ + -no-widgets \ + -no-dbus \ + -no-accessibility \ + -no-glib \ + -no-eventfd \ + -no-inotify \ + -no-system-proxies \ + -no-cups \ + -no-opengl \ + -qpa xcb \ + -no-eglfs \ + -no-gbm \ + -no-kms \ + -no-linuxfb \ + -no-mirclient \ + -xcb \ + -no-libudev \ + -no-evdev \ + -no-libinput \ + -no-mtdev \ + -no-tslib \ + -gif \ + -ico \ + -system-libpng \ + -system-libjpeg \ + -sql-sqlite \ + -system-sqlite \ + -no-pulseaudio \ + -no-alsa \ + -no-gstreamer \ + -no-webengine-alsa \ + -no-webengine-pulseaudio \ + -no-webengine-embedded-build + + make \ + -j ${TERMUX_MAKE_PROCESSES} \ + -C "${TERMUX_PKG_BUILDDIR}" \ + module-qtbase +} + +termux_step_post_massage () { + # cross compilation only builds tools usable on build machine (i.e. cross tools) + # manually make tools to be used by the host machine + for tool in src/tools/{moc,qlalr,uic,rcc} qmake; do + cd "$TERMUX_PKG_SRCDIR"/qtbase/$tool + make clean $TERMUX_PKG_EXTRA_MAKE_ARGS + $TERMUX_PREFIX/bin/qmake + make -j $TERMUX_MAKE_PROCESSES $TERMUX_PKG_EXTRA_MAKE_ARGS + #make -j $TERMUX_MAKE_PROCESSES $TERMUX_PKG_EXTRA_MAKE_ARGS CC=$CC CXX=$CXX LINK=$CXX AR="$AR cqs" STRIP=$STRIP \ + # QMAKESPEC=$TERMUX_PKG_SRCDIR/qtbase/mkspecs/linux-termux-clang \ + # QMAKE_LFLAGS=$TERMUX_PREFIX/lib/libc++_shared.so \ + # LIBS="$TERMUX_PREFIX/lib/libc++_shared.so $TERMUX_PKG_BUILDDIR/qtbase/lib/libQt5Core.so $LDFLAGS" + done + + cp "$TERMUX_PKG_BUILDDIR"/qtbase/bin/{moc,qlalr,uic,rcc,qmake} "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX"/bin/ +} diff --git a/x11-packages/qt5-base/execinfo.h b/x11-packages/qt5-base/execinfo.h new file mode 100644 index 000000000..d62d3f73d --- /dev/null +++ b/x11-packages/qt5-base/execinfo.h @@ -0,0 +1,6 @@ +#ifndef FAKE_EXECINFO_H +#define FAKE_EXECINFO_H +int backtrace(void **array, int size) { return 0; } +char **backtrace_symbols(void *const *array, int size) { return 0; } +void backtrace_symbols_fd (void *const *array, int size, int fd) {} +#endif diff --git a/x11-packages/qt5-base/mkspec.diff b/x11-packages/qt5-base/mkspec.diff new file mode 100644 index 000000000..7d14b1a91 --- /dev/null +++ b/x11-packages/qt5-base/mkspec.diff @@ -0,0 +1,81 @@ +--- ./qtbase/mkspecs/linux-termux-clang/qmake.conf 1970-01-01 05:30:00.000000000 +0530 ++++ ./qtbase/mkspecs/linux-termux-clang/qmake.conf 2017-07-14 23:06:45.553367565 +0530 +@@ -0,0 +1,32 @@ ++MAKEFILE_GENERATOR = UNIX ++CONFIG += incremental unversioned_libname unversioned_soname plugin_with_soname qt ++QMAKE_INCREMENTAL_STYLE = sublib ++ ++include(../common/linux.conf) ++include(../common/gcc-base-unix.conf) ++include(../common/clang.conf) ++ ++QMAKE_CC = @TERMUX_HOST_PLATFORM@-clang ++QMAKE_CXX = @TERMUX_HOST_PLATFORM@-clang++ ++QMAKE_LINK = @TERMUX_HOST_PLATFORM@-clang++ ++QMAKE_LINK_SHLIB = @TERMUX_HOST_PLATFORM@-clang++ ++ ++QMAKE_AR = @TERMUX_HOST_PLATFORM@-ar cqs ++QMAKE_OBJCOPY = @TERMUX_HOST_PLATFORM@-objcopy ++QMAKE_NM = @TERMUX_HOST_PLATFORM@-nm -P ++QMAKE_STRIP = @TERMUX_HOST_PLATFORM@-strip ++ ++QMAKE_CFLAGS = @CFLAGS@ ++QMAKE_CXXFLAGS = @CXXFLAGS@ ++QMAKE_LFLAGS = @LDFLAGS@ ++ ++QMAKE_LFLAGS_APP = -Wl,--no-undefined -Wl,-z,noexecstack -shared ++QMAKE_LFLAGS_SHLIB = -Wl,--no-undefined -Wl,-z,noexecstack -shared ++QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB ++QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined ++ ++QMAKE_LIBS_THREAD = ++QMAKE_LIBS_X11 = ++QMAKE_LIBS_OPENGL = ++QMAKE_LIBS_OPENGL_ES2 = -lGLESv3 ++load(qt_config) +--- ./qtbase/mkspecs/linux-termux-clang/qplatformdefs.h 1970-01-01 05:30:00.000000000 +0530 ++++ ./qtbase/mkspecs/linux-termux-clang/qplatformdefs.h 2017-07-14 23:08:02.031153237 +0530 +@@ -0,0 +1,43 @@ ++/**************************************************************************** ++** ++** Copyright (C) 2016 The Qt Company Ltd. ++** Contact: https://www.qt.io/licensing/ ++** ++** This file is part of the qmake spec of the Qt Toolkit. ++** ++** $QT_BEGIN_LICENSE:LGPL$ ++** Commercial License Usage ++** Licensees holding valid commercial Qt licenses may use this file in ++** accordance with the commercial license agreement provided with the ++** Software or, alternatively, in accordance with the terms contained in ++** a written agreement between you and The Qt Company. For licensing terms ++** and conditions see https://www.qt.io/terms-conditions. For further ++** information use the contact form at https://www.qt.io/contact-us. ++** ++** GNU Lesser General Public License Usage ++** Alternatively, this file may be used under the terms of the GNU Lesser ++** General Public License version 3 as published by the Free Software ++** Foundation and appearing in the file LICENSE.LGPL3 included in the ++** packaging of this file. Please review the following information to ++** ensure the GNU Lesser General Public License version 3 requirements ++** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ++** ++** GNU General Public License Usage ++** Alternatively, this file may be used under the terms of the GNU ++** General Public License version 2.0 or (at your option) the GNU General ++** Public license version 3 or any later version approved by the KDE Free ++** Qt Foundation. The licenses are as published by the Free Software ++** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ++** included in the packaging of this file. Please review the following ++** information to ensure the GNU General Public License requirements will ++** be met: https://www.gnu.org/licenses/gpl-2.0.html and ++** https://www.gnu.org/licenses/gpl-3.0.html. ++** ++** $QT_END_LICENSE$ ++** ++****************************************************************************/ ++ ++#include "../android-clang/qplatformdefs.h" ++#define fseeko64 fseeko ++#define ftello64 ftello ++#define fopen64 fopen diff --git a/x11-packages/qt5-base/qsystemdetection.h.patch b/x11-packages/qt5-base/qsystemdetection.h.patch new file mode 100644 index 000000000..89f96ca3b --- /dev/null +++ b/x11-packages/qt5-base/qsystemdetection.h.patch @@ -0,0 +1,12 @@ +--- ./qtbase/src/corelib/global/qsystemdetection.h 2017-06-28 15:24:29.000000000 +0530 ++++ ../qsystemdetection.h 2017-07-19 19:39:39.617805768 +0530 +@@ -120,9 +120,6 @@ + # else + # error "Qt has not been ported to this Apple platform - see http://www.qt.io/developers" + # endif +-#elif defined(__ANDROID__) || defined(ANDROID) +-# define Q_OS_ANDROID +-# define Q_OS_LINUX + #elif defined(__CYGWIN__) + # define Q_OS_CYGWIN + #elif !defined(SAG_COM) && (!defined(WINAPI_FAMILY) || WINAPI_FAMILY==WINAPI_FAMILY_DESKTOP_APP) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__)) diff --git a/x11-packages/qt5-base/qthread_unix.cpp.patch b/x11-packages/qt5-base/qthread_unix.cpp.patch new file mode 100644 index 000000000..7ae123c47 --- /dev/null +++ b/x11-packages/qt5-base/qthread_unix.cpp.patch @@ -0,0 +1,47 @@ +--- ./qtbase/src/corelib/thread/qthread_unix.cpp 2017-06-28 15:24:29.000000000 +0530 ++++ ../qthread_unix.cpp 2017-07-19 20:19:40.071681378 +0530 +@@ -101,7 +101,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 + +@@ -319,7 +319,7 @@ + + void *QThreadPrivate::start(void *arg) + { +-#if !defined(Q_OS_ANDROID) ++#if !defined(__ANDROID__) + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); + #endif + pthread_cleanup_push(QThreadPrivate::finish, arg); +@@ -369,7 +369,7 @@ + #endif + + emit thr->started(QThread::QPrivateSignal()); +-#if !defined(Q_OS_ANDROID) ++#if !defined(__ANDROID__) + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); + pthread_testcancel(); + #endif +@@ -666,7 +666,7 @@ + + void QThread::terminate() + { +-#if !defined(Q_OS_ANDROID) ++#if !defined(__ANDROID__) + Q_D(QThread); + QMutexLocker locker(&d->mutex); + +@@ -708,7 +708,7 @@ + "Current thread was not started with QThread."); + + Q_UNUSED(thr) +-#if defined(Q_OS_ANDROID) ++#if defined(__ANDROID__) + Q_UNUSED(enabled); + #else + pthread_setcancelstate(enabled ? PTHREAD_CANCEL_ENABLE : PTHREAD_CANCEL_DISABLE, NULL); diff --git a/x11-packages/qt5-base/qtlocation-src-plugins-geoservices-geoservices.pro.patch b/x11-packages/qt5-base/qtlocation-src-plugins-geoservices-geoservices.pro.patch new file mode 100644 index 000000000..7a91869e3 --- /dev/null +++ b/x11-packages/qt5-base/qtlocation-src-plugins-geoservices-geoservices.pro.patch @@ -0,0 +1,14 @@ +--- ./qtlocation/src/plugins/geoservices/geoservices.pro 2017-09-25 22:25:20.000000000 +0530 ++++ ../geoservices.pro 2017-11-16 11:28:04.911486902 +0530 +@@ -8,11 +8,3 @@ + qtConfig(geoservices_itemsoverlay): SUBDIRS += itemsoverlay + qtConfig(geoservices_osm): SUBDIRS += osm + +-qtConfig(geoservices_mapboxgl) { +- !exists(../../3rdparty/mapbox-gl-native/mapbox-gl-native.pro) { +- warning("Submodule mapbox-gl-native does not exist. Run 'git submodule update --init' on qtlocation.") +- } else { +- SUBDIRS += mapboxgl ../../3rdparty/mapbox-gl-native +- mapboxgl.depends = ../../3rdparty/mapbox-gl-native +- } +-} diff --git a/x11-packages/qt5-base/qtsensors-src-plugins-sensors-linux-linux.pro.patch b/x11-packages/qt5-base/qtsensors-src-plugins-sensors-linux-linux.pro.patch new file mode 100644 index 000000000..71398c69e --- /dev/null +++ b/x11-packages/qt5-base/qtsensors-src-plugins-sensors-linux-linux.pro.patch @@ -0,0 +1,10 @@ +--- ./qtsensors/src/plugins/sensors/linux/linux.pro 2017-06-23 12:02:15.000000000 +0530 ++++ ../linux.pro 2017-10-01 11:18:29.309218546 +0530 +@@ -3,7 +3,6 @@ + + OTHER_FILES = plugin.json + +-!android:LIBS += -lrt + HEADERS += linuxsysaccelerometer.h + SOURCES += linuxsysaccelerometer.cpp \ + main.cpp diff --git a/x11-packages/qt5-base/qtserialport-src-serialport-qserialport_unix.cpp.patch b/x11-packages/qt5-base/qtserialport-src-serialport-qserialport_unix.cpp.patch new file mode 100644 index 000000000..dcd27e587 --- /dev/null +++ b/x11-packages/qt5-base/qtserialport-src-serialport-qserialport_unix.cpp.patch @@ -0,0 +1,11 @@ +--- ./qtserialport/src/serialport/qserialport_unix.cpp 2017-06-20 12:29:20.000000000 +0530 ++++ ../qserialport_unix.cpp 2017-10-01 10:21:47.899850693 +0530 +@@ -66,7 +66,7 @@ + # define __ANDROID_API__ 21 + # endif + +-# if !defined(Q_OS_ANDROID) || (!defined(Q_PROCESSOR_X86) && __ANDROID_API__ < 21) ++# if 0 + struct termios2 { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */