Skip to content

Commit

Permalink
Qt 5.11 and static build fixes (#4164)
Browse files Browse the repository at this point in the history
* fix da qt5

* fix qt config duplication

* [qt5-base] Use vcpkg_extract_source_archive_ex
[sqlite3] Enable SQLITE_ENABLE_COLUMN_METADATA

* [qt5-*] Update sub-portfiles

* qt5-base WIP

* [qt5] Fix Could not find qmlcachegen.exe

* [qt5-activeqt] Fix SHA512

* [qt5-base] Fix static builds

* [qt5-base] Bump control version

* [qt5-base] Restore removal of qmake dependencies

* [qt5-base] Partially revert #3280

* [qt5-base][vcpkg_build_qmake] Fix Qt5Bootstrap.lib issues
  • Loading branch information
RobertBColton authored and ras0219-msft committed Oct 22, 2018
1 parent cba23fe commit 473d63c
Show file tree
Hide file tree
Showing 56 changed files with 176 additions and 190 deletions.
2 changes: 1 addition & 1 deletion ports/qscintilla/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qscintilla
Version: 2.10-4
Version: 2.10-5
Description: QScintilla is a port to Qt of the Scintilla editing component. Features syntax highlighting, code-completion and much more (Barebone build without python bindings (missing dependeny PyQt) and without QtDesigner plugin)
Build-Depends: qt5-base
2 changes: 1 addition & 1 deletion ports/qt5-3d/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-3d
Version: 5.9.2-0
Version: 5.11.1
Description: Qt5 3d Module - Functionality for near-realtime simulation systems with support for 2D and 3D rendering
Build-Depends: qt5-modularscripts, qt5-base, qt5-declarative
2 changes: 1 addition & 1 deletion ports/qt5-3d/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ include(vcpkg_common_functions)

include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake)

qt_modular_library(qt3d 1c7dbd4e557cdd183ec6e929aae5727ce2ffcb519517942b588594bb81a78cb3d732cde4dae58085a70ec2968a8c2443eae96536125c25938222ff7c89f4f9a2)
qt_modular_library(qt3d d1a07586d6b64ff3b1e85c41c8b3b86f6327e9e63f5f45344a65a6136179f6a8361ca9da80944b244d8edc53d8b0e9f8b646d613f6b42faac6cb724f49573a8a)
2 changes: 1 addition & 1 deletion ports/qt5-activeqt/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-activeqt
Version: 5.9.2-0
Version: 5.11.1
Description: Qt5 ActiveQt Module - ActiveX components
Build-Depends: qt5-modularscripts, qt5-base
2 changes: 1 addition & 1 deletion ports/qt5-activeqt/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ include(vcpkg_common_functions)

include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake)

qt_modular_library(qtactiveqt c013e5cba0b11af88161d3cad21923c4b3bf04b0905e5b0c527c1984806d0eb39f31322ff464b139f5d36b5c9f4afefe70492fc1e1f0e964e6e0eaa3f6edaaf9)
qt_modular_library(qtactiveqt a6fb4a3a53f5965e0913276a784f2fce81351a9c54cc190f15b431a497e04a4b823a8cec132713e382dc4e3ab2edef967e920c7aaa7392a72d7b12263c9f4876)

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools/qt5-activeqt/platforminputcontexts)
2 changes: 1 addition & 1 deletion ports/qt5-base/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-base
Version: 5.9.2-7
Version: 5.11.1-2
Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.
Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl
20 changes: 10 additions & 10 deletions ports/qt5-base/configure_qt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ function(configure_qt)
-debug
-prefix ${CURRENT_INSTALLED_DIR}/debug
-extprefix ${CURRENT_PACKAGES_DIR}/debug
-hostbindir ${CURRENT_INSTALLED_DIR}/debug/tools/qt5
-archdatadir ${CURRENT_INSTALLED_DIR}/share/qt5/debug
-datadir ${CURRENT_INSTALLED_DIR}/share/qt5/debug
-plugindir ${CURRENT_INSTALLED_DIR}/debug/plugins
-qmldir ${CURRENT_INSTALLED_DIR}/debug/qml
-hostbindir ${CURRENT_PACKAGES_DIR}/debug/tools/qt5
-archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5/debug
-datadir ${CURRENT_PACKAGES_DIR}/share/qt5/debug
-plugindir ${CURRENT_PACKAGES_DIR}/debug/plugins
-qmldir ${CURRENT_PACKAGES_DIR}/debug/qml
-headerdir ${CURRENT_PACKAGES_DIR}/include
-I ${CURRENT_INSTALLED_DIR}/include
-L ${CURRENT_INSTALLED_DIR}/debug/lib
Expand All @@ -53,11 +53,11 @@ function(configure_qt)
-release
-prefix ${CURRENT_INSTALLED_DIR}
-extprefix ${CURRENT_PACKAGES_DIR}
-hostbindir ${CURRENT_INSTALLED_DIR}/tools/qt5
-archdatadir ${CURRENT_INSTALLED_DIR}/share/qt5
-datadir ${CURRENT_INSTALLED_DIR}/share/qt5
-plugindir ${CURRENT_INSTALLED_DIR}/plugins
-qmldir ${CURRENT_INSTALLED_DIR}/qml
-hostbindir ${CURRENT_PACKAGES_DIR}/tools/qt5
-archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5
-datadir ${CURRENT_PACKAGES_DIR}/share/qt5
-plugindir ${CURRENT_PACKAGES_DIR}/plugins
-qmldir ${CURRENT_PACKAGES_DIR}/qml
-I ${CURRENT_INSTALLED_DIR}/include
-L ${CURRENT_INSTALLED_DIR}/lib
-platform ${_csc_PLATFORM}
Expand Down
56 changes: 0 additions & 56 deletions ports/qt5-base/fix-C3615.patch

