From a2d8a7cbb15cac91d6c59cd967ef9d85105832c3 Mon Sep 17 00:00:00 2001 From: talregev Date: Thu, 2 Jun 2022 03:13:53 +0300 Subject: [PATCH] [fontconfig][freetds][qtwebengine] Take gperf from vcpkg (#24677) * Take gperf from vcpkg tool if possible * [gperf] Install binary into tools/gperf/ * Fix kf5codecs gperf bug * Add PREPEND to freetds port * fix gperf for qtwebengine * make gperf modern port Co-authored-by: Robert Schumacher --- ports/fontconfig/portfile.cmake | 4 +--- ports/fontconfig/vcpkg.json | 6 +++++- ports/freetds/portfile.cmake | 10 +--------- ports/freetds/vcpkg.json | 5 +++++ ports/gperf/portfile.cmake | 6 +++--- ports/gperf/vcpkg.json | 14 ++++++++++++-- ports/kf5codecs/portfile.cmake | 4 +--- ports/kf5codecs/vcpkg.json | 1 + ports/proxygen/portfile.cmake | 11 +---------- ports/proxygen/vcpkg.json | 6 +++++- ports/qtwebengine/portfile.cmake | 6 +++--- ports/qtwebengine/vcpkg.json | 6 +++++- versions/baseline.json | 12 ++++++------ versions/f-/fontconfig.json | 5 +++++ versions/f-/freetds.json | 5 +++++ versions/g-/gperf.json | 5 +++++ versions/k-/kf5codecs.json | 5 +++++ versions/p-/proxygen.json | 5 +++++ versions/q-/qtwebengine.json | 5 +++++ 19 files changed, 79 insertions(+), 42 deletions(-) diff --git a/ports/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake index f8f1d1f1c5..da4002236c 100644 --- a/ports/fontconfig/portfile.cmake +++ b/ports/fontconfig/portfile.cmake @@ -12,9 +12,7 @@ vcpkg_from_gitlab( libgetopt.patch ) -vcpkg_find_acquire_program(GPERF) -get_filename_component(GPERF_PATH ${GPERF} DIRECTORY) -vcpkg_add_to_path(${GPERF_PATH}) +vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/gperf") vcpkg_configure_meson( SOURCE_PATH ${SOURCE_PATH} diff --git a/ports/fontconfig/vcpkg.json b/ports/fontconfig/vcpkg.json index 28a77f62e1..7631fae573 100644 --- a/ports/fontconfig/vcpkg.json +++ b/ports/fontconfig/vcpkg.json @@ -1,7 +1,7 @@ { "name": "fontconfig", "version": "2.14.0", - "port-version": 1, + "port-version": 2, "description": "Library for configuring and customizing font access.", "homepage": "https://www.freedesktop.org/wiki/Software/fontconfig", "license": "MIT", @@ -11,6 +11,10 @@ "freetype", "getopt", "gettext", + { + "name": "gperf", + "host": true + }, "libiconv", { "name": "libuuid", diff --git a/ports/freetds/portfile.cmake b/ports/freetds/portfile.cmake index b2cc9db38b..288f2de314 100644 --- a/ports/freetds/portfile.cmake +++ b/ports/freetds/portfile.cmake @@ -18,15 +18,7 @@ vcpkg_find_acquire_program(PERL) get_filename_component(PERL_PATH ${PERL} DIRECTORY) vcpkg_add_to_path("${PERL_PATH}") -if (VCPKG_TARGET_IS_WINDOWS) - vcpkg_find_acquire_program(GPERF) - get_filename_component(GPERF_PATH ${GPERF} DIRECTORY) - vcpkg_add_to_path(${GPERF_PATH}) -else() - if (NOT EXISTS /usr/bin/gperf) - message(FATAL_ERROR "freetds requires gperf, these can be installed on Ubuntu systems via apt-get install gperf.") - endif() -endif() +vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/gperf") set(_WCHAR_SUPPORT ON) if(NOT VCPKG_TARGET_IS_WINDOWS) diff --git a/ports/freetds/vcpkg.json b/ports/freetds/vcpkg.json index 73b7bffb24..5483fdf994 100644 --- a/ports/freetds/vcpkg.json +++ b/ports/freetds/vcpkg.json @@ -1,11 +1,16 @@ { "name": "freetds", "version": "1.3.10", + "port-version": 1, "description": "Implementation of the Tabular Data Stream protocol", "homepage": "https://www.freetds.org", "license": "GPL-2.0-only", "supports": "windows & !uwp", "dependencies": [ + { + "name": "gperf", + "host": true + }, { "name": "libmysql", "platform": "windows" diff --git a/ports/gperf/portfile.cmake b/ports/gperf/portfile.cmake index 1e589d7c93..34644af1b9 100644 --- a/ports/gperf/portfile.cmake +++ b/ports/gperf/portfile.cmake @@ -14,12 +14,12 @@ vcpkg_extract_source_archive_ex( file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h.in DESTINATION ${SOURCE_PATH}) -vcpkg_configure_cmake( +vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} - OPTIONS_RELEASE -DCMAKE_INSTALL_BINDIR=tools + OPTIONS_RELEASE -DCMAKE_INSTALL_BINDIR=tools/gperf ) -vcpkg_install_cmake() +vcpkg_cmake_install() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) diff --git a/ports/gperf/vcpkg.json b/ports/gperf/vcpkg.json index da0d637c4e..02f6116f1f 100644 --- a/ports/gperf/vcpkg.json +++ b/ports/gperf/vcpkg.json @@ -1,7 +1,17 @@ { "name": "gperf", "version": "3.1", - "port-version": 3, + "port-version": 4, "description": "GNU perfect hash function generator", - "homepage": "https://www.gnu.org/software/gperf/" + "homepage": "https://www.gnu.org/software/gperf/", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] } diff --git a/ports/kf5codecs/portfile.cmake b/ports/kf5codecs/portfile.cmake index 538664fa9e..26713a368e 100644 --- a/ports/kf5codecs/portfile.cmake +++ b/ports/kf5codecs/portfile.cmake @@ -9,13 +9,11 @@ vcpkg_from_github( # Prevent KDEClangFormat from writing to source effectively blocking parallel configure file(WRITE "${SOURCE_PATH}/.clang-format" "DisableFormat: true\nSortIncludes: false\n") -find_program(GPERF_EXE NAMES gperf PATHS "${CURRENT_HOST_INSTALLED_DIR}/tools" NO_DEFAULT_PATH) - vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS -DBUILD_TESTING=OFF - "-DGperf_EXECUTABLE=${GPERF_EXE}" + "-DGperf_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/gperf/gperf${VCPKG_HOST_EXECUTABLE_SUFFIX}" ) vcpkg_cmake_install() diff --git a/ports/kf5codecs/vcpkg.json b/ports/kf5codecs/vcpkg.json index 3e53561c25..7ffe07cc43 100644 --- a/ports/kf5codecs/vcpkg.json +++ b/ports/kf5codecs/vcpkg.json @@ -1,6 +1,7 @@ { "name": "kf5codecs", "version": "5.89.0", + "port-version": 1, "description": "String encoding library", "homepage": "https://api.kde.org/frameworks/kcodecs/html/index.html", "dependencies": [ diff --git a/ports/proxygen/portfile.cmake b/ports/proxygen/portfile.cmake index 524f98d401..d9767e7515 100644 --- a/ports/proxygen/portfile.cmake +++ b/ports/proxygen/portfile.cmake @@ -13,16 +13,7 @@ vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_PATH "${PYTHON3}" DIRECTORY) vcpkg_add_to_path(${PYTHON3_PATH}) -if (VCPKG_TARGET_IS_WINDOWS) - vcpkg_find_acquire_program(GPERF) - get_filename_component(GPERF_PATH ${GPERF} DIRECTORY) - vcpkg_add_to_path(${GPERF_PATH}) -else() - # gperf only have windows package in vcpkg now. - if (NOT EXISTS /usr/bin/gperf) - message(FATAL_ERROR "proxygen requires gperf, these can be installed on Ubuntu systems via apt-get install gperf.") - endif() -endif() +vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/gperf") vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} diff --git a/ports/proxygen/vcpkg.json b/ports/proxygen/vcpkg.json index a0f89963a6..223c1775b0 100644 --- a/ports/proxygen/vcpkg.json +++ b/ports/proxygen/vcpkg.json @@ -1,7 +1,7 @@ { "name": "proxygen", "version-string": "2022.03.21.00", - "port-version": 1, + "port-version": 2, "description": "It comprises the core C++ HTTP abstractions used at Facebook.", "homepage": "https://github.com/facebook/proxygen", "supports": "!windows", @@ -16,6 +16,10 @@ "boost-thread", "fizz", "folly", + { + "name": "gperf", + "host": true + }, "openssl", { "name": "vcpkg-cmake", diff --git a/ports/qtwebengine/portfile.cmake b/ports/qtwebengine/portfile.cmake index 469852f832..f228d620af 100644 --- a/ports/qtwebengine/portfile.cmake +++ b/ports/qtwebengine/portfile.cmake @@ -44,7 +44,6 @@ endif() vcpkg_find_acquire_program(FLEX) vcpkg_find_acquire_program(BISON) -vcpkg_find_acquire_program(GPERF) #vcpkg_find_acquire_program(GN) # Qt builds its own internal version @@ -54,8 +53,6 @@ if(NOT NODEJS) message(FATAL_ERROR "node not found! Please install it via your system package manager!") endif() -get_filename_component(GPERF_DIR "${GPERF}" DIRECTORY ) -vcpkg_add_to_path(PREPEND "${GPERF_DIR}") get_filename_component(NODEJS_DIR "${NODEJS}" DIRECTORY ) vcpkg_add_to_path(PREPEND "${NODEJS_DIR}") get_filename_component(FLEX_DIR "${FLEX}" DIRECTORY ) @@ -73,6 +70,9 @@ else() x_vcpkg_get_python_packages(PYTHON_EXECUTABLE "${PYTHON3}" PACKAGES html5lib) endif() +vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/gperf") +set(GPERF "${CURRENT_HOST_INSTALLED_DIR}/tools/gperf/gperf${VCPKG_HOST_EXECUTABLE_SUFFIX}") + if(WIN32) # WIN32 HOST probably has win_flex and win_bison! if(NOT EXISTS "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}") file(CREATE_LINK "${FLEX}" "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}") diff --git a/ports/qtwebengine/vcpkg.json b/ports/qtwebengine/vcpkg.json index 0c84aa2301..9198d677d5 100644 --- a/ports/qtwebengine/vcpkg.json +++ b/ports/qtwebengine/vcpkg.json @@ -2,7 +2,7 @@ "$comment": "x86-windows is not within the upstream support matrix of Qt6", "name": "qtwebengine", "version": "6.3.0", - "port-version": 1, + "port-version": 2, "description": "Qt WebEngine", "homepage": "https://www.qt.io/", "license": null, @@ -24,6 +24,10 @@ "name": "glib", "platform": "!windows" }, + { + "name": "gperf", + "host": true + }, { "name": "harfbuzz", "platform": "!windows" diff --git a/versions/baseline.json b/versions/baseline.json index 0ca7a2367b..78c07220b9 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2298,7 +2298,7 @@ }, "fontconfig": { "baseline": "2.14.0", - "port-version": 1 + "port-version": 2 }, "foonathan-memory": { "baseline": "2019-07-21", @@ -2346,7 +2346,7 @@ }, "freetds": { "baseline": "1.3.10", - "port-version": 0 + "port-version": 1 }, "freetype": { "baseline": "2.12.1", @@ -2618,7 +2618,7 @@ }, "gperf": { "baseline": "3.1", - "port-version": 3 + "port-version": 4 }, "gperftools": { "baseline": "2019-09-02", @@ -3154,7 +3154,7 @@ }, "kf5codecs": { "baseline": "5.89.0", - "port-version": 0 + "port-version": 1 }, "kf5completion": { "baseline": "5.89.0", @@ -5614,7 +5614,7 @@ }, "proxygen": { "baseline": "2022.03.21.00", - "port-version": 1 + "port-version": 2 }, "psimd": { "baseline": "2021-02-21", @@ -6022,7 +6022,7 @@ }, "qtwebengine": { "baseline": "6.3.0", - "port-version": 1 + "port-version": 2 }, "qtwebsockets": { "baseline": "6.3.0", diff --git a/versions/f-/fontconfig.json b/versions/f-/fontconfig.json index 068c6f259a..7b747ad2ed 100644 --- a/versions/f-/fontconfig.json +++ b/versions/f-/fontconfig.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5c02d2ba027c9f390729a7e0899e63c853450dfb", + "version": "2.14.0", + "port-version": 2 + }, { "git-tree": "b1b1de99dba230f78c88bb9d73329bed77227ad4", "version": "2.14.0", diff --git a/versions/f-/freetds.json b/versions/f-/freetds.json index 64d7d576e5..0deb3189ea 100644 --- a/versions/f-/freetds.json +++ b/versions/f-/freetds.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "7d2a8c09978586d81a52529c94a96dd2f1208ebe", + "version": "1.3.10", + "port-version": 1 + }, { "git-tree": "c388be84a1c4bb7156aaf173f1ee348d500db8ad", "version": "1.3.10", diff --git a/versions/g-/gperf.json b/versions/g-/gperf.json index addff5181f..9421e9188f 100644 --- a/versions/g-/gperf.json +++ b/versions/g-/gperf.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "2fd0763af6d1af5d123d81c77fe9062d33b3e918", + "version": "3.1", + "port-version": 4 + }, { "git-tree": "15455ef99f1ce92d079d047e90fc486c098c6b18", "version": "3.1", diff --git a/versions/k-/kf5codecs.json b/versions/k-/kf5codecs.json index 05b772b738..b4d9a4b4de 100644 --- a/versions/k-/kf5codecs.json +++ b/versions/k-/kf5codecs.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3f089e2bf752a07b60871e0cbc1bcdf085b3e7fd", + "version": "5.89.0", + "port-version": 1 + }, { "git-tree": "689fa05db3db3ea404ccec181b0a8bba8e614562", "version": "5.89.0", diff --git a/versions/p-/proxygen.json b/versions/p-/proxygen.json index 3b9e342522..51842ba59d 100644 --- a/versions/p-/proxygen.json +++ b/versions/p-/proxygen.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "27f0950fcf11ac8f561591363715ddf581146325", + "version-string": "2022.03.21.00", + "port-version": 2 + }, { "git-tree": "fb9493259e80636642c06b40479c36b6b4c9cba2", "version-string": "2022.03.21.00", diff --git a/versions/q-/qtwebengine.json b/versions/q-/qtwebengine.json index afcecd5505..842e438b99 100644 --- a/versions/q-/qtwebengine.json +++ b/versions/q-/qtwebengine.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "fb2bc02591f25285ed7e085bce22001d42ec5d87", + "version": "6.3.0", + "port-version": 2 + }, { "git-tree": "6562d0a0294290afd20da039ff60602c1f3f4701", "version": "6.3.0",