Skip to content

Commit

Permalink
[wxwidgets] Fix find dependency pcre2 (#24874)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
JackBoosY authored May 25, 2022
1 parent f4de177 commit 20907dc
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
23 changes: 23 additions & 0 deletions ports/wxwidgets/fix-pcre2.patch
Original file line number Diff line number Diff line change
@@ -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)
8 changes: 8 additions & 0 deletions ports/wxwidgets/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions ports/wxwidgets/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7574,7 +7574,7 @@
},
"wxwidgets": {
"baseline": "3.1.6",
"port-version": 0
"port-version": 1
},
"x-plane": {
"baseline": "3.0.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/w-/wxwidgets.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "793b49ce7710b440be0a451354614e282e6fc9fa",
"version": "3.1.6",
"port-version": 1
},
{
"git-tree": "16d9f0aabf4f0df68bebd7b42ff6005d952f9392",
"version": "3.1.6",
Expand Down

0 comments on commit 20907dc

Please sign in to comment.