diff --git a/0001-Fix-meta-file-replacements-if-matches-are-empty.patch b/0001-Fix-meta-file-replacements-if-matches-are-empty.patch new file mode 100644 index 0000000..946df94 --- /dev/null +++ b/0001-Fix-meta-file-replacements-if-matches-are-empty.patch @@ -0,0 +1,57 @@ +From 60136b1a846ca5aedeb588edaa178927abb002ec Mon Sep 17 00:00:00 2001 +From: Joerg Bornemann +Date: Mon, 3 Jun 2019 14:39:07 +0200 +Subject: Fix meta file replacements if matches are empty + +QMake code like + rplc.match = + QMAKE_PRL_INSTALL_REPLACE += rplc +led to the generation of invalid sed calls in the Makefile. + +It is already actively checked for empty matches, but if *all* matches +are empty, the sed call looks like + sed foo > bar +which is invalid. + +Task-number: QTBUG-75901 +Change-Id: I173ed99826414dcf06253a15a247f7d067ee3977 +Reviewed-by: Thiago Macieira +--- + qmake/generators/makefile.cpp | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp +index bfef31f17e..6edaf1f70e 100644 +--- a/qmake/generators/makefile.cpp ++++ b/qmake/generators/makefile.cpp +@@ -3437,19 +3437,23 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt + || project->isActiveConfig("no_sed_meta_install")) { + ret += "-$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst); + } else { +- ret += "-$(SED)"; ++ QString sedargs; + const ProStringList &replace_rules = project->values(replace_rule); + for (int r = 0; r < replace_rules.size(); ++r) { + const ProString match = project->first(ProKey(replace_rules.at(r) + ".match")), + replace = project->first(ProKey(replace_rules.at(r) + ".replace")); + if (!match.isEmpty() /*&& match != replace*/) { +- ret += " -e " + shellQuote("s," + match + "," + replace + ",g"); ++ sedargs += " -e " + shellQuote("s," + match + "," + replace + ",g"); + if (isWindowsShell() && project->first(ProKey(replace_rules.at(r) + ".CONFIG")).contains("path")) +- ret += " -e " + shellQuote("s," + windowsifyPath(match.toQString()) ++ sedargs += " -e " + shellQuote("s," + windowsifyPath(match.toQString()) + + "," + windowsifyPath(replace.toQString()) + ",gi"); + } + } +- ret += ' ' + escapeFilePath(src) + " > " + escapeFilePath(dst); ++ if (sedargs.isEmpty()) { ++ ret += "-$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst); ++ } else { ++ ret += "-$(SED) " + sedargs + ' ' + escapeFilePath(src) + " > " + escapeFilePath(dst); ++ } + } + return ret; + } +-- +cgit v1.2.1 + diff --git a/0002-Do-not-write-Libs-into-.pc-files-if-TEMPLATE-is-not-.patch b/0002-Do-not-write-Libs-into-.pc-files-if-TEMPLATE-is-not-.patch new file mode 100644 index 0000000..108afa9 --- /dev/null +++ b/0002-Do-not-write-Libs-into-.pc-files-if-TEMPLATE-is-not-.patch @@ -0,0 +1,103 @@ +From c64f8ca232cc1f2131282d9eb6279ef9b565be88 Mon Sep 17 00:00:00 2001 +From: Joerg Bornemann +Date: Mon, 3 Jun 2019 14:52:49 +0200 +Subject: Do not write 'Libs:' into .pc files if TEMPLATE is not 'lib' + +Especially for header modules we don't want a 'Libs:' entry in their +.pc file. + +Task-number: QTBUG-75901 +Change-Id: I39037d3132e39dd360532e1425f794ebec28e0bd +Reviewed-by: Thiago Macieira +--- + qmake/generators/makefile.cpp | 74 ++++++++++++++++++++++--------------------- + 1 file changed, 38 insertions(+), 36 deletions(-) + +diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp +index 6edaf1f70e..4a99a60892 100644 +--- a/qmake/generators/makefile.cpp ++++ b/qmake/generators/makefile.cpp +@@ -3359,42 +3359,44 @@ MakefileGenerator::writePkgConfigFile() + if (!version.isEmpty()) + t << "Version: " << version << endl; + +- // libs +- t << "Libs: "; +- QString pkgConfiglibName; +- if (target_mode == TARG_MAC_MODE && project->isActiveConfig("lib_bundle")) { +- if (libDir != QLatin1String("/Library/Frameworks")) +- t << "-F${libdir} "; +- ProString bundle; +- if (!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME")) +- bundle = project->first("QMAKE_FRAMEWORK_BUNDLE_NAME"); +- else +- bundle = project->first("TARGET"); +- int suffix = bundle.lastIndexOf(".framework"); +- if (suffix != -1) +- bundle = bundle.left(suffix); +- t << "-framework "; +- pkgConfiglibName = bundle.toQString(); +- } else { +- if (!project->values("QMAKE_DEFAULT_LIBDIRS").contains(libDir)) +- t << "-L${libdir} "; +- pkgConfiglibName = "-l" + project->first("QMAKE_ORIG_TARGET"); +- if (project->isActiveConfig("shared")) +- pkgConfiglibName += project->first("TARGET_VERSION_EXT").toQString(); +- } +- t << shellQuote(pkgConfiglibName) << " \n"; +- +- if (project->isActiveConfig("staticlib")) { +- ProStringList libs; +- libs << "LIBS"; // FIXME: this should not be conditional on staticlib +- libs << "LIBS_PRIVATE"; +- libs << "QMAKE_LIBS"; // FIXME: this should not be conditional on staticlib +- libs << "QMAKE_LIBS_PRIVATE"; +- libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread? +- t << "Libs.private:"; +- for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it) +- t << ' ' << fixLibFlags((*it).toKey()).join(' '); +- t << endl; ++ if (project->first("TEMPLATE") == "lib") { ++ // libs ++ t << "Libs: "; ++ QString pkgConfiglibName; ++ if (target_mode == TARG_MAC_MODE && project->isActiveConfig("lib_bundle")) { ++ if (libDir != QLatin1String("/Library/Frameworks")) ++ t << "-F${libdir} "; ++ ProString bundle; ++ if (!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME")) ++ bundle = project->first("QMAKE_FRAMEWORK_BUNDLE_NAME"); ++ else ++ bundle = project->first("TARGET"); ++ int suffix = bundle.lastIndexOf(".framework"); ++ if (suffix != -1) ++ bundle = bundle.left(suffix); ++ t << "-framework "; ++ pkgConfiglibName = bundle.toQString(); ++ } else { ++ if (!project->values("QMAKE_DEFAULT_LIBDIRS").contains(libDir)) ++ t << "-L${libdir} "; ++ pkgConfiglibName = "-l" + project->first("QMAKE_ORIG_TARGET"); ++ if (project->isActiveConfig("shared")) ++ pkgConfiglibName += project->first("TARGET_VERSION_EXT").toQString(); ++ } ++ t << shellQuote(pkgConfiglibName) << " \n"; ++ ++ if (project->isActiveConfig("staticlib")) { ++ ProStringList libs; ++ libs << "LIBS"; // FIXME: this should not be conditional on staticlib ++ libs << "LIBS_PRIVATE"; ++ libs << "QMAKE_LIBS"; // FIXME: this should not be conditional on staticlib ++ libs << "QMAKE_LIBS_PRIVATE"; ++ libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread? ++ t << "Libs.private:"; ++ for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it) ++ t << ' ' << fixLibFlags((*it).toKey()).join(' '); ++ t << endl; ++ } + } + + // flags +-- +cgit v1.2.1 + diff --git a/0003-Make-sure-.pc-.prl-and-.la-files-are-created-for-hea.patch b/0003-Make-sure-.pc-.prl-and-.la-files-are-created-for-hea.patch new file mode 100644 index 0000000..8049313 --- /dev/null +++ b/0003-Make-sure-.pc-.prl-and-.la-files-are-created-for-hea.patch @@ -0,0 +1,102 @@ +From 4da47d0fba04e5d50bf6b63e73bc0de986560f42 Mon Sep 17 00:00:00 2001 +From: Joerg Bornemann +Date: Mon, 3 Jun 2019 14:59:16 +0200 +Subject: Make sure .pc, .prl and .la files are created for header_only modules + +Those modules are TEMPLATE=aux, so they weren't triggering the file creation +here. + +To make this work properly we have to: + - check for TEMPLATE aux in the right places + - add a dummy target to INSTALLS to actually trigger the creation + - initialize PRL_TARGET for aux templates + +Fixes: QTBUG-75901 +Started-by: Thiago Macieira +Change-Id: Idce141629dd34287808bfffd159f92ac28c6c8b1 +Reviewed-by: Thiago Macieira +--- + mkspecs/features/qt_module.prf | 5 +++++ + qmake/generators/makefile.cpp | 3 ++- + qmake/generators/unix/unixmake.cpp | 2 +- + qmake/generators/unix/unixmake2.cpp | 10 +++++++--- + 4 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf +index 51b5bde67a..18060cd490 100644 +--- a/mkspecs/features/qt_module.prf ++++ b/mkspecs/features/qt_module.prf +@@ -82,6 +82,11 @@ header_module { + CONFIG += force_qt # Needed for the headers_clean tests. + !lib_bundle: \ + CONFIG += qt_no_install_library ++ ++ # Allow creation of .prl, .la and .pc files. ++ target.path = $$[QT_INSTALL_LIBS] ++ target.CONFIG += dummy_install ++ INSTALLS += target + } else { + TEMPLATE = lib + } +diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp +index 4a99a60892..caaf6e71b6 100644 +--- a/qmake/generators/makefile.cpp ++++ b/qmake/generators/makefile.cpp +@@ -1120,7 +1120,8 @@ MakefileGenerator::writePrlFile() + && project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty() + && project->isActiveConfig("create_prl") + && (project->first("TEMPLATE") == "lib" +- || project->first("TEMPLATE") == "vclib") ++ || project->first("TEMPLATE") == "vclib" ++ || project->first("TEMPLATE") == "aux") + && (!project->isActiveConfig("plugin") || project->isActiveConfig("static"))) { //write prl file + QString local_prl = prlFileName(); + QString prl = fileFixify(local_prl); +diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp +index 7f42fbe09e..b809bb6c19 100644 +--- a/qmake/generators/unix/unixmake.cpp ++++ b/qmake/generators/unix/unixmake.cpp +@@ -726,7 +726,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t) + } + } + } +- if(project->first("TEMPLATE") == "lib") { ++ if (isAux || project->first("TEMPLATE") == "lib") { + QStringList types; + types << "prl" << "libtool" << "pkgconfig"; + for(int i = 0; i < types.size(); ++i) { +diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp +index 24215ae7b0..d9bcccf2e2 100644 +--- a/qmake/generators/unix/unixmake2.cpp ++++ b/qmake/generators/unix/unixmake2.cpp +@@ -48,12 +48,15 @@ void + UnixMakefileGenerator::writePrlFile(QTextStream &t) + { + MakefileGenerator::writePrlFile(t); ++ const ProString tmplt = project->first("TEMPLATE"); ++ if (tmplt != "lib" && tmplt != "aux") ++ return; + // libtool support +- if(project->isActiveConfig("create_libtool") && project->first("TEMPLATE") == "lib") { //write .la ++ if (project->isActiveConfig("create_libtool")) { + writeLibtoolFile(); + } + // pkg-config support +- if(project->isActiveConfig("create_pc") && project->first("TEMPLATE") == "lib") ++ if (project->isActiveConfig("create_pc")) + writePkgConfigFile(); + } + +@@ -1199,7 +1202,8 @@ void UnixMakefileGenerator::init2() + project->values("QMAKE_FRAMEWORK_VERSION").append(project->first("VER_MAJ")); + + if (project->first("TEMPLATE") == "aux") { +- // nothing ++ project->values("PRL_TARGET") = ++ project->values("TARGET").first().prepend(project->first("QMAKE_PREFIX_STATICLIB")); + } else if (!project->values("QMAKE_APP_FLAG").isEmpty()) { + if(!project->isEmpty("QMAKE_BUNDLE")) { + ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION"); +-- +cgit v1.2.1 + diff --git a/libqt5-qtbase.changes b/libqt5-qtbase.changes index 42b3237..c5b020f 100644 --- a/libqt5-qtbase.changes +++ b/libqt5-qtbase.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sun Aug 11 20:57:31 UTC 2019 - Stefan BrĂ¼ns + +- Fix qmake pkconfig generation, broken .pc files become apparent + when switching from pkg-config to pkgconf. (QTBUG-75901) + * 0001-Fix-meta-file-replacements-if-matches-are-empty.patch + * 0002-Do-not-write-Libs-into-.pc-files-if-TEMPLATE-is-not-.patch + * 0003-Make-sure-.pc-.prl-and-.la-files-are-created-for-hea.patch + ------------------------------------------------------------------- Wed Jul 3 18:57:26 UTC 2019 - Fabian Vogt diff --git a/libqt5-qtbase.spec b/libqt5-qtbase.spec index 26e10bc..39e3dd2 100644 --- a/libqt5-qtbase.spec +++ b/libqt5-qtbase.spec @@ -89,6 +89,12 @@ Patch1000: 0003-Add-an-ID-for-recognition-of-UGEE-tablets.patch Patch2000: 0001-Fix-notification-of-QDockWidget-when-it-gets-undocke.patch # Not accepted yet, https://codereview.qt-project.org/c/qt/qtbase/+/255384 Patch2001: 0002-Synthesize-Enter-LeaveEvent-for-accepted-QTabletEven.patch +# PATCH-FIX-UPSTREAM https://code.qt.io/cgit/qt/qtbase.git/patch/?id=60136b1a846ca5aedeb588edaa178927abb002ec -- https://bugreports.qt.io/browse/QTBUG-75901 +PATCH3000: 0001-Fix-meta-file-replacements-if-matches-are-empty.patch +# PATCH-FIX-UPSTREAM https://code.qt.io/cgit/qt/qtbase.git/patch/?id=c64f8ca232cc1f2131282d9eb6279ef9b565be88 -- https://bugreports.qt.io/browse/QTBUG-75901 +PATCH3001: 0002-Do-not-write-Libs-into-.pc-files-if-TEMPLATE-is-not-.patch +# PATCH-FIX-UPSTREAM https://code.qt.io/cgit/qt/qtbase.git/patch/?id=4da47d0fba04e5d50bf6b63e73bc0de986560f42 -- https://bugreports.qt.io/browse/QTBUG-75901 +PATCH3002: 0003-Make-sure-.pc-.prl-and-.la-files-are-created-for-hea.patch BuildRequires: alsa-devel BuildRequires: cups-devel BuildRequires: double-conversion-devel