From 20907dc8bfd4a3baf555467727755fbba708ad84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Wed, 25 May 2022 20:55:25 +0000 Subject: [PATCH] [wxwidgets] Fix find dependency pcre2 (#24874) * [wxwidgets] Fix find dependency pcre2 * version * Use pcre2.pc * version * Fix double quotes * version * Use PC_PCRE2_LINK_LIBRARIES instead of target name to fix wx-config content * version * Set wxUSE_SECRETSTORE to FALSE to avoid introduce system pcre in wx-config * version --- ports/wxwidgets/fix-pcre2.patch | 23 +++++++++++++++++++++++ ports/wxwidgets/portfile.cmake | 8 ++++++++ ports/wxwidgets/vcpkg.json | 1 + versions/baseline.json | 2 +- versions/w-/wxwidgets.json | 5 +++++ 5 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 ports/wxwidgets/fix-pcre2.patch diff --git a/ports/wxwidgets/fix-pcre2.patch b/ports/wxwidgets/fix-pcre2.patch new file mode 100644 index 00000000000000..20063f4418a4f4 --- /dev/null +++ b/ports/wxwidgets/fix-pcre2.patch @@ -0,0 +1,23 @@ +diff --git a/build/cmake/modules/FindPCRE2.cmake b/build/cmake/modules/FindPCRE2.cmake +index a27693a..455675a 100644 +--- a/build/cmake/modules/FindPCRE2.cmake ++++ b/build/cmake/modules/FindPCRE2.cmake +@@ -24,7 +24,10 @@ set(PCRE2_CODE_UNIT_WIDTH_USED "${PCRE2_CODE_UNIT_WIDTH}" CACHE INTERNAL "") + + find_package(PkgConfig QUIET) + pkg_check_modules(PC_PCRE2 QUIET libpcre2-${PCRE2_CODE_UNIT_WIDTH}) ++set(PCRE2_LIBRARIES ${PC_PCRE2_LINK_LIBRARIES}) ++set(PCRE2_INCLUDE_DIRS ${PC_PCRE2_INCLUDE_DIRS}) + ++if (0) + find_path(PCRE2_INCLUDE_DIRS + NAMES pcre2.h + HINTS ${PC_PCRE2_INCLUDEDIR} +@@ -36,6 +39,7 @@ find_library(PCRE2_LIBRARIES + HINTS ${PC_PCRE2_LIBDIR} + ${PC_PCRE2_LIBRARY_DIRS} + ) ++endif() + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE2 REQUIRED_VARS PCRE2_LIBRARIES PCRE2_INCLUDE_DIRS VERSION_VAR PC_PCRE2_VERSION) diff --git a/ports/wxwidgets/portfile.cmake b/ports/wxwidgets/portfile.cmake index 583bfbb5a9f085..32b331623874e7 100644 --- a/ports/wxwidgets/portfile.cmake +++ b/ports/wxwidgets/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( relocatable-wx-config.patch nanosvg-ext-depend.patch fix-libs-export.patch + fix-pcre2.patch ) if(VCPKG_TARGET_IS_LINUX) @@ -35,6 +36,8 @@ vcpkg_check_features( sound wxUSE_SOUND ) +vcpkg_find_acquire_program(PKGCONFIG) + set(OPTIONS "") if(VCPKG_TARGET_IS_OSX) list(APPEND OPTIONS -DCOTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES=9999) @@ -86,10 +89,15 @@ vcpkg_cmake_configure( -DwxUSE_LIBJPEG=sys -DwxUSE_LIBPNG=sys -DwxUSE_LIBTIFF=sys + -DwxUSE_SECRETSTORE=FALSE -DwxBUILD_DISABLE_PLATFORM_LIB_DIR=ON -DwxUSE_STL=${WXWIDGETS_USE_STL} -DwxUSE_STD_CONTAINERS=${WXWIDGETS_USE_STD_CONTAINERS} ${OPTIONS} + "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" + # The minimum cmake version requirement for Cotire is 2.8.12. + # however, we need to declare that the minimum cmake version requirement is at least 3.1 to use CMAKE_PREFIX_PATH as the path to find .pc. + -DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON ) vcpkg_cmake_install() diff --git a/ports/wxwidgets/vcpkg.json b/ports/wxwidgets/vcpkg.json index 3c4398508636df..fdf7608f0e69f3 100644 --- a/ports/wxwidgets/vcpkg.json +++ b/ports/wxwidgets/vcpkg.json @@ -1,6 +1,7 @@ { "name": "wxwidgets", "version": "3.1.6", + "port-version": 1, "description": [ "Widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. ", "Set WXWIDGETS_USE_STL in a custom triplet to build with the wxUSE_STL build option.", diff --git a/versions/baseline.json b/versions/baseline.json index cbd0a9b750f9be..ad426a70d7b2e0 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7574,7 +7574,7 @@ }, "wxwidgets": { "baseline": "3.1.6", - "port-version": 0 + "port-version": 1 }, "x-plane": { "baseline": "3.0.3", diff --git a/versions/w-/wxwidgets.json b/versions/w-/wxwidgets.json index ea2a00e9bcb64f..e71cd8312a1666 100644 --- a/versions/w-/wxwidgets.json +++ b/versions/w-/wxwidgets.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "793b49ce7710b440be0a451354614e282e6fc9fa", + "version": "3.1.6", + "port-version": 1 + }, { "git-tree": "16d9f0aabf4f0df68bebd7b42ff6005d952f9392", "version": "3.1.6",