diff options
| author | Barath Kannan <barathsotd@gmail.com> | 2018-01-18 10:02:56 +1100 |
|---|---|---|
| committer | Barath Kannan <barathsotd@gmail.com> | 2018-01-18 10:02:56 +1100 |
| commit | ca9ff199d6024fa0ef26abcba920928215d77f38 (patch) | |
| tree | 090368bba576081970d8481628a8fea4ceda9433 /ports/qt5-base | |
| parent | c30363d07b3f64b5f38531442ea92d9c1cf81d13 (diff) | |
| download | vcpkg-ca9ff199d6024fa0ef26abcba920928215d77f38.tar.gz vcpkg-ca9ff199d6024fa0ef26abcba920928215d77f38.zip | |
append hyphen to qt5 module names
Diffstat (limited to 'ports/qt5-base')
| -rw-r--r-- | ports/qt5-base/CONTROL | 4 | ||||
| -rw-r--r-- | ports/qt5-base/configure_qt.cmake | 64 | ||||
| -rw-r--r-- | ports/qt5-base/fix-system-pcre2.patch | 18 | ||||
| -rw-r--r-- | ports/qt5-base/fixcmake.py | 68 | ||||
| -rw-r--r-- | ports/qt5-base/install_qt.cmake | 46 | ||||
| -rw-r--r-- | ports/qt5-base/portfile.cmake | 114 | ||||
| -rw-r--r-- | ports/qt5-base/qt_debug.conf | 13 | ||||
| -rw-r--r-- | ports/qt5-base/qt_release.conf | 13 |
8 files changed, 340 insertions, 0 deletions
diff --git a/ports/qt5-base/CONTROL b/ports/qt5-base/CONTROL new file mode 100644 index 000000000..f2a507e19 --- /dev/null +++ b/ports/qt5-base/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-base +Version: 5.9.2-0 +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 diff --git a/ports/qt5-base/configure_qt.cmake b/ports/qt5-base/configure_qt.cmake new file mode 100644 index 000000000..1d4f1e570 --- /dev/null +++ b/ports/qt5-base/configure_qt.cmake @@ -0,0 +1,64 @@ +function(configure_qt) + cmake_parse_arguments(_csc "" "SOURCE_PATH;PLATFORM" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) + + if (_csc_PLATFORM) + set(PLATFORM ${_csc_PLATFORM}) + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v140") + set(PLATFORM "win32-msvc2015") + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(PLATFORM "win32-msvc2017") + endif() + + vcpkg_find_acquire_program(PERL) + get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) + + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}") + + if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) + list(APPEND _csc_OPTIONS + "-static" + "-static-runtime" + ) + endif() + + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + vcpkg_execute_required_process( + COMMAND "${_csc_SOURCE_PATH}/configure.bat" ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} + -debug + -prefix ${CURRENT_PACKAGES_DIR}/debug + -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 + -platform ${PLATFORM} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + vcpkg_execute_required_process( + COMMAND "${_csc_SOURCE_PATH}/configure.bat" ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} + -release + -prefix ${CURRENT_PACKAGES_DIR} + -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 ${PLATFORM} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + +endfunction()
\ No newline at end of file diff --git a/ports/qt5-base/fix-system-pcre2.patch b/ports/qt5-base/fix-system-pcre2.patch new file mode 100644 index 000000000..be401d448 --- /dev/null +++ b/ports/qt5-base/fix-system-pcre2.patch @@ -0,0 +1,18 @@ +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 @@ + ] + }, + "sources": [ +- "-lpcre2-16" ++ { ++ "builds": { ++ "debug": "-lpcre2-16d", ++ "release": "-lpcre2-16" ++ } ++ } + ] + }, + "pps": { diff --git a/ports/qt5-base/fixcmake.py b/ports/qt5-base/fixcmake.py new file mode 100644 index 000000000..bcfb12ac5 --- /dev/null +++ b/ports/qt5-base/fixcmake.py @@ -0,0 +1,68 @@ +import os +import re +from glob import glob + +files = [y for x in os.walk('.') for y in glob(os.path.join(x[0], '*.cmake'))] + +for f in files: + openedfile = open(f, "r") + builder = "" + dllpattern = re.compile("_install_prefix}/bin/Qt5.*d.dll") + libpattern = re.compile("_install_prefix}/lib/Qt5.*d.lib") + exepattern = re.compile("_install_prefix}/bin/[a-z]+.exe") + tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") + for line in openedfile: + if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line.replace("/tools/qt5/", "/bin/") + builder += " else()" + builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") + builder += " endif()\n" + elif "_install_prefix}/bin/${LIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/bin/", "/debug/bin/") + builder += " endif()\n" + elif "_install_prefix}/lib/${LIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/lib/", "/debug/lib/") + builder += " endif()\n" + elif "_install_prefix}/lib/${IMPLIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/lib/", "/debug/lib/") + builder += " endif()\n" + elif "_install_prefix}/plugins/${PLUGIN_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/plugins/", "/debug/plugins/") + builder += " endif()\n" + elif "_install_prefix}/lib/qtmaind.lib" in line: + # qtmaind.lib has been moved to manual-link: + builder += line.replace("/lib/", "/debug/lib/manual-link/") + elif "_install_prefix}/lib/qtmain.lib" in line: + # qtmain(d).lib has been moved to manual-link: + builder += line.replace("/lib/", "/lib/manual-link/") + builder += " set(imported_location_debug \"${_qt5Core_install_prefix}/debug/lib/manual-link/qtmaind.lib\")\n" + builder += "\n" + builder += " set_target_properties(Qt5::WinMain PROPERTIES\n" + builder += " IMPORTED_LOCATION_DEBUG ${imported_location_debug}\n" + builder += " )\n" + elif dllpattern.search(line) != None: + builder += line.replace("/bin/", "/debug/bin/") + elif libpattern.search(line) != None: + builder += line.replace("/lib/", "/debug/lib/") + elif tooldllpattern.search(line) != None: + builder += line.replace("/tools/qt5/", "/debug/bin/") + elif exepattern.search(line) != None: + builder += line.replace("/bin/", "/tools/qt5/") + else: + builder += line + new_file = open(f, "w") + new_file.write(builder) + new_file.close()
\ No newline at end of file diff --git a/ports/qt5-base/install_qt.cmake b/ports/qt5-base/install_qt.cmake new file mode 100644 index 000000000..37528e4e6 --- /dev/null +++ b/ports/qt5-base/install_qt.cmake @@ -0,0 +1,46 @@ +function(install_qt) + cmake_parse_arguments(_bc "DISABLE_PARALLEL" "" "" ${ARGN}) + + if (_bc_DISABLE_PARALLEL) + set(JOBS "1") + else() + set(JOBS "$ENV{NUMBER_OF_PROCESSORS}") + endif() + + vcpkg_find_acquire_program(JOM) + vcpkg_find_acquire_program(PYTHON3) + get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) + set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") + set(_path "$ENV{PATH}") + + message(STATUS "Package ${TARGET_TRIPLET}-dbg") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/bin;${_path}") + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME build-${TARGET_TRIPLET}-dbg + ) + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} install + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME package-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Package ${TARGET_TRIPLET}-dbg done") + + message(STATUS "Package ${TARGET_TRIPLET}-rel") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/bin;${_path}") + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME build-${TARGET_TRIPLET}-rel + ) + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} install + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME package-${TARGET_TRIPLET}-rel + ) + message(STATUS "Package ${TARGET_TRIPLET}-rel done") + + set(ENV{PATH} "${_path}") + +endfunction()
\ No newline at end of file diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake new file mode 100644 index 000000000..bde933392 --- /dev/null +++ b/ports/qt5-base/portfile.cmake @@ -0,0 +1,114 @@ +include(vcpkg_common_functions) + +string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) +if(BUILDTREES_PATH_LENGTH GREATER 37) + message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" + "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." + ) +endif() + +if(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(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 +) +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() + +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-system-pcre2.patch" +) + +# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings +set(ENV{_CL_} "/utf-8") + +configure_qt( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -confirm-license + -opensource + -system-zlib + -system-libjpeg + -system-libpng + -system-freetype + -system-pcre + -system-harfbuzz + -system-doubleconversion + -system-sqlite + -sql-sqlite + -sql-psql + -feature-freetype + -nomake examples -nomake tests + -opengl desktop # other options are "-no-opengl" and "-opengl angle" + -mp + LIBJPEG_LIBS="-ljpeg" + OPTIONS_RELEASE + ZLIB_LIBS="-lzlib" + LIBPNG_LIBS="-llibpng16" + OPTIONS_DEBUG + ZLIB_LIBS="-lzlibd" + LIBPNG_LIBS="-llibpng16d" + PSQL_LIBS="-llibpqd" + FREETYPE_LIBS="-lfreetyped" +) + +install_qt() + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") +file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) +file(REMOVE ${BINARY_TOOLS}) +file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe") +file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/qt5) +file(REMOVE ${BINARY_TOOLS}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/qt_debug.conf ${CMAKE_CURRENT_LIST_DIR}/qt_release.conf DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/cmake + LOGNAME fix-cmake +) + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/qt5) + +#--------------------------------------------------------------------------- +# qtmain(d) vs. Qt5AxServer(d) +#--------------------------------------------------------------------------- +# Qt applications have to either link to qtmain(d) or to Qt5AxServer(d), +# never both. See http://doc.qt.io/qt-5/activeqt-server.html for more info. +# +# Create manual-link folders: +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +# +# Either have users explicitly link against qtmain.lib, qtmaind.lib: +file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib) +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +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) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/qt5-base/qt_debug.conf b/ports/qt5-base/qt_debug.conf new file mode 100644 index 000000000..1314d00b9 --- /dev/null +++ b/ports/qt5-base/qt_debug.conf @@ -0,0 +1,13 @@ +[Paths] +Prefix = ${CURRENT_INSTALLED_DIR} +Documentation = share/qt5/doc +Headers = include +Libraries = debug/lib +Binaries = debug/tools/qt5 +LibraryExecutables = debug/tools/qt5 +Plugins = debug/plugins +Qml2Imports = qml +Data = share/qt5/debug +ArchData = share/qt5/debug +HostData = share/qt5/debug +HostBinaries = debug/tools/qt5
\ No newline at end of file diff --git a/ports/qt5-base/qt_release.conf b/ports/qt5-base/qt_release.conf new file mode 100644 index 000000000..a04aef525 --- /dev/null +++ b/ports/qt5-base/qt_release.conf @@ -0,0 +1,13 @@ +[Paths] +Prefix = ${CURRENT_INSTALLED_DIR} +Documentation = share/qt5/doc +Headers = include +Libraries = lib +Binaries = tools/qt5 +LibraryExecutables = tools/qt5 +Plugins = plugins +Qml2Imports = qml +Data = share/qt5 +ArchData = share/qt5 +HostData = share/qt5 +HostBinaries = tools/qt5
\ No newline at end of file |
