changeset 675:c05fa46c5b62

qt/qtbase: initial import, closes #1544
author David Demelier <markand@malikania.fr>
date Wed, 31 Jul 2019 20:10:00 +0200
parents cff7770ad21a
children ce9c2a9c76f0
files qt/qtbase/patch-libressl.patch qt/qtbase/patch-musl.patch qt/qtbase/qtbase.sh qt/qtbase/qtbase.sha1
diffstat 4 files changed, 393 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/qtbase/patch-libressl.patch	Wed Jul 31 20:10:00 2019 +0200
@@ -0,0 +1,79 @@
+--- src/network/ssl/qsslsocket_openssl_symbols_p.h.orig	2019-07-31 06:50:55.232767785 +0200
++++ src/network/ssl/qsslsocket_openssl_symbols_p.h	2019-07-31 06:51:09.872768235 +0200
+@@ -372,7 +372,7 @@
+ int q_SSL_CTX_use_RSAPrivateKey(SSL_CTX *a, RSA *b);
+ int q_SSL_CTX_use_PrivateKey_file(SSL_CTX *a, const char *b, int c);
+ X509_STORE *q_SSL_CTX_get_cert_store(const SSL_CTX *a);
+-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
++#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ SSL_CONF_CTX *q_SSL_CONF_CTX_new();
+ void q_SSL_CONF_CTX_free(SSL_CONF_CTX *a);
+ void q_SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *a, SSL_CTX *b);
+--- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig	2019-07-31 06:54:15.444773935 +0200
++++ src/network/ssl/qsslsocket_openssl_symbols.cpp	2019-07-31 07:04:38.576793077 +0200
+@@ -247,8 +247,8 @@
+ #endif
+ DEFINEFUNC2(BIO *, BIO_new_file, const char *filename, filename, const char *mode, mode, return nullptr, return)
+ DEFINEFUNC(void, ERR_clear_error, DUMMYARG, DUMMYARG, return, DUMMYARG)
+-DEFINEFUNC(BIO *, BIO_new, BIO_METHOD *a, a, return nullptr, return)
+-DEFINEFUNC(BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return nullptr, return)
++DEFINEFUNC(BIO *, BIO_new, const BIO_METHOD *a, a, return nullptr, return)
++DEFINEFUNC(const BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return nullptr, return)
+ DEFINEFUNC(int, CRYPTO_num_locks, DUMMYARG, DUMMYARG, return 0, return)
+ DEFINEFUNC(void, CRYPTO_set_locking_callback, void (*a)(int, int, const char *, int), a, return, DUMMYARG)
+ DEFINEFUNC(void, CRYPTO_set_id_callback, unsigned long (*a)(), a, return, DUMMYARG)
+@@ -439,7 +439,7 @@
+ DEFINEFUNC2(int, SSL_CTX_use_RSAPrivateKey, SSL_CTX *a, a, RSA *b, b, return -1, return)
+ DEFINEFUNC3(int, SSL_CTX_use_PrivateKey_file, SSL_CTX *a, a, const char *b, b, int c, c, return -1, return)
+ DEFINEFUNC(X509_STORE *, SSL_CTX_get_cert_store, const SSL_CTX *a, a, return nullptr, return)
+-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
++#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ DEFINEFUNC(SSL_CONF_CTX *, SSL_CONF_CTX_new, DUMMYARG, DUMMYARG, return nullptr, return);
+ DEFINEFUNC(void, SSL_CONF_CTX_free, SSL_CONF_CTX *a, a, return ,return);
+ DEFINEFUNC2(void, SSL_CONF_CTX_set_ssl_ctx, SSL_CONF_CTX *a, a, SSL_CTX *b, b, return, return);
+--- src/network/ssl/qsslcontext_openssl.cpp.orig	2019-07-31 07:09:40.280802344 +0200
++++ src/network/ssl/qsslcontext_openssl.cpp	2019-07-31 07:10:07.344803176 +0200
+@@ -265,7 +265,7 @@
+     }
+ #endif // ocsp
+ 
+-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
++#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+     if (QSslSocket::sslLibraryVersionNumber() >= 0x10002000L) {
+         QSharedPointer<SSL_CONF_CTX> cctx(q_SSL_CONF_CTX_new(), &q_SSL_CONF_CTX_free);
+         if (cctx) {
+--- src/network/ssl/qsslsocket_opensslpre11_symbols_p.h.orig	2019-07-31 07:01:06.704786569 +0200
++++ src/network/ssl/qsslsocket_opensslpre11_symbols_p.h	2019-07-31 07:01:36.000787468 +0200
+@@ -78,8 +78,8 @@
+ unsigned char * q_ASN1_STRING_data(ASN1_STRING *a);
+ BIO *q_BIO_new_file(const char *filename, const char *mode);
+ void q_ERR_clear_error();
+-Q_AUTOTEST_EXPORT BIO *q_BIO_new(BIO_METHOD *a);
+-Q_AUTOTEST_EXPORT BIO_METHOD *q_BIO_s_mem();
++Q_AUTOTEST_EXPORT BIO *q_BIO_new(const BIO_METHOD *a);
++Q_AUTOTEST_EXPORT const BIO_METHOD *q_BIO_s_mem();
+ int q_CRYPTO_num_locks();
+ void q_CRYPTO_set_locking_callback(void (*a)(int, int, const char *, int));
+ void q_CRYPTO_set_id_callback(unsigned long (*a)());
+--- src/network/configure.json.orig	2019-07-31 07:13:36.576809603 +0200
++++ src/network/configure.json	2019-07-31 07:13:49.172809990 +0200
+@@ -167,7 +167,7 @@
+             "test": {
+                 "include": "openssl/opensslv.h",
+                 "tail": [
+-                    "#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10100000L",
++                    "#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)",
+                     "#  error OpenSSL >= 1.1 is required",
+                     "#endif"
+                 ]
+--- src/network/ssl/qsslsocket_openssl.cpp.orig	2019-07-31 09:13:34.409251873 +0000
++++ src/network/ssl/qsslsocket_openssl.cpp	2019-07-31 09:13:55.353252517 +0000
+@@ -604,7 +604,7 @@
+             q_SSL_set_psk_server_callback(ssl, &q_ssl_psk_server_callback);
+     }
+ #endif
+-#if OPENSSL_VERSION_NUMBER >= 0x10101006L
++#if OPENSSL_VERSION_NUMBER >= 0x10101006L && !defined(LIBRESSL_VERSION_NUMBER)
+     // Set the client callback for TLSv1.3 PSK
+     if (mode == QSslSocket::SslClientMode
+         && QSslSocket::sslLibraryBuildVersionNumber() >= 0x10101006L) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/qtbase/patch-musl.patch	Wed Jul 31 20:10:00 2019 +0200
@@ -0,0 +1,15 @@
+--- mkspecs/linux-clang/qplatformdefs.h.orig	2019-07-30 17:34:42.611300313 +0200
++++ mkspecs/linux-clang/qplatformdefs.h	2019-07-30 17:41:01.299311946 +0200
+@@ -80,12 +80,7 @@
+ #include "../common/posix/qplatformdefs.h"
+ 
+ #undef QT_SOCKLEN_T
+-
+-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+ #define QT_SOCKLEN_T            socklen_t
+-#else
+-#define QT_SOCKLEN_T            int
+-#endif
+ 
+ #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
+ #define QT_SNPRINTF             ::snprintf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/qtbase/qtbase.sh	Wed Jul 31 20:10:00 2019 +0200
@@ -0,0 +1,298 @@
+#!/bin/sh
+#
+# Copyright (c) 2019 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+# TODO: add option for PostgreSQL and mariadb.
+# TODO: add optional dependencies for Qt modules (e.g. qt/qtwayland)
+
+PKGNAME=qtbase
+PKGVERSION=5.13.0
+PKGREVISION=1
+PKGLICENSE="GPLv3 LGPLv21"
+PKGSUMMARY="cross platform SDK for developing applications"
+PKGDOWNLOAD="http://download.qt-project.org/official_releases/qt/${PKGVERSION%.*}/$PKGVERSION/submodules/$PKGNAME-everywhere-src-$PKGVERSION.tar.xz"
+PKGDEPENDS="lib/pcre2"
+PKGOPTIONS="CUPS
+            DATABASES
+            DBUS
+            EVDEV
+            FONTCONFIG
+            FREETYPE
+            GLIB
+            GTK
+            GUI
+            HARFBUZZ
+            ICU
+            JPEG
+            KMS
+            LIBINPUT
+            MTDEV
+            OPENGL
+            PNG
+            SSL
+            SYSLOG
+            UDEV
+            X
+            ZLIB"
+
+: ${CC:=clang}
+: ${CXX:=clang++}
+: ${CUPS:=yes}
+: ${DATABASES:=sqlite}  # (list) none, sqlite
+: ${DBUS:=yes}
+: ${EVDEV:=yes}
+: ${FONTCONFIG:=yes}
+: ${FREETYPE:=yes}
+: ${GLIB:=yes}
+: ${GTK:=yes}
+: ${GUI:=yes}           # requires FREETYPE
+: ${HARFBUZZ:=yes}
+: ${ICU:=yes}
+: ${JPEG:=yes}
+: ${KMS:=yes}
+: ${LIBINPUT:=yes}
+: ${MTDEV:=yes}
+: ${OPENGL:=yes}
+: ${PNG:=yes}
+: ${SSL:=yes}
+: ${SYSLOG:=no}
+: ${UDEV:=yes}
+: ${X:=yes}
+: ${ZLIB:=yes}
+
+if [ "$CXX" = "clang++" ]; then
+	platform="linux-clang"
+else
+	platform="linux-g++"
+fi
+
+if [ "$CUPS" = "yes" ]; then
+	PKGDEPENDS="print/cups $PKGDEPENDS"
+	with_cups="-cups"
+else
+	with_cups="-no-cups"
+fi
+
+#
+# It looks like there is no option to disable all SQL drivers to create a
+# "white" list of desired drivers so disable all by default unless it is listed
+# in DATABASES option.
+#
+# First, create a list with unsupported databases in vanilla.
+#
+with_databases="-no-sql-db2
+                -no-sql-ibase
+                -no-sql-oci
+                -no-sql-odbc
+                -no-sql-sqlite2
+                -no-sql-tds"
+
+if echo $DATABASES | grep -q "sqlite"; then
+	PKGDEPENDS="databases/sqlite $PKGDEPENDS"
+	with_databases="-sql-sqlite -system-sqlite $with_databases"
+else
+	with_databases="-no-sql-sqlite $with_databases"
+fi
+
+if [ "$DBUS" = "yes" ]; then
+	PKGDEPENDS="network/dbus $PKGDEPENDS"
+	with_dbus="-dbus-linked"
+else
+	with_dbus="-no-dbus"
+fi
+
+if [ "$EVDEV" = "yes" ]; then
+	with_evdev="-evdev"
+else
+	with_evdev="-no-evdev"
+fi
+
+if [ "$FONTCONFIG" = "yes" ]; then
+	PKGDEPENDS="fonts/fontconfig $PKGDEPENDS"
+	with_fontconfig="-fontconfig"
+else
+	with_fontconfig="-no-fontconfig"
+fi
+
+if [ "$FREETYPE" = "yes" ]; then
+	PKGDEPENDS="fonts/freetype $PKGDEPENDS"
+	with_freetype="-system-freetype"
+else
+	with_freetype="-no-freetype"
+fi
+
+if [ "$GLIB" = "yes" ]; then
+	PKGDEPENDS="lib/glib $PKGDEPENDS"
+	with_glib="-glib"
+else
+	with_glib="-no-glib"
+fi
+
+if [ "$GTK" = "yes" ]; then
+	PKGDEPENDS="graphics/gtk $PKGDEPENDS"
+	with_gtk="-gtk"
+else
+	with_gtk="-no-gtk"
+fi
+
+if [ "$GUI" = "yes" ]; then
+        if [ "$FREETYPE" != "yes" ]; then
+                echo "warning: GUI requires FREETYPE" 1>&2
+        fi
+
+	with_gui="-gui"
+else
+	with_gui="-no-gui"
+fi
+
+if [ "$HARFBUZZ" = "yes" ]; then
+	PKGDEPENDS="fonts/harfbuzz $PKGDEPENDS"
+	with_harfbuzz="-system-harfbuzz"
+else
+	with_harfbuzz="-no-harfbuzz"
+fi
+
+if [ "$ICU" = "yes" ]; then
+	PKGDEPENDS="lib/icu $PKGDEPENDS"
+	with_icu="-icu"
+else
+	with_icu="-no-icu"
+fi
+
+if [ "$KMS" = "yes" ]; then
+	PKGDEPENDS="graphics/libdrm $PKGDEPENDS"
+	with_kms="-kms"
+else
+	with_kms="-no-kms"
+fi
+
+if [ "$LIBINPUT" = "yes" ]; then
+	PKGDEPENDS="lib/libinput $PKGDEPENDS"
+	with_libinput="-libinput"
+else
+	with_libinput="-no-libinput"
+fi
+
+if [ "$MTDEV" = "yes" ]; then
+	PKGDEPENDS="lib/mtdev $PKGDEPENDS"
+	with_mtdev="-mtdev"
+else
+	with_mtdev="-no-mtdev"
+fi
+
+if [ "$JPEG" = "yes" ]; then
+	PKGDEPENDS="lib/libjpeg-turbo $PKGDEPENDS"
+	with_jpeg="-system-libjpeg"
+else
+	with_jpeb="-no-libjpeg"
+fi
+
+if [ "$OPENGL" = "yes" ]; then
+	with_opengl="-opengl"
+else
+	with_opengl="-no-opengl"
+fi
+
+if [ "$PNG" = "yes" ]; then
+	PKGDEPENDS="lib/libpng $PKGDEPENDS"
+	with_png="-system-libpng"
+else
+	with_png="-no-libpng"
+fi
+
+if [ "$SSL" = "yes" ]; then
+	PKGDEPENDS="crypto/libressl $PKGDEPENDS"
+	with_ssl="-ssl -openssl-linked"
+else
+	with_ssl="-no-openssl"
+fi
+
+if [ "$SYSLOG" = "yes" ]; then
+	with_syslog="-syslog"
+else
+	with_syslog="-no-syslog"
+fi
+
+if [ "$UDEV" = "yes" ]; then
+	PKGDEPENDS="core/eudev $PKGDEPENDS"
+	with_udev="-libudev"
+else
+	with_udev="-no-libudev"
+fi
+
+if [ "$X" = "yes" ]; then
+	with_x="-xcb -xcb-xlib -xcb-xinput"
+else
+	with_x="-no-xcb -no-xcb-xlib -no-xcb-xinput"
+fi
+
+if [ "$ZLIB" = "yes" ]; then
+	PKGDEPENDS="compression/zlib $PKGDEPENDS"
+	with_zlib="-system-zlib"
+else
+	with_zlib="-no-zlib"
+fi
+
+build()
+{
+	rm -rf $PKGNAME-everywhere-src-$PKGVERSION
+	tar xvf $PKGNAME-everywhere-src-$PKGVERSION.tar.xz
+	cd $PKGNAME-everywhere-src-$PKGVERSION
+
+	# https://github.com/void-linux/void-packages/tree/master/srcpkgs/qt5/patches
+	patch -p0 < ../patch-libressl.patch
+	patch -p0 < ../patch-musl.patch
+	PKG_CONFIG_PATH=/lib/pkgconfig \
+	./configure \
+		-opensource \
+		-prefix / \
+		-archdatadir /lib/qt \
+		-datadir /share/qt \
+		-docdir /share/doc/qt \
+		-libexecdir /libexec \
+		-confirm-license \
+		-release \
+		-platform $platform \
+		-nomake examples \
+		-nomake tests \
+		-system-pcre \
+		$with_cups \
+		$with_databases \
+		$with_dbus \
+		$with_evdev \
+		$with_fontconfig \
+		$with_freetype \
+		$with_glib \
+		$with_gtk \
+		$with_gui \
+		$with_harfbuzz \
+		$with_icu \
+		$with_kms \
+		$with_libinput \
+		$with_opengl \
+		$with_png \
+		$with_ssl \
+		$with_syslog \
+		$with_udev \
+		$with_x \
+		$with_zlib
+	make
+	make install INSTALL_ROOT=$DESTDIR
+	rm -f $DESTDIR/lib/libQt*.la
+
+	cd ..
+	rm -rf $PKGNAME-everywhere-src-$PKGVERSION
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/qtbase/qtbase.sha1	Wed Jul 31 20:10:00 2019 +0200
@@ -0,0 +1,1 @@
+68506e1d6a710f657fe9ddf4e8fec55ad845e81b  qtbase-everywhere-src-5.13.0.tar.xz