This file was deleted.

27 changes: 27 additions & 0 deletions ports/qt5-base/fix-msvc2017.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff -Naur a/mkspecs/common/msvc-version.conf b/mkspecs/common/msvc-version.conf
--- a/mkspecs/common/msvc-version.conf 2018-06-15 03:29:31.000000000 -0400
+++ b/mkspecs/common/msvc-version.conf 2018-08-23 00:26:46.436806400 -0400
@@ -112,4 +112,11 @@
COMPAT_MKSPEC =
}

+
+# MSVC 2017 15.8+ fixed std::aligned_storage but compilation fails without
+# this flag since the fix breaks binary compatibility.
+greaterThan(QMAKE_MSC_VER, 1914) {
+ DEFINES += _ENABLE_EXTENDED_ALIGNED_STORAGE
+}
+
!isEmpty(COMPAT_MKSPEC):!$$COMPAT_MKSPEC: CONFIG += $$COMPAT_MKSPEC
diff -Naur a/qmake/Makefile.win32 b/qmake/Makefile.win32
--- a/qmake/Makefile.win32 2018-06-15 03:29:31.000000000 -0400
+++ b/qmake/Makefile.win32 2018-08-23 00:27:45.764849600 -0400
@@ -39,7 +39,7 @@
-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS \
-DQT_VERSION_STR=\"$(QT_VERSION)\" -DQT_VERSION_MAJOR=$(QT_MAJOR_VERSION) -DQT_VERSION_MINOR=$(QT_MINOR_VERSION) -DQT_VERSION_PATCH=$(QT_PATCH_VERSION) \
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \
- -DQT_NO_FOREACH -DUNICODE
+ -DQT_NO_FOREACH -DUNICODE -D_ENABLE_EXTENDED_ALIGNED_STORAGE
CFLAGS = $(CFLAGS_PCH) $(CFLAGS_BARE) $(CFLAGS)

