File qt5-workaround-pkgconfig-install-issue.patch of Package mingw32-libqt5-qtbase
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index bf9a9d8..fc098a3 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3099,7 +3099,7 @@ MakefileGenerator::openOutput(QFile &file, const QString &build) const
}
QString
-MakefileGenerator::pkgConfigFileName(bool fixify)
+MakefileGenerator::pkgConfigFileName(bool fixify, bool onlyPrependDestdir)
{
QString ret = project->first("QMAKE_PKGCONFIG_FILE").toQString();
if (ret.isEmpty()) {
@@ -3124,7 +3124,11 @@ MakefileGenerator::pkgConfigFileName(bool fixify)
if(fixify) {
if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR"))
ret.prepend(project->first("DESTDIR").toQString());
- ret = Option::fixPathToLocalOS(fileFixify(ret, qmake_getpwd(), Option::output_dir));
+ if (onlyPrependDestdir) {
+ ret = Option::fixPathToLocalOS(ret);
+ } else {
+ ret = Option::fixPathToLocalOS(fileFixify(ret, qmake_getpwd(), Option::output_dir));
+ }
}
return ret;
}
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 672ba87..06d3837 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -102,7 +102,7 @@ protected:
virtual void writeDefaultVariables(QTextStream &t);
QString pkgConfigPrefix() const;
- QString pkgConfigFileName(bool fixify=true);
+ QString pkgConfigFileName(bool fixify=true, bool onlyPrependDestdir = false);
QString pkgConfigFixPath(QString) const;
void writePkgConfigFile(); // for pkg-config
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 81bc16a..785cd76 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -839,7 +839,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
}
if(!ret.isEmpty())
ret += "\n\t";
- ret += installMetaFile(ProKey("QMAKE_PKGCONFIG_INSTALL_REPLACE"), pkgConfigFileName(true), dst_pc);
+ ret += installMetaFile(ProKey("QMAKE_PKGCONFIG_INSTALL_REPLACE"), pkgConfigFileName(true, true), dst_pc);
if(!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) \"" + dst_pc + "\"");