Merge branch 'master' into f25
This commit is contained in:
commit
bb48598d85
|
@ -5,3 +5,4 @@
|
|||
/qtbase-opensource-src-5.6.0.tar.xz
|
||||
/qtbase-opensource-src-5.6.1.tar.xz
|
||||
/qtbase-opensource-src-5.7.0.tar.xz
|
||||
/qtbase-opensource-src-5.7.1.tar.xz
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
diff -up qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.cpp.than qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.cpp
|
||||
--- qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.cpp.than 2016-11-28 11:53:02.621749003 -0500
|
||||
+++ qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.cpp 2016-11-28 11:53:17.072001489 -0500
|
||||
@@ -37,7 +37,7 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
-#include <ibase.h>
|
||||
+#include <firebird/ibase.h>
|
||||
|
||||
int main(int, char **)
|
||||
{
|
||||
diff -up qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.pro.than qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.pro
|
||||
--- qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.pro.than 2016-11-29 08:00:35.270039482 -0500
|
||||
+++ qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.pro 2016-11-29 08:00:41.280142713 -0500
|
||||
@@ -1,3 +1,3 @@
|
||||
SOURCES = ibase.cpp
|
||||
CONFIG -= qt dylib
|
||||
-LIBS += -lgds
|
||||
+LIBS += -lfbclient
|
||||
diff -up qtbase-opensource-src-5.7.1/src/plugins/sqldrivers/ibase/ibase.pro.than qtbase-opensource-src-5.7.1/src/plugins/sqldrivers/ibase/ibase.pro
|
||||
diff -up qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase.pri.than qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase.pri
|
||||
--- qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase.pri.than 2016-11-29 08:04:26.344004252 -0500
|
||||
+++ qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase.pri 2016-11-29 08:04:56.684523066 -0500
|
||||
@@ -2,7 +2,7 @@ HEADERS += $$PWD/qsql_ibase_p.h
|
||||
SOURCES += $$PWD/qsql_ibase.cpp
|
||||
|
||||
unix {
|
||||
- !contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS += -lgds
|
||||
+ !contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS += -lfbclient
|
||||
} else {
|
||||
!contains(LIBS, .*gds.*):!contains(LIBS, .*fbclient.*) {
|
||||
LIBS += -lgds32_ms
|
||||
diff -up qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase_p.h.than qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase_p.h
|
||||
--- qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase_p.h.than 2016-11-29 08:27:25.917767879 -0500
|
||||
+++ qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase_p.h 2016-11-29 08:27:53.338244987 -0500
|
||||
@@ -52,7 +52,7 @@
|
||||
//
|
||||
|
||||
#include <QtSql/qsqldriver.h>
|
||||
-#include <ibase.h>
|
||||
+#include <firebird/ibase.h>
|
||||
|
||||
#ifdef QT_PLUGIN
|
||||
#define Q_EXPORT_SQLDRIVER_IBASE
|
|
@ -0,0 +1,33 @@
|
|||
--- qtbase-opensource-src-5.7.1/src/src.pro.orig 2016-10-05 19:33:26.000000000 +0200
|
||||
+++ qtbase-opensource-src-5.7.1/src/src.pro 2016-11-09 12:31:35.781935319 +0100
|
||||
@@ -135,8 +135,10 @@
|
||||
contains(QT_CONFIG, zlib)|cross_compile {
|
||||
SUBDIRS += src_qtzlib
|
||||
contains(QT_CONFIG, zlib) {
|
||||
- src_3rdparty_libpng.depends += src_corelib
|
||||
- src_3rdparty_freetype.depends += src_corelib
|
||||
+ !contains(QT_CONFIG, system-png) {
|
||||
+ src_3rdparty_libpng.depends += src_corelib
|
||||
+ src_3rdparty_freetype.depends += src_corelib
|
||||
+ }
|
||||
}
|
||||
}
|
||||
SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc
|
||||
@@ -167,10 +169,13 @@
|
||||
SUBDIRS += src_angle
|
||||
src_gui.depends += src_angle
|
||||
}
|
||||
- contains(QT_CONFIG, png) {
|
||||
- SUBDIRS += src_3rdparty_libpng
|
||||
- src_3rdparty_freetype.depends += src_3rdparty_libpng
|
||||
- src_gui.depends += src_3rdparty_libpng
|
||||
+
|
||||
+ !contains(QT_CONFIG, system-png) {
|
||||
+ contains(QT_CONFIG, png) {
|
||||
+ SUBDIRS += src_3rdparty_libpng
|
||||
+ src_3rdparty_freetype.depends += src_3rdparty_libpng
|
||||
+ src_gui.depends += src_3rdparty_libpng
|
||||
+ }
|
||||
}
|
||||
contains(QT_CONFIG, freetype) {
|
||||
SUBDIRS += src_3rdparty_freetype
|
|
@ -0,0 +1,809 @@
|
|||
diff -up qtbase-opensource-src-5.7.1/src/network/ssl/qsslcertificate_openssl.cpp.openssl11 qtbase-opensource-src-5.7.1/src/network/ssl/qsslcertificate_openssl.cpp
|
||||
--- qtbase-opensource-src-5.7.1/src/network/ssl/qsslcertificate_openssl.cpp.openssl11 2016-11-17 14:34:21.000000000 -0500
|
||||
+++ qtbase-opensource-src-5.7.1/src/network/ssl/qsslcertificate_openssl.cpp 2016-11-28 09:22:07.374079451 -0500
|
||||
@@ -64,9 +64,12 @@ bool QSslCertificate::operator==(const Q
|
||||
uint qHash(const QSslCertificate &key, uint seed) Q_DECL_NOTHROW
|
||||
{
|
||||
if (X509 * const x509 = key.d->x509) {
|
||||
- (void)q_X509_cmp(x509, x509); // populate x509->sha1_hash
|
||||
- // (if someone knows a better way...)
|
||||
- return qHashBits(x509->sha1_hash, SHA_DIGEST_LENGTH, seed);
|
||||
+ unsigned int len;
|
||||
+ unsigned char md[EVP_MAX_MD_SIZE];
|
||||
+ const EVP_MD *sha1 = q_EVP_sha1();
|
||||
+
|
||||
+ q_X509_digest(x509, sha1, md, &len);
|
||||
+ return qHashBits(md, len, seed);
|
||||
} else {
|
||||
return seed;
|
||||
}
|
||||
@@ -90,7 +93,7 @@ QByteArray QSslCertificate::version() co
|
||||
QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));
|
||||
if (d->versionString.isEmpty() && d->x509)
|
||||
d->versionString =
|
||||
- QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)) + 1);
|
||||
+ QByteArray::number(qlonglong(X509_get_version(d->x509)) + 1);
|
||||
|
||||
return d->versionString;
|
||||
}
|
||||
@@ -99,7 +102,7 @@ QByteArray QSslCertificate::serialNumber
|
||||
{
|
||||
QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));
|
||||
if (d->serialNumberString.isEmpty() && d->x509) {
|
||||
- ASN1_INTEGER *serialNumber = d->x509->cert_info->serialNumber;
|
||||
+ ASN1_INTEGER *serialNumber = X509_get_serialNumber(d->x509);
|
||||
QByteArray hexString;
|
||||
hexString.reserve(serialNumber->length * 3);
|
||||
for (int a = 0; a < serialNumber->length; ++a) {
|
||||
@@ -206,7 +209,7 @@ QMultiMap<QSsl::AlternativeNameEntryType
|
||||
else if (genName->type == GEN_EMAIL)
|
||||
result.insert(QSsl::EmailEntry, altName);
|
||||
}
|
||||
- q_sk_pop_free((STACK*)altNames, reinterpret_cast<void(*)(void*)>(q_sk_free));
|
||||
+ q_OPENSSL_sk_pop_free((OPENSSL_STACK*)altNames, reinterpret_cast<void(*)(void*)>(q_OPENSSL_sk_free));
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -235,25 +238,22 @@ QSslKey QSslCertificate::publicKey() con
|
||||
QSslKey key;
|
||||
|
||||
key.d->type = QSsl::PublicKey;
|
||||
- X509_PUBKEY *xkey = d->x509->cert_info->key;
|
||||
+ X509_PUBKEY *xkey = X509_get_X509_PUBKEY(d->x509);
|
||||
EVP_PKEY *pkey = q_X509_PUBKEY_get(xkey);
|
||||
Q_ASSERT(pkey);
|
||||
|
||||
- if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_RSA) {
|
||||
- key.d->rsa = q_EVP_PKEY_get1_RSA(pkey);
|
||||
+ if ((key.d->rsa = q_EVP_PKEY_get1_RSA(pkey))) {
|
||||
key.d->algorithm = QSsl::Rsa;
|
||||
key.d->isNull = false;
|
||||
- } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DSA) {
|
||||
- key.d->dsa = q_EVP_PKEY_get1_DSA(pkey);
|
||||
+ } else if ((key.d->dsa = q_EVP_PKEY_get1_DSA(pkey))) {
|
||||
key.d->algorithm = QSsl::Dsa;
|
||||
key.d->isNull = false;
|
||||
#ifndef OPENSSL_NO_EC
|
||||
- } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_EC) {
|
||||
- key.d->ec = q_EVP_PKEY_get1_EC_KEY(pkey);
|
||||
+ } else if ((key.d->ec = q_EVP_PKEY_get1_EC_KEY(pkey))) {
|
||||
key.d->algorithm = QSsl::Ec;
|
||||
key.d->isNull = false;
|
||||
#endif
|
||||
- } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DH) {
|
||||
+ } else if (EVP_PKEY_get1_DH(pkey)) {
|
||||
// DH unsupported
|
||||
} else {
|
||||
// error?
|
||||
@@ -380,11 +380,7 @@ static QVariant x509ExtensionToValue(X50
|
||||
}
|
||||
}
|
||||
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
||||
- q_sk_pop_free((_STACK*)info, reinterpret_cast<void(*)(void*)>(q_sk_free));
|
||||
-#else
|
||||
- q_sk_pop_free((STACK*)info, reinterpret_cast<void(*)(void*)>(q_sk_free));
|
||||
-#endif
|
||||
+ q_OPENSSL_sk_pop_free((OPENSSL_STACK*)info, reinterpret_cast<void(*)(void*)>(q_OPENSSL_sk_free));
|
||||
return result;
|
||||
}
|
||||
break;
|
||||
@@ -607,7 +603,7 @@ static QMap<QByteArray, QString> _q_mapF
|
||||
unsigned char *data = 0;
|
||||
int size = q_ASN1_STRING_to_UTF8(&data, q_X509_NAME_ENTRY_get_data(e));
|
||||
info.insertMulti(name, QString::fromUtf8((char*)data, size));
|
||||
- q_CRYPTO_free(data);
|
||||
+ q_OPENSSL_free(data);
|
||||
}
|
||||
|
||||
return info;
|
||||
diff -up qtbase-opensource-src-5.7.1/src/network/ssl/qsslcontext_openssl.cpp.openssl11 qtbase-opensource-src-5.7.1/src/network/ssl/qsslcontext_openssl.cpp
|
||||
--- qtbase-opensource-src-5.7.1/src/network/ssl/qsslcontext_openssl.cpp.openssl11 2016-11-17 14:34:21.000000000 -0500
|
||||
+++ qtbase-opensource-src-5.7.1/src/network/ssl/qsslcontext_openssl.cpp 2016-11-28 09:22:07.374079451 -0500
|
||||
@@ -110,7 +110,7 @@ void QSslContext::initSslContext(QSslCon
|
||||
init_context:
|
||||
switch (sslContext->sslConfiguration.protocol()) {
|
||||
case QSsl::SslV2:
|
||||
-#ifndef OPENSSL_NO_SSL2
|
||||
+#if !defined(OPENSSL_NO_SSL2) && OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv2_client_method() : q_SSLv2_server_method());
|
||||
#else
|
||||
// SSL 2 not supported by the system, but chosen deliberately -> error
|
||||
@@ -331,7 +331,7 @@ init_context:
|
||||
q_DH_free(dh);
|
||||
|
||||
#ifndef OPENSSL_NO_EC
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
|
||||
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
if (q_SSLeay() >= 0x10002000L) {
|
||||
q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_SET_ECDH_AUTO, 1, NULL);
|
||||
} else
|
||||
@@ -487,7 +487,7 @@ bool QSslContext::cacheSession(SSL* ssl)
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(m_sessionASN1.data());
|
||||
if (!q_i2d_SSL_SESSION(session, &data))
|
||||
qCWarning(lcSsl, "could not store persistent version of SSL session");
|
||||
- m_sessionTicketLifeTimeHint = session->tlsext_tick_lifetime_hint;
|
||||
+ m_sessionTicketLifeTimeHint = SSL_SESSION_get_ticket_lifetime_hint(session);
|
||||
}
|
||||
}
|
||||
|
||||
diff -up qtbase-opensource-src-5.7.1/src/network/ssl/qsslkey_openssl.cpp.openssl11 qtbase-opensource-src-5.7.1/src/network/ssl/qsslkey_openssl.cpp
|
||||
--- qtbase-opensource-src-5.7.1/src/network/ssl/qsslkey_openssl.cpp.openssl11 2016-11-17 14:34:21.000000000 -0500
|
||||
+++ qtbase-opensource-src-5.7.1/src/network/ssl/qsslkey_openssl.cpp 2016-11-28 09:22:07.374079451 -0500
|
||||
@@ -84,28 +84,26 @@ void QSslKeyPrivate::clear(bool deep)
|
||||
|
||||
bool QSslKeyPrivate::fromEVP_PKEY(EVP_PKEY *pkey)
|
||||
{
|
||||
- if (pkey->type == EVP_PKEY_RSA) {
|
||||
+ if (EVP_PKEY_base_id(pkey) == EVP_PKEY_RSA) {
|
||||
isNull = false;
|
||||
algorithm = QSsl::Rsa;
|
||||
type = QSsl::PrivateKey;
|
||||
|
||||
- rsa = q_RSA_new();
|
||||
- memcpy(rsa, q_EVP_PKEY_get1_RSA(pkey), sizeof(RSA));
|
||||
+ rsa = q_EVP_PKEY_get1_RSA(pkey);
|
||||
|
||||
return true;
|
||||
}
|
||||
- else if (pkey->type == EVP_PKEY_DSA) {
|
||||
+ else if (EVP_PKEY_base_id(pkey) == EVP_PKEY_DSA) {
|
||||
isNull = false;
|
||||
algorithm = QSsl::Dsa;
|
||||
type = QSsl::PrivateKey;
|
||||
|
||||
- dsa = q_DSA_new();
|
||||
- memcpy(dsa, q_EVP_PKEY_get1_DSA(pkey), sizeof(DSA));
|
||||
+ dsa = q_EVP_PKEY_get1_DSA(pkey);
|
||||
|
||||
return true;
|
||||
}
|
||||
#ifndef OPENSSL_NO_EC
|
||||
- else if (pkey->type == EVP_PKEY_EC) {
|
||||
+ else if (EVP_PKEY_base_id(pkey) == EVP_PKEY_EC) {
|
||||
isNull = false;
|
||||
algorithm = QSsl::Ec;
|
||||
type = QSsl::PrivateKey;
|
||||
@@ -178,8 +176,8 @@ int QSslKeyPrivate::length() const
|
||||
return -1;
|
||||
|
||||
switch (algorithm) {
|
||||
- case QSsl::Rsa: return q_BN_num_bits(rsa->n);
|
||||
- case QSsl::Dsa: return q_BN_num_bits(dsa->p);
|
||||
+ case QSsl::Rsa: return q_RSA_bits(rsa);
|
||||
+ case QSsl::Dsa: return q_DSA_bits(dsa);
|
||||
#ifndef OPENSSL_NO_EC
|
||||
case QSsl::Ec: return q_EC_GROUP_get_degree(q_EC_KEY_get0_group(ec));
|
||||
#endif
|
||||
@@ -273,7 +271,7 @@ Qt::HANDLE QSslKeyPrivate::handle() cons
|
||||
|
||||
static QByteArray doCrypt(QSslKeyPrivate::Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv, int enc)
|
||||
{
|
||||
- EVP_CIPHER_CTX ctx;
|
||||
+ EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
|
||||
const EVP_CIPHER* type = 0;
|
||||
int i = 0, len = 0;
|
||||
|
||||
@@ -291,21 +289,22 @@ static QByteArray doCrypt(QSslKeyPrivate
|
||||
|
||||
QByteArray output;
|
||||
output.resize(data.size() + EVP_MAX_BLOCK_LENGTH);
|
||||
- q_EVP_CIPHER_CTX_init(&ctx);
|
||||
- q_EVP_CipherInit(&ctx, type, NULL, NULL, enc);
|
||||
- q_EVP_CIPHER_CTX_set_key_length(&ctx, key.size());
|
||||
+ q_EVP_CIPHER_CTX_init(ctx);
|
||||
+ q_EVP_CipherInit(ctx, type, NULL, NULL, enc);
|
||||
+ q_EVP_CIPHER_CTX_set_key_length(ctx, key.size());
|
||||
if (cipher == QSslKeyPrivate::Rc2Cbc)
|
||||
- q_EVP_CIPHER_CTX_ctrl(&ctx, EVP_CTRL_SET_RC2_KEY_BITS, 8 * key.size(), NULL);
|
||||
- q_EVP_CipherInit(&ctx, NULL,
|
||||
+ q_EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC2_KEY_BITS, 8 * key.size(), NULL);
|
||||
+ q_EVP_CipherInit(ctx, NULL,
|
||||
reinterpret_cast<const unsigned char *>(key.constData()),
|
||||
reinterpret_cast<const unsigned char *>(iv.constData()), enc);
|
||||
- q_EVP_CipherUpdate(&ctx,
|
||||
+ q_EVP_CipherUpdate(ctx,
|
||||
reinterpret_cast<unsigned char *>(output.data()), &len,
|
||||
reinterpret_cast<const unsigned char *>(data.constData()), data.size());
|
||||
- q_EVP_CipherFinal(&ctx,
|
||||
+ q_EVP_CipherFinal(ctx,
|
||||
reinterpret_cast<unsigned char *>(output.data()) + len, &i);
|
||||
len += i;
|
||||
- q_EVP_CIPHER_CTX_cleanup(&ctx);
|
||||
+ q_EVP_CIPHER_CTX_cleanup(ctx);
|
||||
+ EVP_CIPHER_CTX_free(ctx);
|
||||
|
||||
return output.left(len);
|
||||
}
|
||||
diff -up qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl.cpp.openssl11 qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl.cpp
|
||||
--- qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl.cpp.openssl11 2016-11-17 14:34:21.000000000 -0500
|
||||
+++ qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl.cpp 2016-11-28 09:22:07.374079451 -0500
|
||||
@@ -98,70 +98,6 @@ bool QSslSocketPrivate::s_loadRootCertsO
|
||||
int QSslSocketBackendPrivate::s_indexForSSLExtraData = -1;
|
||||
#endif
|
||||
|
||||
-/* \internal
|
||||
-
|
||||
- From OpenSSL's thread(3) manual page:
|
||||
-
|
||||
- OpenSSL can safely be used in multi-threaded applications provided that at
|
||||
- least two callback functions are set.
|
||||
-
|
||||
- locking_function(int mode, int n, const char *file, int line) is needed to
|
||||
- perform locking on shared data structures. (Note that OpenSSL uses a
|
||||
- number of global data structures that will be implicitly shared
|
||||
- whenever multiple threads use OpenSSL.) Multi-threaded
|
||||
- applications will crash at random if it is not set. ...
|
||||
- ...
|
||||
- id_function(void) is a function that returns a thread ID. It is not
|
||||
- needed on Windows nor on platforms where getpid() returns a different
|
||||
- ID for each thread (most notably Linux)
|
||||
-*/
|
||||
-class QOpenSslLocks
|
||||
-{
|
||||
-public:
|
||||
- inline QOpenSslLocks()
|
||||
- : initLocker(QMutex::Recursive),
|
||||
- locksLocker(QMutex::Recursive)
|
||||
- {
|
||||
- QMutexLocker locker(&locksLocker);
|
||||
- int numLocks = q_CRYPTO_num_locks();
|
||||
- locks = new QMutex *[numLocks];
|
||||
- memset(locks, 0, numLocks * sizeof(QMutex *));
|
||||
- }
|
||||
- inline ~QOpenSslLocks()
|
||||
- {
|
||||
- QMutexLocker locker(&locksLocker);
|
||||
- for (int i = 0; i < q_CRYPTO_num_locks(); ++i)
|
||||
- delete locks[i];
|
||||
- delete [] locks;
|
||||
-
|
||||
- QSslSocketPrivate::deinitialize();
|
||||
- }
|
||||
- inline QMutex *lock(int num)
|
||||
- {
|
||||
- QMutexLocker locker(&locksLocker);
|
||||
- QMutex *tmp = locks[num];
|
||||
- if (!tmp)
|
||||
- tmp = locks[num] = new QMutex(QMutex::Recursive);
|
||||
- return tmp;
|
||||
- }
|
||||
-
|
||||
- QMutex *globalLock()
|
||||
- {
|
||||
- return &locksLocker;
|
||||
- }
|
||||
-
|
||||
- QMutex *initLock()
|
||||
- {
|
||||
- return &initLocker;
|
||||
- }
|
||||
-
|
||||
-private:
|
||||
- QMutex initLocker;
|
||||
- QMutex locksLocker;
|
||||
- QMutex **locks;
|
||||
-};
|
||||
-Q_GLOBAL_STATIC(QOpenSslLocks, openssl_locks)
|
||||
-
|
||||
QString QSslSocketBackendPrivate::getErrorsFromOpenSsl()
|
||||
{
|
||||
QString errorString;
|
||||
@@ -175,23 +111,8 @@ QString QSslSocketBackendPrivate::getErr
|
||||
return errorString;
|
||||
}
|
||||
|
||||
-extern "C" {
|
||||
-static void locking_function(int mode, int lockNumber, const char *, int)
|
||||
-{
|
||||
- QMutex *mutex = openssl_locks()->lock(lockNumber);
|
||||
-
|
||||
- // Lock or unlock it
|
||||
- if (mode & CRYPTO_LOCK)
|
||||
- mutex->lock();
|
||||
- else
|
||||
- mutex->unlock();
|
||||
-}
|
||||
-static unsigned long id_function()
|
||||
-{
|
||||
- return (quintptr)QThread::currentThreadId();
|
||||
-}
|
||||
-
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
|
||||
+extern "C" {
|
||||
static unsigned int q_ssl_psk_client_callback(SSL *ssl,
|
||||
const char *hint,
|
||||
char *identity, unsigned int max_identity_len,
|
||||
@@ -457,8 +378,6 @@ void QSslSocketBackendPrivate::destroySs
|
||||
*/
|
||||
void QSslSocketPrivate::deinitialize()
|
||||
{
|
||||
- q_CRYPTO_set_id_callback(0);
|
||||
- q_CRYPTO_set_locking_callback(0);
|
||||
q_ERR_free_strings();
|
||||
}
|
||||
|
||||
@@ -479,15 +398,10 @@ bool QSslSocketPrivate::ensureLibraryLoa
|
||||
if (!q_resolveOpenSslSymbols())
|
||||
return false;
|
||||
|
||||
- // Check if the library itself needs to be initialized.
|
||||
- QMutexLocker locker(openssl_locks()->initLock());
|
||||
-
|
||||
if (!s_libraryLoaded) {
|
||||
s_libraryLoaded = true;
|
||||
|
||||
// Initialize OpenSSL.
|
||||
- q_CRYPTO_set_id_callback(id_function);
|
||||
- q_CRYPTO_set_locking_callback(locking_function);
|
||||
if (q_SSL_library_init() != 1)
|
||||
return false;
|
||||
q_SSL_load_error_strings();
|
||||
@@ -509,7 +423,6 @@ bool QSslSocketPrivate::ensureLibraryLoa
|
||||
|
||||
void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
|
||||
{
|
||||
- QMutexLocker locker(openssl_locks()->initLock());
|
||||
if (s_loadedCiphersAndCerts)
|
||||
return;
|
||||
s_loadedCiphersAndCerts = true;
|
||||
@@ -594,7 +507,7 @@ QString QSslSocketPrivate::sslLibraryVer
|
||||
if (!supportsSsl())
|
||||
return QString();
|
||||
|
||||
- const char *versionString = q_SSLeay_version(SSLEAY_VERSION);
|
||||
+ const char *versionString = q_OpenSSL_version(OPENSSL_VERSION);
|
||||
if (!versionString)
|
||||
return QString();
|
||||
|
||||
@@ -1519,7 +1432,7 @@ void QSslSocketBackendPrivate::continueH
|
||||
if (readBufferMaxSize)
|
||||
plainSocket->setReadBufferSize(readBufferMaxSize);
|
||||
|
||||
- if (q_SSL_ctrl((ssl), SSL_CTRL_GET_SESSION_REUSED, 0, NULL))
|
||||
+ if (SSL_session_reused(ssl))
|
||||
configuration.peerSessionShared = true;
|
||||
|
||||
#ifdef QT_DECRYPT_SSL_TRAFFIC
|
||||
@@ -1661,7 +1574,7 @@ QList<QSslError> QSslSocketBackendPrivat
|
||||
// Build the chain of intermediate certificates
|
||||
STACK_OF(X509) *intermediates = 0;
|
||||
if (certificateChain.length() > 1) {
|
||||
- intermediates = (STACK_OF(X509) *) q_sk_new_null();
|
||||
+ intermediates = (STACK_OF(X509) *) q_OPENSSL_sk_new_null();
|
||||
|
||||
if (!intermediates) {
|
||||
q_X509_STORE_free(certStore);
|
||||
@@ -1675,11 +1588,7 @@ QList<QSslError> QSslSocketBackendPrivat
|
||||
first = false;
|
||||
continue;
|
||||
}
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
||||
- q_sk_push( (_STACK *)intermediates, reinterpret_cast<X509 *>(cert.handle()));
|
||||
-#else
|
||||
- q_sk_push( (STACK *)intermediates, reinterpret_cast<char *>(cert.handle()));
|
||||
-#endif
|
||||
+ q_OPENSSL_sk_push( (OPENSSL_STACK *)intermediates, reinterpret_cast<X509 *>(cert.handle()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1703,11 +1612,7 @@ QList<QSslError> QSslSocketBackendPrivat
|
||||
(void) q_X509_verify_cert(storeContext);
|
||||
|
||||
q_X509_STORE_CTX_free(storeContext);
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
||||
- q_sk_free( (_STACK *) intermediates);
|
||||
-#else
|
||||
- q_sk_free( (STACK *) intermediates);
|
||||
-#endif
|
||||
+ q_OPENSSL_sk_free( (OPENSSL_STACK *) intermediates);
|
||||
|
||||
// Now process the errors
|
||||
const auto errorList = std::move(_q_sslErrorList()->errors);
|
||||
@@ -1781,7 +1686,7 @@ bool QSslSocketBackendPrivate::importPkc
|
||||
// Convert to Qt types
|
||||
if (!key->d->fromEVP_PKEY(pkey)) {
|
||||
qCWarning(lcSsl, "Unable to convert private key");
|
||||
- q_sk_pop_free(reinterpret_cast<STACK *>(ca), reinterpret_cast<void(*)(void*)>(q_sk_free));
|
||||
+ q_OPENSSL_sk_pop_free(reinterpret_cast<OPENSSL_STACK *>(ca), reinterpret_cast<void(*)(void*)>(q_OPENSSL_sk_free));
|
||||
q_X509_free(x509);
|
||||
q_EVP_PKEY_free(pkey);
|
||||
q_PKCS12_free(p12);
|
||||
@@ -1796,7 +1701,7 @@ bool QSslSocketBackendPrivate::importPkc
|
||||
*caCertificates = QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates(ca);
|
||||
|
||||
// Clean up
|
||||
- q_sk_pop_free(reinterpret_cast<STACK *>(ca), reinterpret_cast<void(*)(void*)>(q_sk_free));
|
||||
+ q_OPENSSL_sk_pop_free(reinterpret_cast<OPENSSL_STACK *>(ca), reinterpret_cast<void(*)(void*)>(q_OPENSSL_sk_free));
|
||||
q_X509_free(x509);
|
||||
q_EVP_PKEY_free(pkey);
|
||||
q_PKCS12_free(p12);
|
||||
diff -up qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl_p.h.openssl11 qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl_p.h
|
||||
--- qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl_p.h.openssl11 2016-11-17 14:34:21.000000000 -0500
|
||||
+++ qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl_p.h 2016-11-28 09:22:07.374079451 -0500
|
||||
@@ -97,10 +97,6 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/tls1.h>
|
||||
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
||||
-typedef _STACK STACK;
|
||||
-#endif
|
||||
-
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
struct QSslErrorEntry {
|
||||
@@ -126,9 +122,7 @@ public:
|
||||
BIO *writeBio;
|
||||
SSL_SESSION *session;
|
||||
QVector<QSslErrorEntry> errorList;
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x10001000L
|
||||
static int s_indexForSSLExtraData; // index used in SSL_get_ex_data to get the matching QSslSocketBackendPrivate
|
||||
-#endif
|
||||
|
||||
// Platform specific functions
|
||||
void startClientEncryption() Q_DECL_OVERRIDE;
|
||||
diff -up qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl_symbols.cpp.openssl11 qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl_symbols.cpp
|
||||
--- qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl_symbols.cpp.openssl11 2016-11-17 14:34:21.000000000 -0500
|
||||
+++ qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl_symbols.cpp 2016-11-28 10:05:04.077593416 -0500
|
||||
@@ -145,22 +145,19 @@ DEFINEFUNC(int, ASN1_STRING_length, ASN1
|
||||
DEFINEFUNC2(int, ASN1_STRING_to_UTF8, unsigned char **a, a, ASN1_STRING *b, b, return 0, return);
|
||||
DEFINEFUNC4(long, BIO_ctrl, BIO *a, a, int b, b, long c, c, void *d, d, return -1, return)
|
||||
DEFINEFUNC(int, BIO_free, BIO *a, a, return 0, return)
|
||||
-DEFINEFUNC(BIO *, BIO_new, BIO_METHOD *a, a, return 0, return)
|
||||
DEFINEFUNC2(BIO *, BIO_new_mem_buf, void *a, a, int b, b, return 0, return)
|
||||
DEFINEFUNC3(int, BIO_read, BIO *a, a, void *b, b, int c, c, return -1, return)
|
||||
-DEFINEFUNC(BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, return)
|
||||
+DEFINEFUNC(BIO *, BIO_new, const BIO_METHOD *a, a, return 0, return)
|
||||
+DEFINEFUNC(const BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, return)
|
||||
DEFINEFUNC3(int, BIO_write, BIO *a, a, const void *b, b, int c, c, return -1, return)
|
||||
DEFINEFUNC(int, BN_num_bits, const BIGNUM *a, a, return 0, return)
|
||||
#ifndef OPENSSL_NO_EC
|
||||
DEFINEFUNC(const EC_GROUP*, EC_KEY_get0_group, const EC_KEY* k, k, return 0, return)
|
||||
DEFINEFUNC(int, EC_GROUP_get_degree, const EC_GROUP* g, g, return 0, return)
|
||||
#endif
|
||||
-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)
|
||||
-DEFINEFUNC(void, CRYPTO_free, void *a, a, return, DUMMYARG)
|
||||
DEFINEFUNC(DSA *, DSA_new, DUMMYARG, DUMMYARG, return 0, return)
|
||||
DEFINEFUNC(void, DSA_free, DSA *a, a, return, DUMMYARG)
|
||||
+DEFINEFUNC(int, DSA_bits, const DSA *a, a, return 0, return)
|
||||
DEFINEFUNC3(X509 *, d2i_X509, X509 **a, a, const unsigned char **b, b, long c, c, return 0, return)
|
||||
DEFINEFUNC2(char *, ERR_error_string, unsigned long a, a, char *b, b, return 0, return)
|
||||
DEFINEFUNC(unsigned long, ERR_get_error, DUMMYARG, DUMMYARG, return 0, return)
|
||||
@@ -176,6 +173,7 @@ DEFINEFUNC(const EVP_CIPHER *, EVP_des_c
|
||||
DEFINEFUNC(const EVP_CIPHER *, EVP_des_ede3_cbc, DUMMYARG, DUMMYARG, return 0, return)
|
||||
DEFINEFUNC(const EVP_CIPHER *, EVP_rc2_cbc, DUMMYARG, DUMMYARG, return 0, return)
|
||||
DEFINEFUNC3(int, EVP_PKEY_assign, EVP_PKEY *a, a, int b, b, char *c, c, return -1, return)
|
||||
+DEFINEFUNC(const EVP_MD *, EVP_sha1, DUMMYARG, DUMMYARG, return 0, return)
|
||||
DEFINEFUNC2(int, EVP_PKEY_set1_RSA, EVP_PKEY *a, a, RSA *b, b, return -1, return)
|
||||
DEFINEFUNC2(int, EVP_PKEY_set1_DSA, EVP_PKEY *a, a, DSA *b, b, return -1, return)
|
||||
#ifndef OPENSSL_NO_EC
|
||||
@@ -227,19 +225,13 @@ DEFINEFUNC2(void, RAND_seed, const void
|
||||
DEFINEFUNC(int, RAND_status, void, DUMMYARG, return -1, return)
|
||||
DEFINEFUNC(RSA *, RSA_new, DUMMYARG, DUMMYARG, return 0, return)
|
||||
DEFINEFUNC(void, RSA_free, RSA *a, a, return, DUMMYARG)
|
||||
-DEFINEFUNC(int, sk_num, STACK *a, a, return -1, return)
|
||||
-DEFINEFUNC2(void, sk_pop_free, STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
||||
-DEFINEFUNC(_STACK *, sk_new_null, DUMMYARG, DUMMYARG, return 0, return)
|
||||
-DEFINEFUNC2(void, sk_push, _STACK *a, a, void *b, b, return, DUMMYARG)
|
||||
-DEFINEFUNC(void, sk_free, _STACK *a, a, return, DUMMYARG)
|
||||
-DEFINEFUNC2(void *, sk_value, STACK *a, a, int b, b, return 0, return)
|
||||
-#else
|
||||
-DEFINEFUNC(STACK *, sk_new_null, DUMMYARG, DUMMYARG, return 0, return)
|
||||
-DEFINEFUNC2(void, sk_push, STACK *a, a, char *b, b, return, DUMMYARG)
|
||||
-DEFINEFUNC(void, sk_free, STACK *a, a, return, DUMMYARG)
|
||||
-DEFINEFUNC2(char *, sk_value, STACK *a, a, int b, b, return 0, return)
|
||||
-#endif
|
||||
+DEFINEFUNC(int, RSA_bits, const RSA *a, a, return 0, return)
|
||||
+DEFINEFUNC(int, OPENSSL_sk_num, OPENSSL_STACK *a, a, return -1, return)
|
||||
+DEFINEFUNC2(void, OPENSSL_sk_pop_free, OPENSSL_STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
|
||||
+DEFINEFUNC(OPENSSL_STACK *, OPENSSL_sk_new_null, DUMMYARG, DUMMYARG, return 0, return)
|
||||
+DEFINEFUNC2(void, OPENSSL_sk_push, OPENSSL_STACK *a, a, void *b, b, return, DUMMYARG)
|
||||
+DEFINEFUNC(void, OPENSSL_sk_free, OPENSSL_STACK *a, a, return, DUMMYARG)
|
||||
+DEFINEFUNC2(void *, OPENSSL_sk_value, OPENSSL_STACK *a, a, int b, b, return 0, return)
|
||||
DEFINEFUNC(int, SSL_accept, SSL *a, a, return -1, return)
|
||||
DEFINEFUNC(int, SSL_clear, SSL *a, a, return -1, return)
|
||||
DEFINEFUNC3(char *, SSL_CIPHER_description, SSL_CIPHER *a, a, char *b, b, int c, c, return 0, return)
|
||||
@@ -302,9 +294,6 @@ DEFINEFUNC2(void *, SSL_get_ex_data, con
|
||||
DEFINEFUNC2(void, SSL_set_psk_client_callback, SSL* ssl, ssl, q_psk_client_callback_t callback, callback, return, DUMMYARG)
|
||||
#endif
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
||||
-#ifndef OPENSSL_NO_SSL2
|
||||
-DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
|
||||
-#endif
|
||||
#ifndef OPENSSL_NO_SSL3_METHOD
|
||||
DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
|
||||
#endif
|
||||
@@ -314,7 +303,7 @@ DEFINEFUNC(const SSL_METHOD *, TLSv1_cli
|
||||
DEFINEFUNC(const SSL_METHOD *, TLSv1_1_client_method, DUMMYARG, DUMMYARG, return 0, return)
|
||||
DEFINEFUNC(const SSL_METHOD *, TLSv1_2_client_method, DUMMYARG, DUMMYARG, return 0, return)
|
||||
#endif
|
||||
-#ifndef OPENSSL_NO_SSL2
|
||||
+#if !defined(OPENSSL_NO_SSL2) && OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SSL3_METHOD
|
||||
@@ -327,9 +316,6 @@ DEFINEFUNC(const SSL_METHOD *, TLSv1_1_s
|
||||
DEFINEFUNC(const SSL_METHOD *, TLSv1_2_server_method, DUMMYARG, DUMMYARG, return 0, return)
|
||||
#endif
|
||||
#else
|
||||
-#ifndef OPENSSL_NO_SSL2
|
||||
-DEFINEFUNC(SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
|
||||
-#endif
|
||||
#ifndef OPENSSL_NO_SSL3_METHOD
|
||||
DEFINEFUNC(SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
|
||||
#endif
|
||||
@@ -350,8 +336,11 @@ DEFINEFUNC2(int, X509_cmp, X509 *a, a, X
|
||||
DEFINEFUNC(X509 *, X509_dup, X509 *a, a, return 0, return)
|
||||
#endif
|
||||
DEFINEFUNC2(void, X509_print, BIO *a, a, X509 *b, b, return, DUMMYARG);
|
||||
+DEFINEFUNC4(int, X509_digest, const X509 *x509, x509, const EVP_MD *type, type, unsigned char *md, md, unsigned int *len, len, return -1, return)
|
||||
DEFINEFUNC(ASN1_OBJECT *, X509_EXTENSION_get_object, X509_EXTENSION *a, a, return 0, return)
|
||||
DEFINEFUNC(void, X509_free, X509 *a, a, return, DUMMYARG)
|
||||
+DEFINEFUNC(ASN1_TIME *, X509_get_notBefore, X509 *a, a, return 0, return)
|
||||
+DEFINEFUNC(ASN1_TIME *, X509_get_notAfter, X509 *a, a, return 0, return)
|
||||
DEFINEFUNC2(X509_EXTENSION *, X509_get_ext, X509 *a, a, int b, b, return 0, return)
|
||||
DEFINEFUNC(int, X509_get_ext_count, X509 *a, a, return 0, return)
|
||||
DEFINEFUNC4(void *, X509_get_ext_d2i, X509 *a, a, int b, b, int *c, c, int *d, d, return 0, return)
|
||||
@@ -386,6 +375,7 @@ DEFINEFUNC(int, X509_STORE_CTX_get_error
|
||||
DEFINEFUNC(X509 *, X509_STORE_CTX_get_current_cert, X509_STORE_CTX *a, a, return 0, return)
|
||||
DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get_chain, X509_STORE_CTX *a, a, return 0, return)
|
||||
DEFINEFUNC(X509_STORE_CTX *, X509_STORE_CTX_new, DUMMYARG, DUMMYARG, return 0, return)
|
||||
+DEFINEFUNC3(void, CRYPTO_free, void *str, str, const char *file, file, int line, line, return, DUMMYARG)
|
||||
#ifdef SSLEAY_MACROS
|
||||
DEFINEFUNC2(int, i2d_DSAPrivateKey, const DSA *a, a, unsigned char **b, b, return -1, return)
|
||||
DEFINEFUNC2(int, i2d_RSAPrivateKey, const RSA *a, a, unsigned char **b, b, return -1, return)
|
||||
@@ -400,7 +390,10 @@ DEFINEFUNC3(EC_KEY *, d2i_ECPrivateKey,
|
||||
#endif
|
||||
DEFINEFUNC(void, OPENSSL_add_all_algorithms_noconf, void, DUMMYARG, return, DUMMYARG)
|
||||
DEFINEFUNC(void, OPENSSL_add_all_algorithms_conf, void, DUMMYARG, return, DUMMYARG)
|
||||
+DEFINEFUNC(void, OPENSSL_free, void *a, a, return, DUMMYARG)
|
||||
DEFINEFUNC3(int, SSL_CTX_load_verify_locations, SSL_CTX *ctx, ctx, const char *CAfile, CAfile, const char *CApath, CApath, return 0, return)
|
||||
+DEFINEFUNC(long, OpenSSL_version_num, void, DUMMYARG, return 0, return)
|
||||
+DEFINEFUNC(const char *, OpenSSL_version, int a, a, return 0, return)
|
||||
DEFINEFUNC(long, SSLeay, void, DUMMYARG, return 0, return)
|
||||
DEFINEFUNC(const char *, SSLeay_version, int a, a, return 0, return)
|
||||
DEFINEFUNC2(int, i2d_SSL_SESSION, SSL_SESSION *in, in, unsigned char **pp, pp, return 0, return)
|
||||
@@ -432,6 +425,9 @@ DEFINEFUNC2(size_t, EC_get_builtin_curve
|
||||
DEFINEFUNC(int, EC_curve_nist2nid, const char *name, name, return 0, return)
|
||||
#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
|
||||
#endif // OPENSSL_NO_EC
|
||||
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
+DEFINEFUNC2(long, SSL_CTX_set_options, SSL_CTX *ctx, ctx, long options, options, return 0, return)
|
||||
+#endif // OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
|
||||
DEFINEFUNC5(int, PKCS12_parse, PKCS12 *p12, p12, const char *pass, pass, EVP_PKEY **pkey, pkey, \
|
||||
X509 **cert, cert, STACK_OF(X509) **ca, ca, return 1, return);
|
||||
@@ -769,11 +765,10 @@ bool q_resolveOpenSslSymbols()
|
||||
#endif
|
||||
RESOLVEFUNC(BN_num_bits)
|
||||
RESOLVEFUNC(CRYPTO_free)
|
||||
- RESOLVEFUNC(CRYPTO_num_locks)
|
||||
- RESOLVEFUNC(CRYPTO_set_id_callback)
|
||||
- RESOLVEFUNC(CRYPTO_set_locking_callback)
|
||||
RESOLVEFUNC(DSA_new)
|
||||
RESOLVEFUNC(DSA_free)
|
||||
+ RESOLVEFUNC(OPENSSL_free)
|
||||
+ RESOLVEFUNC(DSA_bits)
|
||||
RESOLVEFUNC(ERR_error_string)
|
||||
RESOLVEFUNC(ERR_get_error)
|
||||
RESOLVEFUNC(ERR_free_strings)
|
||||
@@ -787,6 +782,7 @@ bool q_resolveOpenSslSymbols()
|
||||
RESOLVEFUNC(EVP_des_cbc)
|
||||
RESOLVEFUNC(EVP_des_ede3_cbc)
|
||||
RESOLVEFUNC(EVP_rc2_cbc)
|
||||
+ RESOLVEFUNC(EVP_sha1)
|
||||
RESOLVEFUNC(EVP_PKEY_assign)
|
||||
RESOLVEFUNC(EVP_PKEY_set1_RSA)
|
||||
RESOLVEFUNC(EVP_PKEY_set1_DSA)
|
||||
@@ -795,7 +791,9 @@ bool q_resolveOpenSslSymbols()
|
||||
#endif
|
||||
RESOLVEFUNC(EVP_PKEY_free)
|
||||
RESOLVEFUNC(EVP_PKEY_get1_DSA)
|
||||
+ /*RESOLVEFUNC(EVP_PKEY_get0_DSA)*/
|
||||
RESOLVEFUNC(EVP_PKEY_get1_RSA)
|
||||
+ //RESOLVEFUNC(EVP_PKEY_get0_RSA)
|
||||
#ifndef OPENSSL_NO_EC
|
||||
RESOLVEFUNC(EVP_PKEY_get1_EC_KEY)
|
||||
#endif
|
||||
@@ -836,12 +834,13 @@ bool q_resolveOpenSslSymbols()
|
||||
RESOLVEFUNC(RAND_status)
|
||||
RESOLVEFUNC(RSA_new)
|
||||
RESOLVEFUNC(RSA_free)
|
||||
- RESOLVEFUNC(sk_new_null)
|
||||
- RESOLVEFUNC(sk_push)
|
||||
- RESOLVEFUNC(sk_free)
|
||||
- RESOLVEFUNC(sk_num)
|
||||
- RESOLVEFUNC(sk_pop_free)
|
||||
- RESOLVEFUNC(sk_value)
|
||||
+ RESOLVEFUNC(RSA_bits)
|
||||
+ RESOLVEFUNC(OPENSSL_sk_new_null)
|
||||
+ RESOLVEFUNC(OPENSSL_sk_push)
|
||||
+ RESOLVEFUNC(OPENSSL_sk_free)
|
||||
+ RESOLVEFUNC(OPENSSL_sk_num)
|
||||
+ RESOLVEFUNC(OPENSSL_sk_pop_free)
|
||||
+ RESOLVEFUNC(OPENSSL_sk_value)
|
||||
RESOLVEFUNC(SSL_CIPHER_description)
|
||||
RESOLVEFUNC(SSL_CIPHER_get_bits)
|
||||
RESOLVEFUNC(SSL_CTX_check_private_key)
|
||||
@@ -891,9 +890,6 @@ bool q_resolveOpenSslSymbols()
|
||||
RESOLVEFUNC(SSL_set_psk_client_callback)
|
||||
#endif
|
||||
RESOLVEFUNC(SSL_write)
|
||||
-#ifndef OPENSSL_NO_SSL2
|
||||
- RESOLVEFUNC(SSLv2_client_method)
|
||||
-#endif
|
||||
#ifndef OPENSSL_NO_SSL3_METHOD
|
||||
RESOLVEFUNC(SSLv3_client_method)
|
||||
#endif
|
||||
@@ -903,9 +899,6 @@ bool q_resolveOpenSslSymbols()
|
||||
RESOLVEFUNC(TLSv1_1_client_method)
|
||||
RESOLVEFUNC(TLSv1_2_client_method)
|
||||
#endif
|
||||
-#ifndef OPENSSL_NO_SSL2
|
||||
- RESOLVEFUNC(SSLv2_server_method)
|
||||
-#endif
|
||||
#ifndef OPENSSL_NO_SSL3_METHOD
|
||||
RESOLVEFUNC(SSLv3_server_method)
|
||||
#endif
|
||||
@@ -938,6 +931,8 @@ bool q_resolveOpenSslSymbols()
|
||||
RESOLVEFUNC(X509_print)
|
||||
RESOLVEFUNC(X509_EXTENSION_get_object)
|
||||
RESOLVEFUNC(X509_free)
|
||||
+ RESOLVEFUNC(X509_get_notBefore)
|
||||
+ RESOLVEFUNC(X509_get_notAfter)
|
||||
RESOLVEFUNC(X509_get_ext)
|
||||
RESOLVEFUNC(X509_get_ext_count)
|
||||
RESOLVEFUNC(X509_get_ext_d2i)
|
||||
@@ -963,6 +958,8 @@ bool q_resolveOpenSslSymbols()
|
||||
RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf)
|
||||
RESOLVEFUNC(OPENSSL_add_all_algorithms_conf)
|
||||
RESOLVEFUNC(SSL_CTX_load_verify_locations)
|
||||
+ RESOLVEFUNC(OpenSSL_version_num)
|
||||
+ RESOLVEFUNC(OpenSSL_version)
|
||||
RESOLVEFUNC(SSLeay)
|
||||
RESOLVEFUNC(SSLeay_version)
|
||||
RESOLVEFUNC(i2d_SSL_SESSION)
|
||||
diff -up qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl_symbols_p.h.openssl11 qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl_symbols_p.h
|
||||
--- qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl_symbols_p.h.openssl11 2016-11-17 14:34:21.000000000 -0500
|
||||
+++ qtbase-opensource-src-5.7.1/src/network/ssl/qsslsocket_openssl_symbols_p.h 2016-11-28 10:02:51.125249192 -0500
|
||||
@@ -221,21 +221,18 @@ int q_ASN1_STRING_length(ASN1_STRING *a)
|
||||
int q_ASN1_STRING_to_UTF8(unsigned char **a, ASN1_STRING *b);
|
||||
long q_BIO_ctrl(BIO *a, int b, long c, void *d);
|
||||
int q_BIO_free(BIO *a);
|
||||
-BIO *q_BIO_new(BIO_METHOD *a);
|
||||
BIO *q_BIO_new_mem_buf(void *a, int b);
|
||||
int q_BIO_read(BIO *a, void *b, int c);
|
||||
-BIO_METHOD *q_BIO_s_mem();
|
||||
+BIO *q_BIO_new(const BIO_METHOD *a);
|
||||
+const BIO_METHOD *q_BIO_s_mem();
|
||||
int q_BIO_write(BIO *a, const void *b, int c);
|
||||
int q_BN_num_bits(const BIGNUM *a);
|
||||
#ifndef OPENSSL_NO_EC
|
||||
const EC_GROUP* q_EC_KEY_get0_group(const EC_KEY* k);
|
||||
int q_EC_GROUP_get_degree(const EC_GROUP* g);
|
||||
#endif
|
||||
-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)());
|
||||
-void q_CRYPTO_free(void *a);
|
||||
DSA *q_DSA_new();
|
||||
+int q_DSA_bits(const DSA *d);
|
||||
void q_DSA_free(DSA *a);
|
||||
X509 *q_d2i_X509(X509 **a, const unsigned char **b, long c);
|
||||
char *q_ERR_error_string(unsigned long a, char *b);
|
||||
@@ -251,6 +248,7 @@ int q_EVP_CipherFinal(EVP_CIPHER_CTX *ct
|
||||
const EVP_CIPHER *q_EVP_des_cbc();
|
||||
const EVP_CIPHER *q_EVP_des_ede3_cbc();
|
||||
const EVP_CIPHER *q_EVP_rc2_cbc();
|
||||
+const EVP_MD *q_EVP_sha1();
|
||||
int q_EVP_PKEY_assign(EVP_PKEY *a, int b, char *c);
|
||||
Q_AUTOTEST_EXPORT int q_EVP_PKEY_set1_RSA(EVP_PKEY *a, RSA *b);
|
||||
int q_EVP_PKEY_set1_DSA(EVP_PKEY *a, DSA *b);
|
||||
@@ -259,7 +257,9 @@ int q_EVP_PKEY_set1_EC_KEY(EVP_PKEY *a,
|
||||
#endif
|
||||
void q_EVP_PKEY_free(EVP_PKEY *a);
|
||||
RSA *q_EVP_PKEY_get1_RSA(EVP_PKEY *a);
|
||||
+RSA *q_EVP_PKEY_get0_RSA(EVP_PKEY *a);
|
||||
DSA *q_EVP_PKEY_get1_DSA(EVP_PKEY *a);
|
||||
+DSA *q_EVP_PKEY_get0_DSA(EVP_PKEY *a);
|
||||
#ifndef OPENSSL_NO_EC
|
||||
EC_KEY *q_EVP_PKEY_get1_EC_KEY(EVP_PKEY *a);
|
||||
#endif
|
||||
@@ -306,20 +306,14 @@ int q_PEM_write_bio_EC_PUBKEY(BIO *a, EC
|
||||
void q_RAND_seed(const void *a, int b);
|
||||
int q_RAND_status();
|
||||
RSA *q_RSA_new();
|
||||
+int q_RSA_bits(const RSA *r);
|
||||
void q_RSA_free(RSA *a);
|
||||
-int q_sk_num(STACK *a);
|
||||
-void q_sk_pop_free(STACK *a, void (*b)(void *));
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
||||
-_STACK *q_sk_new_null();
|
||||
-void q_sk_push(_STACK *st, void *data);
|
||||
-void q_sk_free(_STACK *a);
|
||||
-void * q_sk_value(STACK *a, int b);
|
||||
-#else
|
||||
-STACK *q_sk_new_null();
|
||||
-void q_sk_push(STACK *st, char *data);
|
||||
-void q_sk_free(STACK *a);
|
||||
-char * q_sk_value(STACK *a, int b);
|
||||
-#endif
|
||||
+int q_OPENSSL_sk_num(OPENSSL_STACK *a);
|
||||
+void q_OPENSSL_sk_pop_free(OPENSSL_STACK *a, void (*b)(void *));
|
||||
+OPENSSL_STACK *q_OPENSSL_sk_new_null();
|
||||
+void q_OPENSSL_sk_push(OPENSSL_STACK *st, void *data);
|
||||
+void q_OPENSSL_sk_free(OPENSSL_STACK *a);
|
||||
+void * q_OPENSSL_sk_value(OPENSSL_STACK *a, int b);
|
||||
int q_SSL_accept(SSL *a);
|
||||
int q_SSL_clear(SSL *a);
|
||||
char *q_SSL_CIPHER_description(SSL_CIPHER *a, char *b, int c);
|
||||
@@ -378,7 +372,7 @@ typedef unsigned int (*q_psk_client_call
|
||||
void q_SSL_set_psk_client_callback(SSL *ssl, q_psk_client_callback_t callback);
|
||||
#endif // OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
||||
-#ifndef OPENSSL_NO_SSL2
|
||||
+#if !defined(OPENSSL_NO_SSL2) && OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
const SSL_METHOD *q_SSLv2_client_method();
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SSL3_METHOD
|
||||
@@ -388,7 +382,7 @@ const SSL_METHOD *q_SSLv23_client_method
|
||||
const SSL_METHOD *q_TLSv1_client_method();
|
||||
const SSL_METHOD *q_TLSv1_1_client_method();
|
||||
const SSL_METHOD *q_TLSv1_2_client_method();
|
||||
-#ifndef OPENSSL_NO_SSL2
|
||||
+#if !defined(OPENSSL_NO_SSL2) && OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
const SSL_METHOD *q_SSLv2_server_method();
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SSL3_METHOD
|
||||
@@ -430,8 +424,11 @@ void *q_ASN1_dup(i2d_of_void *i2d, d2i_o
|
||||
X509 *q_X509_dup(X509 *a);
|
||||
#endif
|
||||
void q_X509_print(BIO *a, X509*b);
|
||||
+int q_X509_digest(const X509 *x509, const EVP_MD *type, unsigned char *md, unsigned int *len);
|
||||
ASN1_OBJECT *q_X509_EXTENSION_get_object(X509_EXTENSION *a);
|
||||
void q_X509_free(X509 *a);
|
||||
+ASN1_TIME *q_X509_get_notBefore(X509 *a);
|
||||
+ASN1_TIME *q_X509_get_notAfter(X509 *a);
|
||||
X509_EXTENSION *q_X509_get_ext(X509 *a, int b);
|
||||
int q_X509_get_ext_count(X509 *a);
|
||||
void *q_X509_get_ext_d2i(X509 *a, int b, int *c, int *d);
|
||||
@@ -519,10 +516,14 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsign
|
||||
PEM_ASN1_write_bio((int (*)(void*, unsigned char**))q_i2d_DSAPrivateKey,PEM_STRING_DSA,\
|
||||
bp,(char *)x,enc,kstr,klen,cb,u)
|
||||
#endif
|
||||
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
#define q_SSL_CTX_set_options(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
|
||||
+#else
|
||||
+long q_SSL_CTX_set_options(SSL_CTX *ctx, long options);
|
||||
+#endif
|
||||
#define q_SSL_CTX_set_mode(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL)
|
||||
-#define q_SKM_sk_num(type, st) ((int (*)(const STACK_OF(type) *))q_sk_num)(st)
|
||||
-#define q_SKM_sk_value(type, st,i) ((type * (*)(const STACK_OF(type) *, int))q_sk_value)(st, i)
|
||||
+#define q_SKM_sk_num(type, st) ((int (*)(const STACK_OF(type) *))q_OPENSSL_sk_num)(st)
|
||||
+#define q_SKM_sk_value(type, st,i) ((type * (*)(const STACK_OF(type) *, int))q_OPENSSL_sk_value)(st, i)
|
||||
#define q_sk_GENERAL_NAME_num(st) q_SKM_sk_num(GENERAL_NAME, (st))
|
||||
#define q_sk_GENERAL_NAME_value(st, i) q_SKM_sk_value(GENERAL_NAME, (st), (i))
|
||||
#define q_sk_X509_num(st) q_SKM_sk_num(X509, (st))
|
||||
@@ -531,8 +532,6 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsign
|
||||
#define q_sk_SSL_CIPHER_value(st, i) q_SKM_sk_value(SSL_CIPHER, (st), (i))
|
||||
#define q_SSL_CTX_add_extra_chain_cert(ctx,x509) \
|
||||
q_SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)
|
||||
-#define q_X509_get_notAfter(x) X509_get_notAfter(x)
|
||||
-#define q_X509_get_notBefore(x) X509_get_notBefore(x)
|
||||
#define q_EVP_PKEY_assign_RSA(pkey,rsa) q_EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\
|
||||
(char *)(rsa))
|
||||
#define q_EVP_PKEY_assign_DSA(pkey,dsa) q_EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\
|
||||
@@ -540,7 +539,10 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsign
|
||||
#define q_OpenSSL_add_all_algorithms() q_OPENSSL_add_all_algorithms_conf()
|
||||
void q_OPENSSL_add_all_algorithms_noconf();
|
||||
void q_OPENSSL_add_all_algorithms_conf();
|
||||
+void q_OPENSSL_free(void *addr);
|
||||
int q_SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, const char *CApath);
|
||||
+long q_OpenSSL_version_num();
|
||||
+const char *q_OpenSSL_version(int type);
|
||||
long q_SSLeay();
|
||||
const char *q_SSLeay_version(int type);
|
||||
int q_i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp);
|
133
qt5-qtbase.spec
133
qt5-qtbase.spec
|
@ -1,5 +1,3 @@
|
|||
#define prerelease rc
|
||||
|
||||
# See http://bugzilla.redhat.com/223663
|
||||
%define multilib_archs x86_64 %{ix86} %{?mips} ppc64 ppc s390x s390 sparc64 sparcv9
|
||||
%define multilib_basearchs x86_64 %{?mips64} ppc64 s390x sparc64
|
||||
|
@ -23,9 +21,15 @@
|
|||
|
||||
%global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
|
||||
|
||||
## set to 1 to enable bootstrap
|
||||
# set to 1 to enable bootstrap
|
||||
%global bootstrap 0
|
||||
|
||||
%if 0%{?fedora} > 25 || 0%{?rhel} > 7
|
||||
# set to 1 for openssl-1.1.x support
|
||||
#global openssl11 1
|
||||
%global firebird3x 1
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} > 21
|
||||
# use external qt_settings pkg
|
||||
%global qt_settings 1
|
||||
|
@ -61,13 +65,13 @@ BuildRequires: pkgconfig(libsystemd)
|
|||
|
||||
Name: qt5-qtbase
|
||||
Summary: Qt5 - QtBase components
|
||||
Version: 5.7.0
|
||||
Release: 4%{?dist}
|
||||
Version: 5.7.1
|
||||
Release: 9%{?dist}
|
||||
|
||||
# See LGPL_EXCEPTIONS.txt, for exception details
|
||||
License: LGPLv2 with exceptions or GPLv3 with exceptions
|
||||
Url: http://qt-project.org/
|
||||
Source0: http://download.qt.io/official_releases/qt/5.6/%{version}%{?prerelease:-%{prerelease}}/submodules/%{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}}.tar.xz
|
||||
Source0: http://download.qt.io/official_releases/qt/5.7/%{version}/submodules/%{qt_module}-opensource-src-%{version}.tar.xz
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1227295
|
||||
Source1: qtlogging.ini
|
||||
|
@ -89,22 +93,36 @@ Patch2: qtbase-multilib_optflags.patch
|
|||
# fix QTBUG-35459 (too low entityCharacterLimit=1024 for CVE-2013-4549)
|
||||
Patch4: qtbase-opensource-src-5.3.2-QTBUG-35459.patch
|
||||
|
||||
# unconditionally enable freetype lcdfilter support
|
||||
Patch12: qtbase-opensource-src-5.2.0-enable_ft_lcdfilter.patch
|
||||
|
||||
# upstreamable patches
|
||||
# namespace QT_VERSION_CHECK to workaround major/minor being pre-defined (#1396755)
|
||||
Patch50: qtbase-opensource-src-5.7.1-QT_VERSION_CHECK.patch
|
||||
|
||||
# Workaround moc/multilib issues
|
||||
# 1. Workaround moc/multilib issues
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1290020
|
||||
# https://bugreports.qt.io/browse/QTBUG-49972
|
||||
Patch52: qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch
|
||||
# 2. Workaround sysmacros.h (pre)defining major/minor a breaking stuff
|
||||
Patch52: qtbase-opensource-src-5.7.1-moc_macros.patch
|
||||
|
||||
# arm patch
|
||||
Patch54: qtbase-opensource-src-5.6.0-arm.patch
|
||||
|
||||
# recently passed code review, now integrated into 5.8 branch
|
||||
# https://codereview.qt-project.org/126102/
|
||||
Patch60: qtbase-opensource-src-5.7.1-moc_system_defines.patch
|
||||
|
||||
# drop -O3 and make -O2 by default
|
||||
Patch61: qt5-qtbase-cxxflag.patch
|
||||
|
||||
# Fix png system compilation
|
||||
Patch62: qt5-qtbase-5.7.1-libpng.patch
|
||||
|
||||
# adapted from berolinux for fedora
|
||||
# https://github.com/patch-exchange/openssl-1.1-transition/blob/master/qt5-qtbase/qtbase-5.7.0-openssl-1.1.patch
|
||||
Patch63: qt5-qtbase-5.7.1-openssl11.patch
|
||||
|
||||
# support firebird version 3.x
|
||||
Patch64: qt5-qtbase-5.7.1-firebird.patch
|
||||
|
||||
## upstream patches
|
||||
|
||||
# Do not check any files in %%{_qt5_plugindir}/platformthemes/ for requires.
|
||||
|
@ -114,8 +132,6 @@ Patch61: qt5-qtbase-cxxflag.patch
|
|||
# RPM drag in gtk3 as a dependency for the GTK+3 dialog support.
|
||||
%global __requires_exclude_from ^%{_qt5_plugindir}/platformthemes/.*$
|
||||
|
||||
# for %%check
|
||||
BuildRequires: cmake
|
||||
BuildRequires: cups-devel
|
||||
BuildRequires: desktop-file-utils
|
||||
BuildRequires: findutils
|
||||
|
@ -141,8 +157,16 @@ BuildRequires: pkgconfig(libproxy-1.0)
|
|||
BuildRequires: pkgconfig(ice) pkgconfig(sm)
|
||||
BuildRequires: pkgconfig(libpng)
|
||||
BuildRequires: pkgconfig(libudev)
|
||||
%if 0%{?fedora} > 25 || 0%{?rhel} > 7
|
||||
%global openssl -openssl-linked
|
||||
BuildRequires: compat-openssl10-devel
|
||||
#global openssl -openssl
|
||||
# since openssl is loaded dynamically, add an explicit dependency
|
||||
#Requires: openssl-libs%{?_isa}
|
||||
%else
|
||||
%global openssl -openssl-linked
|
||||
BuildRequires: pkgconfig(openssl)
|
||||
%endif
|
||||
BuildRequires: pkgconfig(libpulse) pkgconfig(libpulse-mainloop-glib)
|
||||
%if 0%{?fedora}
|
||||
%global xkbcommon -system-xkbcommon
|
||||
|
@ -180,6 +204,7 @@ BuildRequires: libicu-devel
|
|||
%endif
|
||||
BuildRequires: pkgconfig(xcb) pkgconfig(xcb-glx) pkgconfig(xcb-icccm) pkgconfig(xcb-image) pkgconfig(xcb-keysyms) pkgconfig(xcb-renderutil)
|
||||
BuildRequires: pkgconfig(zlib)
|
||||
BuildRequires: perl-generators
|
||||
BuildRequires: qt5-rpm-macros >= %{version}
|
||||
|
||||
%if 0%{?tests}
|
||||
|
@ -229,7 +254,7 @@ Requires: %{name}-gui%{?_isa}
|
|||
Requires: pkgconfig(egl)
|
||||
%endif
|
||||
Requires: pkgconfig(gl)
|
||||
Requires: qt5-rpm-macros
|
||||
Requires: qt5-rpm-macros >= %{version}
|
||||
%if 0%{?use_clang}
|
||||
Requires: clang >= 3.7.0
|
||||
%endif
|
||||
|
@ -326,14 +351,22 @@ Qt5 libraries used for drawing widgets and OpenGL items.
|
|||
|
||||
|
||||
%prep
|
||||
%setup -q -n %{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}}
|
||||
%setup -q -n %{qt_module}-opensource-src-%{version}
|
||||
|
||||
%patch4 -p1 -b .QTBUG-35459
|
||||
%patch12 -p1 -b .enable_ft_lcdfilter
|
||||
|
||||
%patch52 -p1 -b .moc_WORDSIZE
|
||||
%patch50 -p1 -b .QT_VERSION_CHECK
|
||||
%patch52 -p1 -b .moc_macros
|
||||
%patch54 -p1 -b .arm
|
||||
%patch60 -p1 -b .moc_system_defines
|
||||
%patch61 -p1 -b .qt5-qtbase-cxxflag
|
||||
%patch62 -p1 -b .libpng
|
||||
%if 0%{?openssl11}
|
||||
%patch63 -p1 -b .openssl11
|
||||
%endif
|
||||
%if 0%{?firebird3x}
|
||||
%patch64 -p1 -b .firebird
|
||||
%endif
|
||||
|
||||
%if 0%{?inject_optflags}
|
||||
## adjust $RPM_OPT_FLAGS
|
||||
|
@ -394,6 +427,11 @@ export CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
|
|||
export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS"
|
||||
export LDFLAGS="$LDFLAGS $RPM_LD_FLAGS"
|
||||
export MAKEFLAGS="%{?_smp_mflags}"
|
||||
%if 0%{?openssl11}
|
||||
export OPENSSL_LIBS="-lssl -lcrypto"
|
||||
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -DOPENSSL_API_COMPAT=0x10100000L"
|
||||
export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS -DOPENSSL_API_COMPAT=0x10100000L"
|
||||
%endif
|
||||
|
||||
./configure -v \
|
||||
-confirm-license \
|
||||
|
@ -401,13 +439,13 @@ export MAKEFLAGS="%{?_smp_mflags}"
|
|||
-prefix %{_qt5_prefix} \
|
||||
-archdatadir %{_qt5_archdatadir} \
|
||||
-bindir %{_qt5_bindir} \
|
||||
-libdir %{_qt5_libdir} \
|
||||
-libexecdir %{_qt5_libexecdir} \
|
||||
-datadir %{_qt5_datadir} \
|
||||
-docdir %{_qt5_docdir} \
|
||||
-examplesdir %{_qt5_examplesdir} \
|
||||
-headerdir %{_qt5_headerdir} \
|
||||
-importdir %{_qt5_importdir} \
|
||||
-libdir %{_qt5_libdir} \
|
||||
-libexecdir %{_qt5_libexecdir} \
|
||||
-plugindir %{_qt5_plugindir} \
|
||||
-sysconfdir %{_qt5_sysconfdir} \
|
||||
-translationdir %{_qt5_translationdir} \
|
||||
|
@ -498,7 +536,7 @@ translationdir=%{_qt5_translationdir}
|
|||
|
||||
Name: Qt5
|
||||
Description: Qt5 Configuration
|
||||
Version: %{version}
|
||||
Version: 5.7.1
|
||||
EOF
|
||||
|
||||
# rpm macros
|
||||
|
@ -515,7 +553,7 @@ sed -i \
|
|||
mkdir -p %{buildroot}{%{_qt5_archdatadir}/mkspecs/modules,%{_qt5_importdir},%{_qt5_libexecdir},%{_qt5_plugindir}/{designer,iconengines,script,styles},%{_qt5_translationdir}}
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/xdg/QtProject
|
||||
|
||||
# hardlink files to %{_bindir}, add -qt5 postfix to not conflict
|
||||
# hardlink files to {_bindir}, add -qt5 postfix to not conflict
|
||||
mkdir %{buildroot}%{_bindir}
|
||||
pushd %{buildroot}%{_qt5_bindir}
|
||||
for i in * ; do
|
||||
|
@ -902,12 +940,13 @@ fi
|
|||
%{_qt5_plugindir}/egldeviceintegrations/libqeglfs-kms-integration.so
|
||||
%{_qt5_plugindir}/egldeviceintegrations/libqeglfs-x11-integration.so
|
||||
%{_qt5_plugindir}/xcbglintegrations/libqxcb-egl-integration.so
|
||||
%{_qt5_plugindir}/egldeviceintegrations/libqeglfs-kms-egldevice-integration.so
|
||||
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QMinimalEglIntegrationPlugin.cmake
|
||||
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QEglFSIntegrationPlugin.cmake
|
||||
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QEglFSX11IntegrationPlugin.cmake
|
||||
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QEglFSKmsGbmIntegrationPlugin.cmake
|
||||
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QXcbEglIntegrationPlugin.cmake
|
||||
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QGtk3ThemePlugin.cmake
|
||||
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QEglFSKmsEglDeviceIntegrationPlugin.cmake
|
||||
%endif
|
||||
%{_qt5_plugindir}/platforms/libqlinuxfb.so
|
||||
%{_qt5_plugindir}/platforms/libqminimal.so
|
||||
|
@ -926,6 +965,54 @@ fi
|
|||
|
||||
|
||||
%changelog
|
||||
* Fri Dec 09 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.7.1-9
|
||||
- restore moc_system_defines.patch lost in 5.7.0 rebase
|
||||
|
||||
* Fri Dec 09 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.7.1-8
|
||||
- update moc patch to define _SYS_SYSMACROS_H_OUTER instead (#1396755)
|
||||
|
||||
* Thu Dec 08 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.7.1-7
|
||||
- really apply QT_VERSION_CHECK workaround (#1396755)
|
||||
|
||||
* Thu Dec 08 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.7.1-6
|
||||
- namespace QT_VERSION_CHECK to workaround major/minor being pre-defined (#1396755)
|
||||
- update moc patch to define _SYS_SYSMACROS_H (#1396755)
|
||||
|
||||
* Thu Dec 08 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.7.1-5
|
||||
- 5.7.1 dec5 snapshot
|
||||
|
||||
* Wed Dec 07 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.7.1-4
|
||||
- disable openssl11 (for now, FTBFS), use -openssl-linked (bug #1401459)
|
||||
- BR: perl-generators
|
||||
|
||||
* Mon Nov 28 2016 Than Ngo <than@redhat.com> - 5.7.1-3
|
||||
- add condition for rhel
|
||||
- add support for firebird-3.x
|
||||
|
||||
* Thu Nov 24 2016 Than Ngo <than@redhat.com> - 5.7.1-2
|
||||
- adapted the berolinux's patch for new openssl-1.1.x
|
||||
|
||||
* Wed Nov 09 2016 Helio Chissini de Castro <helio@kde.org> - 5.7.1-1
|
||||
- New upstream version
|
||||
|
||||
* Thu Oct 20 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.7.0-10
|
||||
- fix Source0 URL
|
||||
|
||||
* Thu Sep 29 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.7.0-9
|
||||
- Requires: openssl-libs%%{?_isa} (#1328659)
|
||||
|
||||
* Wed Sep 28 2016 Than Ngo <than@redhat.com> - 5.7.0-8
|
||||
- bz#1328659, load openssl libs dynamically
|
||||
|
||||
* Tue Sep 27 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.7.0-7
|
||||
- drop BR: cmake (handled by qt5-rpm-macros now)
|
||||
|
||||
* Wed Sep 14 2016 Than Ngo <than@redhat.com> - 5.7.0-6
|
||||
- add macros qtwebengine_arches in qt5
|
||||
|
||||
* Tue Sep 13 2016 Than Ngo <than@redhat.com> - 5.7.0-5
|
||||
- add rpm macros qtwebengine_arches for qtwebengine
|
||||
|
||||
* Mon Sep 12 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.7.0-4
|
||||
- use '#!/usr/bin/perl' instead of '#!/usr/bin/env perl'
|
||||
|
||||
|
@ -1023,7 +1110,7 @@ fi
|
|||
- backport "crash on start if system bus is not available" (QTBUG-51299)
|
||||
|
||||
* Sat Mar 05 2016 Rex Dieter <rdieter@fedoraproject.org> 5.6.0-0.37.rc
|
||||
- %build: ./configure -journal (f24+)
|
||||
- build: ./configure -journal (f24+)
|
||||
|
||||
* Wed Mar 02 2016 Daniel Vrátil <dvratil@fedoraproject.org> 5.6.0-0.36.rc
|
||||
- Non-bootstrapped build
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
diff -up qtbase-opensource-src-5.2.0/src/gui/text/qfontengine_ft.cpp.lcdfilter qtbase-opensource-src-5.2.0/src/gui/text/qfontengine_ft.cpp
|
||||
--- qtbase-opensource-src-5.2.0/src/gui/text/qfontengine_ft.cpp.lcdfilter 2013-12-08 11:09:51.000000000 -0600
|
||||
+++ qtbase-opensource-src-5.2.0/src/gui/text/qfontengine_ft.cpp 2014-01-27 13:09:28.426065603 -0600
|
||||
@@ -69,7 +69,7 @@
|
||||
#include FT_CONFIG_OPTIONS_H
|
||||
#endif
|
||||
|
||||
-#if defined(FT_LCD_FILTER_H) && defined(FT_CONFIG_OPTION_SUBPIXEL_RENDERING)
|
||||
+#if defined(FT_LCD_FILTER_H)
|
||||
#define QT_USE_FREETYPE_LCDFILTER
|
||||
#endif
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
diff -up qtbase-opensource-src-5.6.0-beta/src/tools/moc/main.cpp.moc_WORDSIZE qtbase-opensource-src-5.6.0-beta/src/tools/moc/main.cpp
|
||||
--- qtbase-opensource-src-5.6.0-beta/src/tools/moc/main.cpp.moc_WORDSIZE 2015-12-04 18:05:24.000000000 -0600
|
||||
+++ qtbase-opensource-src-5.6.0-beta/src/tools/moc/main.cpp 2015-12-15 20:57:55.554485416 -0600
|
||||
@@ -184,6 +184,10 @@ int runMoc(int argc, char **argv)
|
||||
Moc moc;
|
||||
pp.macros["Q_MOC_RUN"];
|
||||
pp.macros["__cplusplus"];
|
||||
+ Macro macro;
|
||||
+ macro.symbols = Preprocessor::tokenize(QByteArray::number(Q_PROCESSOR_WORDSIZE*8), 1, Preprocessor::TokenizeDefine);
|
||||
+ macro.symbols.removeLast(); // remove the EOF symbol
|
||||
+ pp.macros.insert("__WORDSIZE", macro);
|
||||
|
||||
// Don't stumble over GCC extensions
|
||||
Macro dummyVariadicFunctionMacro;
|
|
@ -0,0 +1,12 @@
|
|||
diff -up qtbase-opensource-src-5.7.1/src/corelib/global/qglobal.h.QT_VERSION_CHECK qtbase-opensource-src-5.7.1/src/corelib/global/qglobal.h
|
||||
--- qtbase-opensource-src-5.7.1/src/corelib/global/qglobal.h.QT_VERSION_CHECK 2016-12-01 02:17:04.000000000 -0600
|
||||
+++ qtbase-opensource-src-5.7.1/src/corelib/global/qglobal.h 2016-12-08 12:19:41.165310158 -0600
|
||||
@@ -54,7 +54,7 @@
|
||||
/*
|
||||
can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
|
||||
*/
|
||||
-#define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
|
||||
+#define QT_VERSION_CHECK(qt_version_check_major, qt_version_check_minor, qt_version_check_patch) ((qt_version_check_major<<16)|(qt_version_check_minor<<8)|(qt_version_check_patch))
|
||||
|
||||
#if !defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_CONFIGURE)
|
||||
#include <QtCore/qconfig.h>
|
|
@ -0,0 +1,15 @@
|
|||
diff -up qtbase-opensource-src-5.7.1/src/tools/moc/main.cpp.moc_WORDSIZE qtbase-opensource-src-5.7.1/src/tools/moc/main.cpp
|
||||
--- qtbase-opensource-src-5.7.1/src/tools/moc/main.cpp.moc_WORDSIZE 2016-12-01 02:17:04.000000000 -0600
|
||||
+++ qtbase-opensource-src-5.7.1/src/tools/moc/main.cpp 2016-12-08 12:37:28.931589338 -0600
|
||||
@@ -179,6 +179,11 @@ int runMoc(int argc, char **argv)
|
||||
Moc moc;
|
||||
pp.macros["Q_MOC_RUN"];
|
||||
pp.macros["__cplusplus"];
|
||||
+ pp.macros["_SYS_SYSMACROS_H_OUTER"];
|
||||
+ Macro macro;
|
||||
+ macro.symbols = Preprocessor::tokenize(QByteArray::number(Q_PROCESSOR_WORDSIZE*8), 1, Preprocessor::TokenizeDefine);
|
||||
+ macro.symbols.removeLast(); // remove the EOF symbol
|
||||
+ pp.macros.insert("__WORDSIZE", macro);
|
||||
|
||||
// Don't stumble over GCC extensions
|
||||
Macro dummyVariadicFunctionMacro;
|
|
@ -0,0 +1,331 @@
|
|||
diff -up qtbase-opensource-src-5.7.1/mkspecs/features/moc.prf.moc_system_defines qtbase-opensource-src-5.7.1/mkspecs/features/moc.prf
|
||||
--- qtbase-opensource-src-5.7.1/mkspecs/features/moc.prf.moc_system_defines 2016-12-01 02:17:04.000000000 -0600
|
||||
+++ qtbase-opensource-src-5.7.1/mkspecs/features/moc.prf 2016-12-09 10:24:12.463205987 -0600
|
||||
@@ -24,8 +24,25 @@ win32:count(MOC_INCLUDEPATH, 40, >) {
|
||||
write_file($$absolute_path($$WIN_INCLUDETEMP, $$OUT_PWD), WIN_INCLUDETEMP_CONT)|error("Aborting.")
|
||||
}
|
||||
|
||||
+# QNX's compiler sets "gcc" config, but does not support the -dM option;
|
||||
+# iOS builds are multi-arch, so this feature cannot possibly work.
|
||||
+if(gcc|intel_icl|msvc):!rim_qcc:!ios {
|
||||
+ moc_predefs.CONFIG = no_link
|
||||
+ gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
|
||||
+ else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
|
||||
+ else:msvc {
|
||||
+ # make sure that our bin dir is first in path, so qmake is found
|
||||
+ moc_predefs.commands = PATH $$shell_path($$[QT_INSTALL_BINS/src]);%PATH%&
|
||||
+ moc_predefs.commands += $$QMAKE_CXX -Bxqmake $$QMAKE_CXXFLAGS -E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT}
|
||||
+ } else: error("Oops, I messed up")
|
||||
+ moc_predefs.output = $$MOC_DIR/moc_predefs.h
|
||||
+ moc_predefs.input = MOC_PREDEF_FILE
|
||||
+ silent: moc_predefs.commands = @echo generating $$moc_predefs.output$$escape_expand(\n\t)@$$moc_predefs.commands
|
||||
+ QMAKE_EXTRA_COMPILERS += moc_predefs
|
||||
+ MOC_PREDEF_FILE = $$[QT_HOST_DATA/src]/mkspecs/features/data/dummy.cpp
|
||||
+}
|
||||
+
|
||||
defineReplace(mocCmdBase) {
|
||||
- RET =
|
||||
!isEmpty(WIN_INCLUDETEMP) {
|
||||
incvar = @$$WIN_INCLUDETEMP
|
||||
} else {
|
||||
@@ -34,7 +51,13 @@ defineReplace(mocCmdBase) {
|
||||
incvar += -I$$shell_quote($$inc)
|
||||
incvar += $$QMAKE_FRAMEWORKPATH_FLAGS
|
||||
}
|
||||
- RET += $$QMAKE_MOC $(DEFINES) $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$incvar $$QMAKE_MOC_OPTIONS
|
||||
+
|
||||
+ RET = $$QMAKE_MOC $(DEFINES)
|
||||
+
|
||||
+ isEmpty(MOC_PREDEF_FILE): RET += $$join(QMAKE_COMPILER_DEFINES, " -D", -D)
|
||||
+ else: RET += --include $$moc_predefs.output
|
||||
+
|
||||
+ RET += $$incvar $$QMAKE_MOC_OPTIONS
|
||||
return($$RET)
|
||||
}
|
||||
|
||||
@@ -46,7 +69,7 @@ moc_header.output = $$MOC_DIR/$${QMAKE_H
|
||||
moc_header.input = HEADERS
|
||||
moc_header.variable_out = SOURCES
|
||||
moc_header.name = MOC ${QMAKE_FILE_IN}
|
||||
-moc_header.depends += $$WIN_INCLUDETEMP
|
||||
+moc_header.depends += $$WIN_INCLUDETEMP $$moc_predefs.output
|
||||
silent:moc_header.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_header.commands
|
||||
QMAKE_EXTRA_COMPILERS += moc_header
|
||||
INCREDIBUILD_XGE += moc_header
|
||||
@@ -58,7 +81,7 @@ moc_source.commands = ${QMAKE_FUNC_mocCm
|
||||
moc_source.output = $$MOC_DIR/$${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_EXT_CPP_MOC}
|
||||
moc_source.input = SOURCES OBJECTIVE_SOURCES
|
||||
moc_source.name = MOC ${QMAKE_FILE_IN}
|
||||
-moc_source.depends += $$WIN_INCLUDETEMP
|
||||
+moc_source.depends += $$WIN_INCLUDETEMP $$moc_predefs.output
|
||||
silent:moc_source.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_source.commands
|
||||
QMAKE_EXTRA_COMPILERS += moc_source
|
||||
INCREDIBUILD_XGE += moc_source
|
||||
diff -up qtbase-opensource-src-5.7.1/qmake/main.cpp.moc_system_defines qtbase-opensource-src-5.7.1/qmake/main.cpp
|
||||
--- qtbase-opensource-src-5.7.1/qmake/main.cpp.moc_system_defines 2016-12-01 02:17:04.000000000 -0600
|
||||
+++ qtbase-opensource-src-5.7.1/qmake/main.cpp 2016-12-09 10:24:12.463205987 -0600
|
||||
@@ -42,6 +42,10 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
+#ifdef Q_OS_WIN
|
||||
+# include <qt_windows.h>
|
||||
+#endif
|
||||
+
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
@@ -241,6 +245,30 @@ static int doInstall(int argc, char **ar
|
||||
return 3;
|
||||
}
|
||||
|
||||
+static int dumpMacros(const wchar_t *cmdline)
|
||||
+{
|
||||
+ // from http://stackoverflow.com/questions/3665537/how-to-find-out-cl-exes-built-in-macros
|
||||
+ int argc;
|
||||
+ wchar_t **argv = CommandLineToArgvW(cmdline, &argc);
|
||||
+ if (!argv)
|
||||
+ return 2;
|
||||
+ for (int i = 0; i < argc; ++i) {
|
||||
+ if (argv[i][0] != L'-' || argv[i][1] != 'D')
|
||||
+ continue;
|
||||
+
|
||||
+ wchar_t *value = wcschr(argv[i], L'=');
|
||||
+ if (value) {
|
||||
+ *value = 0;
|
||||
+ ++value;
|
||||
+ } else {
|
||||
+ // point to the NUL at the end, so we don't print anything
|
||||
+ value = argv[i] + wcslen(argv[i]);
|
||||
+ }
|
||||
+ wprintf(L"#define %Ls %Ls\n", argv[i] + 2, value);
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
/* This is to work around lame implementation on Darwin. It has been noted that the getpwd(3) function
|
||||
@@ -275,6 +303,15 @@ int runQMake(int argc, char **argv)
|
||||
// Workaround for inferior/missing command line tools on Windows: make our own!
|
||||
if (argc >= 2 && !strcmp(argv[1], "-install"))
|
||||
return doInstall(argc - 2, argv + 2);
|
||||
+
|
||||
+ {
|
||||
+ // Support running as Visual C++'s compiler
|
||||
+ const wchar_t *cmdline = _wgetenv(L"MSC_CMD_FLAGS");
|
||||
+ if (!cmdline || !*cmdline)
|
||||
+ cmdline = _wgetenv(L"MSC_IDE_FLAGS");
|
||||
+ if (cmdline && *cmdline)
|
||||
+ return dumpMacros(cmdline);
|
||||
+ }
|
||||
#endif
|
||||
|
||||
QMakeVfs vfs;
|
||||
diff -up qtbase-opensource-src-5.7.1/src/tools/moc/main.cpp.moc_system_defines qtbase-opensource-src-5.7.1/src/tools/moc/main.cpp
|
||||
--- qtbase-opensource-src-5.7.1/src/tools/moc/main.cpp.moc_system_defines 2016-12-09 10:24:12.458205887 -0600
|
||||
+++ qtbase-opensource-src-5.7.1/src/tools/moc/main.cpp 2016-12-09 10:53:10.285347282 -0600
|
||||
@@ -259,6 +259,11 @@ int runMoc(int argc, char **argv)
|
||||
prependIncludeOption.setValueName(QStringLiteral("file"));
|
||||
parser.addOption(prependIncludeOption);
|
||||
|
||||
+ QCommandLineOption includeOption(QStringLiteral("include"));
|
||||
+ includeOption.setDescription(QStringLiteral("Parse <file> as an #include before the main source(s)."));
|
||||
+ includeOption.setValueName(QStringLiteral("file"));
|
||||
+ parser.addOption(includeOption);
|
||||
+
|
||||
QCommandLineOption noNotesWarningsCompatOption(QStringLiteral("n"));
|
||||
noNotesWarningsCompatOption.setDescription(QStringLiteral("Do not display notes (-nn) or warnings (-nw). Compatibility option."));
|
||||
noNotesWarningsCompatOption.setValueName(QStringLiteral("which"));
|
||||
@@ -415,7 +420,31 @@ int runMoc(int argc, char **argv)
|
||||
moc.includes = pp.includes;
|
||||
|
||||
// 1. preprocess
|
||||
- moc.symbols = pp.preprocessed(moc.filename, &in);
|
||||
+ const auto includeFiles = parser.values(includeOption);
|
||||
+ for (const QString &includeName : includeFiles) {
|
||||
+ QByteArray rawName = pp.resolveInclude(QFile::encodeName(includeName), moc.filename);
|
||||
+ if (rawName.isEmpty()) {
|
||||
+ fprintf(stderr, "Warning: Failed to resolve include \"%s\" for moc file %s\n",
|
||||
+ includeName.toLocal8Bit().constData(),
|
||||
+ moc.filename.isEmpty() ? "<standard input>" : moc.filename.constData());
|
||||
+ } else {
|
||||
+ QFile f(QFile::decodeName(rawName));
|
||||
+ if (f.open(QIODevice::ReadOnly)) {
|
||||
+ moc.symbols += Symbol(0, MOC_INCLUDE_BEGIN, rawName);
|
||||
+ moc.symbols += pp.preprocessed(rawName, &f);
|
||||
+ moc.symbols += Symbol(0, MOC_INCLUDE_END, rawName);
|
||||
+ } else {
|
||||
+ fprintf(stderr, "Warning: Cannot open %s included by moc file %s: %s\n",
|
||||
+ rawName.constData(),
|
||||
+ moc.filename.isEmpty() ? "<standard input>" : moc.filename.constData(),
|
||||
+ f.errorString().toLocal8Bit().constData());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ moc.symbols += pp.preprocessed(moc.filename, &in);
|
||||
+
|
||||
+ // We obviously do not support MS extensions
|
||||
+ pp.macros.remove("_MSC_EXTENSIONS");
|
||||
|
||||
if (!pp.preprocessOnly) {
|
||||
// 2. parse
|
||||
diff -up qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.cpp.moc_system_defines qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.cpp
|
||||
--- qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.cpp.moc_system_defines 2016-12-01 02:17:04.000000000 -0600
|
||||
+++ qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.cpp 2016-12-09 10:24:12.464206007 -0600
|
||||
@@ -1008,6 +1008,37 @@ static void mergeStringLiterals(Symbols
|
||||
}
|
||||
}
|
||||
|
||||
+QByteArray Preprocessor::resolveInclude(const QByteArray &include, const QByteArray &relativeTo)
|
||||
+{
|
||||
+ // #### stringery
|
||||
+ QFileInfo fi;
|
||||
+ if (!relativeTo.isEmpty())
|
||||
+ fi.setFile(QFileInfo(QString::fromLocal8Bit(relativeTo.constData())).dir(), QString::fromLocal8Bit(include.constData()));
|
||||
+ for (int j = 0; j < Preprocessor::includes.size() && !fi.exists(); ++j) {
|
||||
+ const IncludePath &p = Preprocessor::includes.at(j);
|
||||
+ if (p.isFrameworkPath) {
|
||||
+ const int slashPos = include.indexOf('/');
|
||||
+ if (slashPos == -1)
|
||||
+ continue;
|
||||
+ QByteArray frameworkCandidate = include.left(slashPos);
|
||||
+ frameworkCandidate.append(".framework/Headers/");
|
||||
+ fi.setFile(QString::fromLocal8Bit(QByteArray(p.path + '/' + frameworkCandidate).constData()), QString::fromLocal8Bit(include.mid(slashPos + 1).constData()));
|
||||
+ } else {
|
||||
+ fi.setFile(QString::fromLocal8Bit(p.path.constData()), QString::fromLocal8Bit(include.constData()));
|
||||
+ }
|
||||
+ // try again, maybe there's a file later in the include paths with the same name
|
||||
+ // (186067)
|
||||
+ if (fi.isDir()) {
|
||||
+ fi = QFileInfo();
|
||||
+ continue;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!fi.exists() || fi.isDir())
|
||||
+ return QByteArray();
|
||||
+ return fi.canonicalFilePath().toLocal8Bit();
|
||||
+}
|
||||
+
|
||||
void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed)
|
||||
{
|
||||
currentFilenames.push(filename);
|
||||
@@ -1028,32 +1059,9 @@ void Preprocessor::preprocess(const QByt
|
||||
continue;
|
||||
until(PP_NEWLINE);
|
||||
|
||||
- // #### stringery
|
||||
- QFileInfo fi;
|
||||
- if (local)
|
||||
- fi.setFile(QFileInfo(QString::fromLocal8Bit(filename.constData())).dir(), QString::fromLocal8Bit(include.constData()));
|
||||
- for (int j = 0; j < Preprocessor::includes.size() && !fi.exists(); ++j) {
|
||||
- const IncludePath &p = Preprocessor::includes.at(j);
|
||||
- if (p.isFrameworkPath) {
|
||||
- const int slashPos = include.indexOf('/');
|
||||
- if (slashPos == -1)
|
||||
- continue;
|
||||
- fi.setFile(QString::fromLocal8Bit(p.path + '/' + include.left(slashPos) + ".framework/Headers/"),
|
||||
- QString::fromLocal8Bit(include.mid(slashPos + 1).constData()));
|
||||
- } else {
|
||||
- fi.setFile(QString::fromLocal8Bit(p.path.constData()), QString::fromLocal8Bit(include.constData()));
|
||||
- }
|
||||
- // try again, maybe there's a file later in the include paths with the same name
|
||||
- // (186067)
|
||||
- if (fi.isDir()) {
|
||||
- fi = QFileInfo();
|
||||
- continue;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (!fi.exists() || fi.isDir())
|
||||
+ include = resolveInclude(include, local ? filename : QByteArray());
|
||||
+ if (include.isNull())
|
||||
continue;
|
||||
- include = fi.canonicalFilePath().toLocal8Bit();
|
||||
|
||||
if (Preprocessor::preprocessedIncludes.contains(include))
|
||||
continue;
|
||||
@@ -1208,6 +1216,7 @@ Symbols Preprocessor::preprocessed(const
|
||||
input = cleaned(input);
|
||||
|
||||
// phase 2: tokenize for the preprocessor
|
||||
+ index = 0;
|
||||
symbols = tokenize(input);
|
||||
|
||||
#if 0
|
||||
diff -up qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.h.moc_system_defines qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.h
|
||||
--- qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.h.moc_system_defines 2016-12-01 02:17:04.000000000 -0600
|
||||
+++ qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.h 2016-12-09 10:24:12.464206007 -0600
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
QList<QByteArray> frameworks;
|
||||
QSet<QByteArray> preprocessedIncludes;
|
||||
Macros macros;
|
||||
+ QByteArray resolveInclude(const QByteArray &filename, const QByteArray &relativeTo);
|
||||
Symbols preprocessed(const QByteArray &filename, QFile *device);
|
||||
|
||||
void parseDefineArguments(Macro *m);
|
||||
diff -up qtbase-opensource-src-5.7.1/tests/auto/tools/moc/subdir/extradefines.h.moc_system_defines qtbase-opensource-src-5.7.1/tests/auto/tools/moc/subdir/extradefines.h
|
||||
--- qtbase-opensource-src-5.7.1/tests/auto/tools/moc/subdir/extradefines.h.moc_system_defines 2016-12-09 10:24:12.464206007 -0600
|
||||
+++ qtbase-opensource-src-5.7.1/tests/auto/tools/moc/subdir/extradefines.h 2016-12-09 10:24:12.464206007 -0600
|
||||
@@ -0,0 +1 @@
|
||||
+#define FOO 1
|
||||
diff -up qtbase-opensource-src-5.7.1/tests/auto/tools/moc/tst_moc.cpp.moc_system_defines qtbase-opensource-src-5.7.1/tests/auto/tools/moc/tst_moc.cpp
|
||||
--- qtbase-opensource-src-5.7.1/tests/auto/tools/moc/tst_moc.cpp.moc_system_defines 2016-12-01 02:17:04.000000000 -0600
|
||||
+++ qtbase-opensource-src-5.7.1/tests/auto/tools/moc/tst_moc.cpp 2016-12-09 10:24:12.465206027 -0600
|
||||
@@ -576,6 +576,8 @@ private slots:
|
||||
void frameworkSearchPath();
|
||||
void cstyleEnums();
|
||||
void defineMacroViaCmdline();
|
||||
+ void defineMacroViaForcedInclude();
|
||||
+ void defineMacroViaForcedIncludeRelative();
|
||||
void specifyMetaTagsFromCmdline();
|
||||
void invokable();
|
||||
void singleFunctionKeywordSignalAndSlot();
|
||||
@@ -1244,6 +1246,46 @@ void tst_Moc::defineMacroViaCmdline()
|
||||
args << m_sourceDirectory + QStringLiteral("/macro-on-cmdline.h");
|
||||
|
||||
proc.start(m_moc, args);
|
||||
+ QVERIFY(proc.waitForFinished());
|
||||
+ QCOMPARE(proc.exitCode(), 0);
|
||||
+ QCOMPARE(proc.readAllStandardError(), QByteArray());
|
||||
+ QByteArray mocOut = proc.readAllStandardOutput();
|
||||
+ QVERIFY(!mocOut.isEmpty());
|
||||
+#else
|
||||
+ QSKIP("Only tested on linux/gcc");
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+void tst_Moc::defineMacroViaForcedInclude()
|
||||
+{
|
||||
+#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
|
||||
+ QProcess proc;
|
||||
+
|
||||
+ QStringList args;
|
||||
+ args << "--include" << m_sourceDirectory + QLatin1String("/subdir/extradefines.h");
|
||||
+ args << m_sourceDirectory + QStringLiteral("/macro-on-cmdline.h");
|
||||
+
|
||||
+ proc.start(m_moc, args);
|
||||
+ QVERIFY(proc.waitForFinished());
|
||||
+ QCOMPARE(proc.exitCode(), 0);
|
||||
+ QCOMPARE(proc.readAllStandardError(), QByteArray());
|
||||
+ QByteArray mocOut = proc.readAllStandardOutput();
|
||||
+ QVERIFY(!mocOut.isEmpty());
|
||||
+#else
|
||||
+ QSKIP("Only tested on linux/gcc");
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+void tst_Moc::defineMacroViaForcedIncludeRelative()
|
||||
+{
|
||||
+#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
|
||||
+ QProcess proc;
|
||||
+
|
||||
+ QStringList args;
|
||||
+ args << "--include" << QStringLiteral("extradefines.h") << "-I" + m_sourceDirectory + "/subdir";
|
||||
+ args << m_sourceDirectory + QStringLiteral("/macro-on-cmdline.h");
|
||||
+
|
||||
+ proc.start(m_moc, args);
|
||||
QVERIFY(proc.waitForFinished());
|
||||
QCOMPARE(proc.exitCode(), 0);
|
||||
QCOMPARE(proc.readAllStandardError(), QByteArray());
|
Loading…
Reference in New Issue