CXXFLAGS_BARE = $(CFLAGS_BARE)
33 changes: 16 additions & 17 deletions ports/qt5-base/fix-system-pcre2-linux.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
index a5a1b66..5a48a05 100644
--- a/src/corelib/configure.json
+++ b/src/corelib/configure.json
@@ -163,8 +163,10 @@
"builds": {
"debug": "-lpcre2-16d",
"release": "-lpcre2-16"
- }
- }
+ },
+ "condition": "config.win32"
+ },
+ { "libs": "-lpcre2-16", "condition": "!config.win32" }
]
},
"pps": {
diff -Naur a/src/corelib/configure.json b/src/corelib/configure.json
--- a/src/corelib/configure.json 2018-08-23 02:58:54.544949500 -0400
+++ b/src/corelib/configure.json 2018-08-23 02:59:31.481175300 -0400
@@ -181,8 +181,10 @@
"builds": {
"debug": "-lpcre2-16d",
"release": "-lpcre2-16"
- }
- }
+ },
+ "condition": "config.win32"
+ },
+ { "libs": "-lpcre2-16", "condition": "!config.win32" }
]
},
"pps": {
11 changes: 5 additions & 6 deletions ports/qt5-base/fix-system-pcre2.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
index a5b69a2..01c5cde 100644
--- a/src/corelib/configure.json
+++ b/src/corelib/configure.json
@@ -159,7 +159,12 @@
]
diff -Naur a/src/corelib/configure.json b/src/corelib/configure.json
--- a/src/corelib/configure.json 2018-06-15 03:29:31.000000000 -0400
+++ b/src/corelib/configure.json 2018-08-23 00:46:04.380187100 -0400
@@ -177,7 +177,12 @@
},
"sources": [
{ "type": "pkgConfig", "args": "libpcre2-16" },
- "-lpcre2-16"
+ {
+ "builds": {
Expand Down
80 changes: 44 additions & 36 deletions ports/qt5-base/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,39 @@ if(BUILDTREES_PATH_LENGTH GREATER 37 AND CMAKE_HOST_WIN32)
)
endif()

if((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") AND VCPKG_LIBRARY_LINKAGE STREQUAL static)
message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.")
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
include(configure_qt)
include(install_qt)

set(SRCDIR_NAME "qtbase-5.9.2")
set(ARCHIVE_NAME "qtbase-opensource-src-5.9.2")
set(ARCHIVE_EXTENSION ".tar.xz")
set(MAJOR_MINOR 5.11)
set(FULL_VERSION ${MAJOR_MINOR}.1)
set(ARCHIVE_NAME "qtbase-everywhere-src-${FULL_VERSION}.tar.xz")

set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME})
vcpkg_download_distfile(ARCHIVE_FILE
URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}"
FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION}
SHA512 a2f965871645256f3d019f71f3febb875455a29d03fccc7a3371ddfeb193b0af12394e779df05adf69fd10fe7b0d966f3915a24528ec7eb3bc36c2db6af2b6e7
URLS "http://download.qt.io/official_releases/qt/${MAJOR_MINOR}/${FULL_VERSION}/submodules/${ARCHIVE_NAME}"
FILENAME ${ARCHIVE_NAME}
SHA512 5f45405872e541565d811c1973ae95b0f19593f4495375306917b72e21146e14fe8f7db5fbd629476476807f89ef1679aa59737ca5efdd9cbe6b14d7aa371b81
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE "${ARCHIVE_FILE}"
REF ${FULL_VERSION}
PATCHES
fix-system-freetype.patch
fix-system-pcre2.patch
fix-system-pcre2-linux.patch
fix-msvc2017.patch
)
vcpkg_extract_source_archive(${ARCHIVE_FILE})
if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME})
file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME})
endif()

# Remove vendored dependencies to ensure they are not picked up by the build
foreach(DEPENDENCY freetype zlib harfbuzzng libjpeg libpng double-conversion)
foreach(DEPENDENCY freetype zlib harfbuzzng libjpeg libpng double-conversion sqlite)
if(EXISTS ${SOURCE_PATH}/src/3rdparty/${DEPENDENCY})
file(REMOVE_RECURSE ${SOURCE_PATH}/src/3rdparty/${DEPENDENCY})
endif()
endforeach()

file(REMOVE_RECURSE ${SOURCE_PATH}/include/QtZlib)

vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/fix-system-pcre2.patch"
"${CMAKE_CURRENT_LIST_DIR}/fix-system-freetype.patch"
"${CMAKE_CURRENT_LIST_DIR}/fix-system-pcre2-linux.patch"
"${CMAKE_CURRENT_LIST_DIR}/fix-C3615.patch"
)

# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings
set(ENV{_CL_} "/utf-8")

Expand All @@ -61,39 +53,46 @@ set(CORE_OPTIONS
-system-pcre
-system-harfbuzz
-system-doubleconversion
-system-sqlite
-no-fontconfig
-nomake examples -nomake tests
-nomake examples
-nomake tests
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
list(APPEND CORE_OPTIONS
-static
)
else()
list(APPEND CORE_OPTIONS
-sql-sqlite
-sql-psql
)
endif()

if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
if(VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(PLATFORM "win32-msvc2015")
elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(PLATFORM "win32-msvc2017")
elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v120")
set(PLATFORM "win32-msvc2013")
endif()
set(PLATFORM "win32-msvc")

configure_qt(
SOURCE_PATH ${SOURCE_PATH}
PLATFORM ${PLATFORM}
OPTIONS
${CORE_OPTIONS}
-sql-sqlite
-sql-psql
-system-sqlite
-mp
-opengl desktop # other options are "-no-opengl", "-opengl angle", and "-opengl desktop"
LIBJPEG_LIBS="-ljpeg"
OPTIONS_RELEASE
ZLIB_LIBS="-lzlib"
LIBPNG_LIBS="-llibpng16"
FREETYPE_LIBS="-lfreetype"
PSQL_LIBS="-llibpq"
OPTIONS_DEBUG
ZLIB_LIBS="-lzlibd"
LIBPNG_LIBS="-llibpng16d"
PSQL_LIBS="-llibpqd"
FREETYPE_LIBS="-lfreetyped"
)

elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
configure_qt(
SOURCE_PATH ${SOURCE_PATH}
Expand Down Expand Up @@ -168,6 +167,15 @@ if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib)
file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl)

#---------------------------------------------------------------------------
# Qt5Bootstrap: only used to bootstrap qmake dependencies
#---------------------------------------------------------------------------
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.lib)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.prl)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/Qt5Bootstrap.lib ${CURRENT_PACKAGES_DIR}/tools/qt5/Qt5Bootstrap.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/Qt5Bootstrap.prl ${CURRENT_PACKAGES_DIR}/tools/qt5/Qt5Bootstrap.prl)
#---------------------------------------------------------------------------
endif()

