From 5ccc45d8b7375f32274a95ebcb284d7201f9ce30 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 25 Mar 2022 00:38:20 -0700 Subject: [PATCH 01/11] [wxwidgets] Fix linux build --- ports/wxwidgets/fix-linux-configure.patch | 15 +++++++++++++++ ports/wxwidgets/portfile.cmake | 1 + ports/wxwidgets/vcpkg.json | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 ports/wxwidgets/fix-linux-configure.patch diff --git a/ports/wxwidgets/fix-linux-configure.patch b/ports/wxwidgets/fix-linux-configure.patch new file mode 100644 index 00000000000000..0fc85bf0802af9 --- /dev/null +++ b/ports/wxwidgets/fix-linux-configure.patch @@ -0,0 +1,15 @@ +diff --git a/build/cmake/modules/cotire.cmake b/build/cmake/modules/cotire.cmake +index bb69643..09b52a6 100644 +--- a/build/cmake/modules/cotire.cmake ++++ b/build/cmake/modules/cotire.cmake +@@ -2316,6 +2316,10 @@ function (cotire_generate_target_script _language _configurations _target _targe + "${_config}" "${_language}" "${_target}" COTIRE_TARGET_COMPILE_DEFINITIONS_${_upperConfig}) + cotire_get_target_compiler_flags( + "${_config}" "${_language}" "${_target}" COTIRE_TARGET_COMPILE_FLAGS_${_upperConfig}) ++ string(REPLACE ++ "" "" ++ COTIRE_TARGET_COMPILE_FLAGS_${_upperConfig} "${COTIRE_TARGET_COMPILE_FLAGS_${_upperConfig}}" ++ ) + cotire_get_source_files_compile_definitions( + "${_config}" "${_language}" COTIRE_TARGET_SOURCES_COMPILE_DEFINITIONS_${_upperConfig} ${_targetSources}) + endforeach() diff --git a/ports/wxwidgets/portfile.cmake b/ports/wxwidgets/portfile.cmake index 3e3a057992ff7d..c849164cf3ae74 100644 --- a/ports/wxwidgets/portfile.cmake +++ b/ports/wxwidgets/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( PATCHES disable-platform-lib-dir.patch fix-build.patch + fix-linux-configure.patch # Remove this patch in the next update ) set(OPTIONS) diff --git a/ports/wxwidgets/vcpkg.json b/ports/wxwidgets/vcpkg.json index 1663c7812e2516..9a4cdf2a8fb8a1 100644 --- a/ports/wxwidgets/vcpkg.json +++ b/ports/wxwidgets/vcpkg.json @@ -1,13 +1,14 @@ { "name": "wxwidgets", "version-semver": "3.1.5", - "port-version": 7, + "port-version": 8, "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.", "Set WXWIDGETS_USE_STD_CONTAINERS in a custom triplet to build with the wxUSE_STD_CONTAINERS build option." ], "homepage": "https://github.com/wxWidgets/wxWidgets", + "license": "wxWindows", "supports": "!uwp", "dependencies": [ "expat", From 5ac4d31a932e066e03f10f141abf4d328c45ffe6 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 25 Mar 2022 00:38:54 -0700 Subject: [PATCH 02/11] clean up baseline --- scripts/ci.baseline.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 587b21418c3e46..a0d28ab5383b8f 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1359,7 +1359,6 @@ winreg:x64-osx=fail wpilib:arm64-windows=fail wpilib:x64-osx=fail wxchartdir:x64-osx=fail -wxwidgets:x64-linux=fail x265:arm64-windows=fail x265:arm-uwp=fail x265:x64-uwp=fail From a45505519363636462b4ff308b944b850ee82031 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 25 Mar 2022 00:39:13 -0700 Subject: [PATCH 03/11] version --- versions/baseline.json | 2 +- versions/w-/wxwidgets.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 830818f52a56c4..248178fd7f2a51 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7470,7 +7470,7 @@ }, "wxwidgets": { "baseline": "3.1.5", - "port-version": 7 + "port-version": 8 }, "x-plane": { "baseline": "3.0.3", diff --git a/versions/w-/wxwidgets.json b/versions/w-/wxwidgets.json index c8da366d3717e7..82ad5804609148 100644 --- a/versions/w-/wxwidgets.json +++ b/versions/w-/wxwidgets.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "6fde6fcb9c95027cfc81d026135ea82edd1f1ba1", + "version-semver": "3.1.5", + "port-version": 8 + }, { "git-tree": "9184caa631070403a5fd8c177b56907a313ad197", "version-semver": "3.1.5", From bd9ab04b4ecb1842cdace6e2cf5b767b9a9b7d69 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 25 Mar 2022 00:52:31 -0700 Subject: [PATCH 04/11] Fix --libs output --- ports/wxwidgets/fix-linux-configure.patch | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/ports/wxwidgets/fix-linux-configure.patch b/ports/wxwidgets/fix-linux-configure.patch index 0fc85bf0802af9..059bb42b7bb097 100644 --- a/ports/wxwidgets/fix-linux-configure.patch +++ b/ports/wxwidgets/fix-linux-configure.patch @@ -13,3 +13,37 @@ index bb69643..09b52a6 100644 cotire_get_source_files_compile_definitions( "${_config}" "${_language}" COTIRE_TARGET_SOURCES_COMPILE_DEFINITIONS_${_upperConfig} ${_targetSources}) endforeach() +diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake +index 91d11ac..2791466 100644 +--- a/build/cmake/config.cmake ++++ b/build/cmake/config.cmake +@@ -41,9 +41,27 @@ macro(wx_get_dependencies var lib) + endif() + set(dep_name "-l${dep_name}") + else() +- get_filename_component(dep_name ${dep} NAME) ++ # For the value like $<$:LIB_PATH> ++ # Or $<$>:LIB_PATH> ++ string(REGEX REPLACE "^.+>:(.+)>$" "\\1" dep_name ${dep}) ++ if (NOT dep_name) ++ set(dep_name ${dep}) ++ endif() ++ endif() ++ if(dep_name STREQUAL "libc.so") ++ # don't include this library ++ elseif(dep_name MATCHES "^-(.*)$") # -l, -framework, -weak_framework ++ wx_string_append(${var} "${dep_name} ") ++ elseif(dep_name MATCHES "^lib(.*)(.so|.dylib|.tbd|.a)$") ++ wx_string_append(${var} "-l${CMAKE_MATCH_1} ") ++ elseif(dep_name) ++ get_filename_component(abs_path ${dep_name} PATH) ++ if (abs_path) # value contains path ++ wx_string_append(${var} "${dep_name} ") ++ else() ++ wx_string_append(${var} "-l${dep_name} ") ++ endif() + endif() +- wx_string_append(${var} "${dep_name} ") + endforeach() + string(STRIP ${${var}} ${var}) + endif() From 1ecb5e55763b218b1abf7edf0172d5019ea065b7 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 25 Mar 2022 00:52:44 -0700 Subject: [PATCH 05/11] version --- versions/w-/wxwidgets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/w-/wxwidgets.json b/versions/w-/wxwidgets.json index 82ad5804609148..efedc4fc4f6dc8 100644 --- a/versions/w-/wxwidgets.json +++ b/versions/w-/wxwidgets.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "6fde6fcb9c95027cfc81d026135ea82edd1f1ba1", + "git-tree": "831a2b85db0f62c98a6148d0b607236b2f2f419a", "version-semver": "3.1.5", "port-version": 8 }, From a890adffbb1994d0fa3fc0d0030be3ee3c8095b9 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 28 Mar 2022 04:36:45 +0200 Subject: [PATCH 06/11] Use system pkg-config on linux (#6) * Use system pkg-config for linux * Update versions --- ports/wxwidgets/portfile.cmake | 9 +++++++++ versions/w-/wxwidgets.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ports/wxwidgets/portfile.cmake b/ports/wxwidgets/portfile.cmake index c849164cf3ae74..1bfc721778bfc2 100644 --- a/ports/wxwidgets/portfile.cmake +++ b/ports/wxwidgets/portfile.cmake @@ -22,6 +22,15 @@ if(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64 OR VCPKG_TARGET_ARCHITECTURE STREQUA ) endif() +# wxWidgets on Linux currently needs to find the system's `gtk+-3.0.pc`. +# vcpkg's port pkgconf would prevent this lookup. +if(VCPKG_TARGET_IS_LINUX AND NOT VCPKG_CROSSCOMPILING AND NOT DEFINED ENV{PKG_CONFIG}) + find_program(system_pkg_config NAMES pkg-config) + if(system_pkg_config) + set(ENV{PKG_CONFIG} "${system_pkg_config}") + endif() +endif() + # This may be set to ON by users in a custom triplet. # The use of 'wxUSE_STL' and 'WXWIDGETS_USE_STD_CONTAINERS' (ON or OFF) are not API compatible # which is why they must be set in a custom triplet rather than a port feature. diff --git a/versions/w-/wxwidgets.json b/versions/w-/wxwidgets.json index efedc4fc4f6dc8..520800816284b7 100644 --- a/versions/w-/wxwidgets.json +++ b/versions/w-/wxwidgets.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "831a2b85db0f62c98a6148d0b607236b2f2f419a", + "git-tree": "116f75bb873cacd211f67d7c4b6399a31040aba5", "version-semver": "3.1.5", "port-version": 8 }, From 6ffcf645ba82ccec2044c4e71a77aa48a056f535 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Mon, 28 Mar 2022 00:02:35 -0700 Subject: [PATCH 07/11] Revert baseline changes --- scripts/ci.baseline.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index a0d28ab5383b8f..587b21418c3e46 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1359,6 +1359,7 @@ winreg:x64-osx=fail wpilib:arm64-windows=fail wpilib:x64-osx=fail wxchartdir:x64-osx=fail +wxwidgets:x64-linux=fail x265:arm64-windows=fail x265:arm-uwp=fail x265:x64-uwp=fail From f8986a7db652fda50bc5d6a9a48ace49241b7261 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 29 Mar 2022 00:30:38 -0700 Subject: [PATCH 08/11] Add double quotes to paths --- ports/wxwidgets/portfile.cmake | 64 ++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/ports/wxwidgets/portfile.cmake b/ports/wxwidgets/portfile.cmake index 1bfc721778bfc2..3aa3a093544a73 100644 --- a/ports/wxwidgets/portfile.cmake +++ b/ports/wxwidgets/portfile.cmake @@ -43,7 +43,7 @@ if(NOT DEFINED WXWIDGETS_USE_STD_CONTAINERS) endif() vcpkg_cmake_configure( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH "${SOURCE_PATH}" OPTIONS -DwxUSE_REGEX=builtin -DwxUSE_ZLIB=sys @@ -59,21 +59,23 @@ vcpkg_cmake_configure( vcpkg_cmake_install() -file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -if(DLLS) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) - foreach(DLL ${DLLS}) - get_filename_component(N "${DLL}" NAME) - file(RENAME ${DLL} ${CURRENT_PACKAGES_DIR}/bin/${N}) - endforeach() -endif() -file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -if(DLLS) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) - foreach(DLL ${DLLS}) - get_filename_component(N "${DLL}" NAME) - file(RENAME ${DLL} ${CURRENT_PACKAGES_DIR}/debug/bin/${N}) - endforeach() +if (VCPKG_TARGET_IS_WINDOWS) + file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") + if(DLLS) + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin") + foreach(DLL IN LISTS DLLS) + get_filename_component(N "${DLL}" NAME) + file(RENAME "${DLL}" "${CURRENT_PACKAGES_DIR}/bin/${N}") + endforeach() + endif() + file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") + if(DLLS) + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin") + foreach(DLL IN LISTS DLLS) + get_filename_component(N "${DLL}" NAME) + file(RENAME "${DLL}" "${CURRENT_PACKAGES_DIR}/debug/bin/${N}") + endforeach() + endif() endif() if(VCPKG_TARGET_IS_WINDOWS) @@ -85,14 +87,14 @@ endif() # do the copy pdbs now after the dlls got moved to the expected /bin folder above vcpkg_copy_pdbs() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/msvc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(GLOB_RECURSE INCLUDES ${CURRENT_PACKAGES_DIR}/include/*.h) -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h) - list(APPEND INCLUDES ${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/msvc") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(GLOB_RECURSE INCLUDES "${CURRENT_PACKAGES_DIR}/include/*.h") +if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h") + list(APPEND INCLUDES "${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h") endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h) - list(APPEND INCLUDES ${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h) +if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h") + list(APPEND INCLUDES "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h") endif() foreach(INC IN LISTS INCLUDES) file(READ "${INC}" _contents) @@ -106,9 +108,9 @@ foreach(INC IN LISTS INCLUDES) file(WRITE "${INC}" "${_contents}") endforeach() -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include/wx/setup.h) - file(GLOB_RECURSE WX_SETUP_H_FILES_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/*.h) - file(GLOB_RECURSE WX_SETUP_H_FILES_REL ${CURRENT_PACKAGES_DIR}/lib/*.h) +if(NOT EXISTS "${CURRENT_PACKAGES_DIR}/include/wx/setup.h") + file(GLOB_RECURSE "WX_SETUP_H_FILES_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/*.h") + file(GLOB_RECURSE "WX_SETUP_H_FILES_REL ${CURRENT_PACKAGES_DIR}/lib/*.h") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") vcpkg_replace_string("${WX_SETUP_H_FILES_REL}" "${CURRENT_PACKAGES_DIR}" "") @@ -123,8 +125,10 @@ if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include/wx/setup.h) string(REPLACE "/setup.h" "" WX_SETUP_H_DBG_RELATIVE "${WX_SETUP_H_FILES_DBG}") endif() - configure_file(${CMAKE_CURRENT_LIST_DIR}/setup.h.in ${CURRENT_PACKAGES_DIR}/include/wx/setup.h @ONLY) + configure_file("${CMAKE_CURRENT_LIST_DIR}/setup.h.in" "${CURRENT_PACKAGES_DIR}/include/wx/setup.h" @ONLY) endif() -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/wxwidgets) -configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/wxwidgets/usage COPYONLY) -file(INSTALL ${SOURCE_PATH}/docs/licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY) + +file(INSTALL "${SOURCE_PATH}/docs/licence.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) From 9c0363c50eec0c7af9b7e348cee9a7e5f1d86086 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 29 Mar 2022 00:35:16 -0700 Subject: [PATCH 09/11] version --- versions/w-/wxwidgets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/w-/wxwidgets.json b/versions/w-/wxwidgets.json index 520800816284b7..7dcd75ebf56b12 100644 --- a/versions/w-/wxwidgets.json +++ b/versions/w-/wxwidgets.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "116f75bb873cacd211f67d7c4b6399a31040aba5", + "git-tree": "33a87baa90f6ea142f649f688081a9406ca6a3d5", "version-semver": "3.1.5", "port-version": 8 }, From ae8a4dc94b4a1a21928d76645eb6f8593806d828 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 29 Mar 2022 01:53:11 -0700 Subject: [PATCH 10/11] Fix incorrect double quotes place --- ports/wxwidgets/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/wxwidgets/portfile.cmake b/ports/wxwidgets/portfile.cmake index 3aa3a093544a73..441943a4a18f41 100644 --- a/ports/wxwidgets/portfile.cmake +++ b/ports/wxwidgets/portfile.cmake @@ -109,8 +109,8 @@ foreach(INC IN LISTS INCLUDES) endforeach() if(NOT EXISTS "${CURRENT_PACKAGES_DIR}/include/wx/setup.h") - file(GLOB_RECURSE "WX_SETUP_H_FILES_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/*.h") - file(GLOB_RECURSE "WX_SETUP_H_FILES_REL ${CURRENT_PACKAGES_DIR}/lib/*.h") + file(GLOB_RECURSE WX_SETUP_H_FILES_DBG "${CURRENT_PACKAGES_DIR}/debug/lib/*.h") + file(GLOB_RECURSE WX_SETUP_H_FILES_REL "${CURRENT_PACKAGES_DIR}/lib/*.h") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") vcpkg_replace_string("${WX_SETUP_H_FILES_REL}" "${CURRENT_PACKAGES_DIR}" "") From a9d9140ecefedcac887c6f63da5fcf141ac0b170 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 29 Mar 2022 01:53:20 -0700 Subject: [PATCH 11/11] version --- versions/w-/wxwidgets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/w-/wxwidgets.json b/versions/w-/wxwidgets.json index 7dcd75ebf56b12..ec844293847ab8 100644 --- a/versions/w-/wxwidgets.json +++ b/versions/w-/wxwidgets.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "33a87baa90f6ea142f649f688081a9406ca6a3d5", + "git-tree": "dba058c37782edf771e7a62ae1bef98274c86b9f", "version-semver": "3.1.5", "port-version": 8 },