vcpkg/ports/qt5/fix-commandline-overrides.patch

150 lines
5.4 KiB
Diff
Raw Normal View History

diff --git a/qtbase/configure.json b/qtbase/configure.json
index f774291..8903df0 100644
--- a/qtbase/configure.json
+++ b/qtbase/configure.json
@@ -19,8 +19,7 @@
"commandline": {
"assignments": {
"DBUS_HOST_PATH": "host_dbus.prefix",
- "DBUS_PATH": "dbus.prefix",
- "ZLIB_LIBS": "zlib.libs"
+ "DBUS_PATH": "dbus.prefix"
},
"custom": "qmakeArgs",
"options": {
diff --git a/qtbase/mkspecs/features/qt_configure.prf b/qtbase/mkspecs/features/qt_configure.prf
index eaaa161..fdec8ea 100644
--- a/qtbase/mkspecs/features/qt_configure.prf
+++ b/qtbase/mkspecs/features/qt_configure.prf
@@ -401,6 +401,7 @@ defineReplace(qtConfPrepareArgs) {
}
defineTest(qtConfSetupLibraries) {
+ asspfx = $${currentConfig}.commandline.assignments
for (l, $${currentConfig}.libraries._KEYS_) {
lpfx = $${currentConfig}.libraries.$${l}
# 'export' may be omitted, in which case it falls back to the library's name
@@ -408,6 +409,15 @@ defineTest(qtConfSetupLibraries) {
$${lpfx}.export = $$l
export($${lpfx}.export)
}
+ # 'export' may also be empty, but we need a derived identifier
+ alias = $$eval($${lpfx}.export)
+ isEmpty(alias): alias = $$l
+ $${lpfx}.alias = $$alias
+ export($${lpfx}.alias)
+ # make it easy to refer to the library by its export name.
+ $${currentConfig}.exports._KEYS_ += $$alias
+ $${currentConfig}.exports.$$alias += $$l
+ export($${currentConfig}.exports.$$alias)
isEmpty($${lpfx}.sources._KEYS_): \
error("Library $$l defines no sources")
for (s, $${lpfx}.sources._KEYS_) {
@@ -427,10 +437,35 @@ defineTest(qtConfSetupLibraries) {
}
}
}
+
+ $${currentConfig}.exports._KEYS_ = $$unique($${currentConfig}.exports._KEYS_)
+ export($${currentConfig}.exports._KEYS_)
+
+ for (alias, $${currentConfig}.exports._KEYS_) {
+ ua = $$upper($$alias)
+ $${asspfx}._KEYS_ += \
+ $${ua}_PREFIX $${ua}_INCDIR $${ua}_LIBDIR \
+ $${ua}_LIBS $${ua}_LIBS_DEBUG $${ua}_LIBS_RELEASE
+ uapfx = $${asspfx}.$${ua}
+ $${uapfx}_PREFIX = $${alias}.prefix
+ $${uapfx}_INCDIR = $${alias}.incdir
+ $${uapfx}_LIBDIR = $${alias}.libdir
+ $${uapfx}_LIBS = $${alias}.libs
+ $${uapfx}_LIBS_DEBUG = $${alias}.libs.debug
+ $${uapfx}_LIBS_RELEASE = $${alias}.libs.release
+ export($${uapfx}_PREFIX)
+ export($${uapfx}_INCDIR)
+ export($${uapfx}_LIBDIR)
+ export($${uapfx}_LIBS)
+ export($${uapfx}_LIBS_DEBUG)
+ export($${uapfx}_LIBS_RELEASE)
+ }
+ export($${asspfx}._KEYS_)
+
# reverse mapping for assignments on command line.
- for (a, $${currentConfig}.commandline.assignments._KEYS_) {
- apfx = $${currentConfig}.commandline.assignments.$${a}
+ for (a, $${asspfx}._KEYS_) {
+ apfx = $${asspfx}.$${a}
ra = config.commandline.rev_assignments.$$eval($$apfx)
$$ra = $$a
export($$ra)
@@ -479,6 +514,18 @@ defineTest(qtConfLibrary_inline) {
export($${1}.libs)
}
+ incdir = $$val_escape(config.input.$${input}.incdir)
+ !isEmpty(incdir) {
+ $${1}.includedir = $$incdir
+ export($${1}.includedir)
+ }
+
+ libdir = $$val_escape(config.input.$${input}.libdir)
+ !isEmpty(libdir) {
+ $${1}.libs = "-L$$libdir $$eval($${1}.libs)"
+ export($${1}.libs)
+ }
+
return(true)
}
diff --git a/qtbase/src/gui/configure.json b/qtbase/src/gui/configure.json
index 1f50116..af03362 100644
--- a/qtbase/src/gui/configure.json
+++ b/qtbase/src/gui/configure.json
@@ -100,7 +100,7 @@
"test": "unix/freetype",
"sources": [
{ "type": "pkgConfig", "args": "freetype2" },
- { "type": "freetype", "libs": "-lfreetype" }
+ { "libs": "-lfreetype" }
]
},
"fontconfig": {
diff --git a/qtbase/src/network/configure.json b/qtbase/src/network/configure.json
index 1e08aa7..314970e 100644
--- a/qtbase/src/network/configure.json
+++ b/qtbase/src/network/configure.json
@@ -7,9 +7,6 @@
"commandline": {
"assignments": {
- "OPENSSL_LIBS": "openssl.libs",
- "OPENSSL_LIBS_DEBUG": "openssl.libs.debug",
- "OPENSSL_LIBS_RELEASE": "openssl.libs.release",
"OPENSSL_PATH": "openssl.prefix"
},
"options": {
diff --git a/qtbase/src/sql/configure.json b/qtbase/src/sql/configure.json
index 96c82e8..51a7e51 100644
--- a/qtbase/src/sql/configure.json
+++ b/qtbase/src/sql/configure.json
@@ -8,7 +8,6 @@
"commandline": {
"assignments": {
"MYSQL_PATH": "mysql.prefix",
- "PSQL_LIBS": "psql.libs",
"SYBASE": "tds.prefix",
"SYBASE_LIBS": "tds.libs"
},
@@ -71,8 +70,8 @@
"sources": [
{ "type": "pkgConfig", "args": "libpq" },
{ "type": "psqlConfig" },
- { "type": "psqlEnv", "libs": "-llibpq -lws2_32 -ladvapi32", "condition": "config.win32" },
- { "type": "psqlEnv", "libs": "-lpq", "condition": "!config.win32" }
+ { "libs": "-llibpq -lws2_32 -ladvapi32", "condition": "config.win32" },
+ { "libs": "-lpq", "condition": "!config.win32" }
]
},
"tds": {