file(GLOB_RECURSE PRL_FILES "${CURRENT_PACKAGES_DIR}/lib/*.prl" "${CURRENT_PACKAGES_DIR}/debug/lib/*.prl")
Expand Down
2 changes: 1 addition & 1 deletion ports/qt5-charts/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-charts
Version: 5.9.2-0
Version: 5.11.1
Description: Qt5 Charts Module - UI components for displaying charts, driven by static or dynamic data models
Build-Depends: qt5-modularscripts, qt5-base
2 changes: 1 addition & 1 deletion ports/qt5-charts/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ include(vcpkg_common_functions)

include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake)

qt_modular_library(qtcharts 297547b565dd71b05237bb05ecc1abf1a774a4909668417e78bd65e805c1e47a456a5a06898fe06d4c4614118e4129e19893d4c77598667a9354ab969307a293)
qt_modular_library(qtcharts e3c02ea9bd985a8d051e305dd04e58711de3b666128a695011afd65271a2c7bcb11763c18fe201045ce03df96326490ca7322bdc0f77e97988ec59427505886b)
2 changes: 1 addition & 1 deletion ports/qt5-datavis3d/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-datavis3d
Version: 5.9.2-0
Version: 5.11.1
Description: Qt5 Data Visualization 3d Module - UI Components for creating 3D data visualizations
Build-Depends: qt5-modularscripts, qt5-base
2 changes: 1 addition & 1 deletion ports/qt5-datavis3d/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ include(vcpkg_common_functions)

include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake)

qt_modular_library(qtdatavis3d 5f173401ba2f0ebb4bbb1ff65053f1ece44a97a8bf1d9fc8d81540709c588e140c533d5f317d6a9109d538e38aa742d42bf00906f63d433811bc1c8526788dc3)
qt_modular_library(qtdatavis3d e88f2471fa39fd4f4c7900df5edadc568d000b537eb00f892fadc6cf1d7845987b9fd98adbea4c35c6469c9a9bfce087b26440a6419ca758451dbe3b669d19cd)
2 changes: 1 addition & 1 deletion ports/qt5-declarative/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-declarative
Version: 5.9.2-0
Version: 5.11.1
Description: Qt5 Declarative (Quick 2) Module. Includes QtQuick, QtQuickParticles, QtQuickWidgets, QtQml, and QtPacketProtocol.
Build-Depends: qt5-modularscripts, qt5-base
4 changes: 2 additions & 2 deletions ports/qt5-declarative/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ include(vcpkg_common_functions)

include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake)

qt_modular_library(qtdeclarative 49b8b50932b73ea39da14ac3425044193dfd64eabceadba379aa01cf2fc141177f9870c387caf1cf93ce09e8b197828a54b8d9fcefc4d9cdf400a6c6dd9a9e90)
qt_modular_library(qtdeclarative d4252f58fcc811273b1a51f80167bca19f744d70c47362b631bbb7875473a808402d64b26475e2f5ff1813d8b8cc66b81cac1b8a4b5e36f7ca1fdbb15666f053)

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools/qt5-declarative/platforminputcontexts)
#file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools/qt5-declarative/platforminputcontexts)
2 changes: 1 addition & 1 deletion ports/qt5-gamepad/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-gamepad
Version: 5.9.2-0
Version: 5.11.1
Description: Qt5 Gamepad Module - Enables Qt applications to support the use of gamepad hardware
Build-Depends: qt5-modularscripts, qt5-base
2 changes: 1 addition & 1 deletion ports/qt5-gamepad/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ include(vcpkg_common_functions)

include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake)

qt_modular_library(qtgamepad 398d6ff0268460358584a4ea8ba0588881970dcc1dff6c5aa91d1630065ba112c86d7a1fe96dceb8ff301b350aef7f74ad1ee6212048a4cdfb26ff5d944d6222)
qt_modular_library(qtgamepad 47dfe1fdd693300520f9710d0a161936d8f1805b4558d6f692ed204f8d6784d45adb73bd472fb255deed792a610c94b35a72143deb0d8f227b8a9996dd1703cc)
Loading

0 comments on commit 473d63c

Please sign in to comment.