From ef41783539afcab42291ce3d3e22458c13d9c4cf Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Mon, 21 Jun 2021 23:36:58 -0700 Subject: [PATCH 1/5] [wxwidgets] Fix wx-config --libs output --- ports/wxwidgets/fix-wxconfig-libs-output.patch | 12 ++++++++++++ ports/wxwidgets/portfile.cmake | 1 + ports/wxwidgets/vcpkg.json | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 ports/wxwidgets/fix-wxconfig-libs-output.patch diff --git a/ports/wxwidgets/fix-wxconfig-libs-output.patch b/ports/wxwidgets/fix-wxconfig-libs-output.patch new file mode 100644 index 00000000000000..b31a270c97e726 --- /dev/null +++ b/ports/wxwidgets/fix-wxconfig-libs-output.patch @@ -0,0 +1,12 @@ +diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake +index 91d11ac..9d64755 100644 +--- a/build/cmake/config.cmake ++++ b/build/cmake/config.cmake +@@ -42,6 +42,7 @@ macro(wx_get_dependencies var lib) + set(dep_name "-l${dep_name}") + else() + get_filename_component(dep_name ${dep} NAME) ++ set(dep_name "-l${dep_name}") + endif() + wx_string_append(${var} "${dep_name} ") + endforeach() diff --git a/ports/wxwidgets/portfile.cmake b/ports/wxwidgets/portfile.cmake index 8b2050e2d54d6a..9b16f885d9e104 100644 --- a/ports/wxwidgets/portfile.cmake +++ b/ports/wxwidgets/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( PATCHES disable-platform-lib-dir.patch fix-build.patch + fix-wxconfig-libs-output.patch ) set(OPTIONS) diff --git a/ports/wxwidgets/vcpkg.json b/ports/wxwidgets/vcpkg.json index c7464fe1435e19..4f021c5d62d489 100644 --- a/ports/wxwidgets/vcpkg.json +++ b/ports/wxwidgets/vcpkg.json @@ -1,7 +1,7 @@ { "name": "wxwidgets", "version-semver": "3.1.5", - "port-version": 2, + "port-version": 3, "description": "a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications.", "homepage": "https://github.com/wxWidgets/wxWidgets", "supports": "!uwp", From 1ba31dea52652e735d9abcd727186e52d4b54da5 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 22 Jun 2021 00:01:50 -0700 Subject: [PATCH 2/5] Re-fix output --- ports/wxwidgets/fix-wxconfig-libs-output.patch | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ports/wxwidgets/fix-wxconfig-libs-output.patch b/ports/wxwidgets/fix-wxconfig-libs-output.patch index b31a270c97e726..cbb6f3bb9e9638 100644 --- a/ports/wxwidgets/fix-wxconfig-libs-output.patch +++ b/ports/wxwidgets/fix-wxconfig-libs-output.patch @@ -1,12 +1,16 @@ diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake -index 91d11ac..9d64755 100644 +index 91d11ac..56b103b 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake -@@ -42,6 +42,7 @@ macro(wx_get_dependencies var lib) +@@ -42,6 +42,11 @@ macro(wx_get_dependencies var lib) set(dep_name "-l${dep_name}") else() get_filename_component(dep_name ${dep} NAME) -+ set(dep_name "-l${dep_name}") ++ string(REGEX MATCH "^-.*$" ADDED_PREFIX ${dep_name}) ++ if (NOT ADDED_PREFIX) ++ set(dep_name "-l${dep_name}") ++ endif() ++ endif() wx_string_append(${var} "${dep_name} ") endforeach() From 5ba744238e6d49191f98f93c265f1a2423ce420d Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 22 Jun 2021 01:27:32 -0700 Subject: [PATCH 3/5] Re-fix output --- ports/wxwidgets/fix-wxconfig-libs-output.patch | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ports/wxwidgets/fix-wxconfig-libs-output.patch b/ports/wxwidgets/fix-wxconfig-libs-output.patch index cbb6f3bb9e9638..1db395dab762a5 100644 --- a/ports/wxwidgets/fix-wxconfig-libs-output.patch +++ b/ports/wxwidgets/fix-wxconfig-libs-output.patch @@ -1,14 +1,24 @@ diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake -index 91d11ac..56b103b 100644 +index 91d11ac..d8f26d7 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake -@@ -42,6 +42,11 @@ macro(wx_get_dependencies var lib) +@@ -42,6 +42,21 @@ macro(wx_get_dependencies var lib) set(dep_name "-l${dep_name}") else() get_filename_component(dep_name ${dep} NAME) + string(REGEX MATCH "^-.*$" ADDED_PREFIX ${dep_name}) -+ if (NOT ADDED_PREFIX) -+ set(dep_name "-l${dep_name}") ++ if (ADDED_PREFIX) ++ # Do nothing ++ else() ++ string(REGEX MATCH "^lib(.*).a$" CURR_STATIC_NAME ${dep_name}) ++ string(REGEX MATCH "^lib(.*).so$" CURR_DYNAMIC_NAME ${dep_name}) ++ if (CURR_STATIC_NAME) ++ set(dep_name "-l${CURR_STATIC_NAME}") ++ elseif (CURR_DYNAMIC_NAME) ++ set(dep_name "-l${CURR_DYNAMIC_NAME}") ++ else() ++ set(dep_name "-l${dep_name}") ++ endif() + endif() + endif() From 700b6ebcf3c7ce21755d59c3698e8b706b00c597 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Wed, 23 Jun 2021 00:13:06 -0700 Subject: [PATCH 4/5] Re-fix --- .../wxwidgets/fix-wxconfig-libs-output.patch | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/ports/wxwidgets/fix-wxconfig-libs-output.patch b/ports/wxwidgets/fix-wxconfig-libs-output.patch index 1db395dab762a5..32644ca54f069d 100644 --- a/ports/wxwidgets/fix-wxconfig-libs-output.patch +++ b/ports/wxwidgets/fix-wxconfig-libs-output.patch @@ -1,26 +1,36 @@ diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake -index 91d11ac..d8f26d7 100644 +index 91d11ac..45479a7 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake -@@ -42,6 +42,21 @@ macro(wx_get_dependencies var lib) +@@ -41,7 +41,30 @@ macro(wx_get_dependencies var lib) + endif() set(dep_name "-l${dep_name}") else() - get_filename_component(dep_name ${dep} NAME) -+ string(REGEX MATCH "^-.*$" ADDED_PREFIX ${dep_name}) -+ if (ADDED_PREFIX) -+ # Do nothing +- get_filename_component(dep_name ${dep} NAME) ++ string(REGEX REPLACE "^.+>:(.+)>$" "\\1" dep_path ${dep}) ++ if (NOT dep_path) ++ set(dep_name ${dep}) + else() -+ string(REGEX MATCH "^lib(.*).a$" CURR_STATIC_NAME ${dep_name}) -+ string(REGEX MATCH "^lib(.*).so$" CURR_DYNAMIC_NAME ${dep_name}) -+ if (CURR_STATIC_NAME) -+ set(dep_name "-l${CURR_STATIC_NAME}") -+ elseif (CURR_DYNAMIC_NAME) -+ set(dep_name "-l${CURR_DYNAMIC_NAME}") ++ string(REGEX MATCH "^-.*$" ADDED_PREFIX ${dep_path}) ++ if (ADDED_PREFIX) ++ set(dep_name ${dep_path}) + else() -+ set(dep_name "-l${dep_name}") ++ get_filename_component(abs_path ${dep_path} PATH) ++ if (NOT abs_path) ++ string(REGEX MATCH "^lib(.*).a$" CURR_STATIC_NAME ${dep_path}) ++ string(REGEX MATCH "^lib(.*).so$" CURR_DYNAMIC_NAME ${dep_path}) ++ if (CURR_STATIC_NAME) ++ set(dep_name "-l${CURR_STATIC_NAME}") ++ elseif (CURR_DYNAMIC_NAME) ++ set(dep_name "-l${CURR_DYNAMIC_NAME}") ++ else() ++ set(dep_name "-l${dep_path}") ++ endif() ++ else() ++ set(dep_name ${dep_path}) ++ endif() + endif() + endif() -+ endif() wx_string_append(${var} "${dep_name} ") endforeach() From 552d0fadd8b16a7522df99873644c35027f29e29 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 25 Jun 2021 02:27:27 -0700 Subject: [PATCH 5/5] Determine the BUILD_TYPE --- ports/wxwidgets/fix-wxconfig-libs-output.patch | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ports/wxwidgets/fix-wxconfig-libs-output.patch b/ports/wxwidgets/fix-wxconfig-libs-output.patch index 32644ca54f069d..37762f9165d055 100644 --- a/ports/wxwidgets/fix-wxconfig-libs-output.patch +++ b/ports/wxwidgets/fix-wxconfig-libs-output.patch @@ -1,12 +1,22 @@ diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake -index 91d11ac..45479a7 100644 +index 91d11ac..4e22ee9 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake -@@ -41,7 +41,30 @@ macro(wx_get_dependencies var lib) +@@ -41,7 +41,40 @@ macro(wx_get_dependencies var lib) endif() set(dep_name "-l${dep_name}") else() - get_filename_component(dep_name ${dep} NAME) ++ if (CMAKE_BUILD_TYPE STREQUAL "Release") ++ # For "$<$:" ++ set(CONFIG_TYPE_INVERT "CONFIG:DEBUG>:") ++ else() ++ # For "$<$>:" ++ set(CONFIG_TYPE_INVERT "CONFIG:DEBUG>>:") ++ endif() ++ if (dep MATCHES "${CONFIG_TYPE_INVERT}") ++ continue() ++ endif() + string(REGEX REPLACE "^.+>:(.+)>$" "\\1" dep_path ${dep}) + if (NOT dep_path) + set(dep_name ${dep})