Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wxwidgets] update to 3.1.6 #24483

Merged
merged 15 commits into from
May 6, 2022
16 changes: 16 additions & 0 deletions ports/nanosvg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 3.11)
project(nanosvg NONE)

set(NANOSVG_HEADERS src/nanosvg.h src/nanosvgrast.h)
add_library(nanosvg INTERFACE)

set_target_properties(nanosvg PROPERTIES PUBLIC_HEADER "${NANOSVG_HEADERS}")

install(TARGETS nanosvg
EXPORT nanosvgTargets
PUBLIC_HEADER DESTINATION include)

install(EXPORT nanosvgTargets
FILE unofficial-nanosvg-config.cmake
NAMESPACE unofficial::nanosvg::
DESTINATION share/unofficial-nanosvg)
15 changes: 15 additions & 0 deletions ports/nanosvg/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO memononen/nanosvg
REF 03042a6297399379198f98eb625ff8902bd84784
SHA512 163f205e81e830e8b2512ec1faa15ebaf82138fc8bd881ccfc5f19896df75e8cf77ccd20892fccd0fd3e5d6358438e6f3075fd4e6a4c4b064107451265c9f874
HEAD_REF master
)

file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")

set(VCPKG_BUILD_TYPE "release") # header-only
vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
vcpkg_cmake_install()

file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
13 changes: 13 additions & 0 deletions ports/nanosvg/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "nanosvg",
"version-date": "2022-04-29",
"description": "NanoSVG is a simple stupid single-header-file SVG parse. The output of the parser is a list of cubic bezier shapes..",
"homepage": "https://github.com/memononen/nanosvg",
"license": "Zlib",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
}
]
}
13 changes: 0 additions & 13 deletions ports/wxwidgets/fix-build.patch

This file was deleted.

57 changes: 21 additions & 36 deletions ports/wxwidgets/fix-libs-export.patch
Original file line number Diff line number Diff line change
@@ -1,36 +1,21 @@
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,7 +41,30 @@ 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 $<$<CONFIG:DEBUG>:LIB_PATH>
+ # Or $<$<NOT:$<CONFIG:DEBUG>>:LIB_PATH>
+ if(dep MATCHES "^(.+>):(.+)>$")
+ if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND CMAKE_MATCH_1 STREQUAL [[$<$<NOT:$<CONFIG:DEBUG>>]])
+ continue()
+ elseif(CMAKE_BUILD_TYPE STREQUAL "Release" AND CMAKE_MATCH_1 STREQUAL [[$<$<CONFIG:DEBUG>]])
+ continue()
+ endif()
+ set(dep_name "${CMAKE_MATCH_2}")
+ else()
+ set(dep_name ${dep})
+ endif()
+ endif()
+ if(dep_name STREQUAL "libc.so")
+ continue() # don't include this library
+ elseif(dep_name MATCHES "^-") # -l, -framework, -weak_framework
+ # ok
+ elseif(dep_name MATCHES "^lib(.*)(.so|.dylib|.tbd|.a)$")
+ set(dep_name "-l${CMAKE_MATCH_1} ")
+ elseif(dep_name)
+ get_filename_component(abs_path ${dep_name} PATH)
+ if (NOT abs_path)
+ set(dep_name "-l${dep_name} ")
+ endif()
endif()
wx_string_append(${var} "${dep_name} ")
endforeach()
diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake
index 52ae69d3f6..f261d5d262 100644
--- a/build/cmake/config.cmake
+++ b/build/cmake/config.cmake
@@ -39,8 +39,14 @@ macro(wx_get_dependencies var lib)
else()
# For the value like $<$<CONFIG:DEBUG>:LIB_PATH>
# Or $<$<NOT:$<CONFIG:DEBUG>>:LIB_PATH>
- string(REGEX REPLACE "^.+>:(.+)>$" "\\1" dep_name ${dep})
- if (NOT dep_name)
+ if(dep MATCHES "^(.+>):(.+)>$")
+ if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND CMAKE_MATCH_1 STREQUAL [[$<$<NOT:$<CONFIG:DEBUG>>]])
+ continue()
+ elseif(CMAKE_BUILD_TYPE STREQUAL "Release" AND CMAKE_MATCH_1 STREQUAL [[$<$<CONFIG:DEBUG>]])
+ continue()
+ endif()
+ set(dep_name "${CMAKE_MATCH_2}")
+ else()
set(dep_name ${dep})
endif()
endif()
15 changes: 0 additions & 15 deletions ports/wxwidgets/fix-linux-configure.patch

This file was deleted.

51 changes: 25 additions & 26 deletions ports/wxwidgets/install-layout.patch
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake
index 902b7c5..dba3d07 100644
--- a/build/cmake/functions.cmake
+++ b/build/cmake/functions.cmake
@@ -374,7 +374,7 @@ macro(wx_add_library name)
wx_install(TARGETS ${name}
LIBRARY DESTINATION "lib${wxPLATFORM_LIB_DIR}"
ARCHIVE DESTINATION "lib${wxPLATFORM_LIB_DIR}"
- RUNTIME DESTINATION "lib${wxPLATFORM_LIB_DIR}"
+ RUNTIME DESTINATION "bin"
BUNDLE DESTINATION Applications/wxWidgets
)
endif()
diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
index 0bc4f93..65fe3b8 100644
index b5175236e2..8c9275974f 100644
--- a/build/cmake/init.cmake
+++ b/build/cmake/init.cmake
@@ -149,7 +149,7 @@ else()
set(wxCOMPILER_PREFIX)
@@ -146,7 +146,7 @@ if(WIN32)
endif()
endif()

-if(MSVC)
+if(MSVC AND NOT wxBUILD_DISABLE_PLATFORM_LIB_DIR)
-if(WIN32_MSVC_NAMING)
+if(WIN32_MSVC_NAMING AND NOT wxBUILD_DISABLE_PLATFORM_LIB_DIR)
if(wxBUILD_SHARED)
set(lib_suffix "dll")
set(lib_suffix "_dll")
else()
index 9e6aafa900..defd196d2e 100644
--- a/build/cmake/functions.cmake
+++ b/build/cmake/functions.cmake
@@ -417,7 +417,7 @@ macro(wx_add_library name)

# Setup install
set(runtime_dir "lib")
- if(WIN32 AND NOT WIN32_MSVC_NAMING)
+ if(VCPKG_TOOLCHAIN OR (WIN32 AND NOT WIN32_MSVC_NAMING))
# configure puts the .dll in the bin directory
set(runtime_dir "bin")
endif()
diff --git a/build/cmake/install.cmake b/build/cmake/install.cmake
index 968dff8..5b4fda9 100644
index 7902646ef4..04ccd1aba7 100644
--- a/build/cmake/install.cmake
+++ b/build/cmake/install.cmake
@@ -45,7 +45,7 @@ else()
@@ -48,7 +48,7 @@ else()

install(DIRECTORY DESTINATION "bin")
install(CODE "execute_process( \
Expand All @@ -38,15 +37,15 @@ index 968dff8..5b4fda9 100644
${CMAKE_INSTALL_PREFIX}/bin/wx-config \
)"
diff --git a/build/cmake/utils/CMakeLists.txt b/build/cmake/utils/CMakeLists.txt
index 4108d6a..19d730e 100644
index 2b3a22834d..e0e964db9d 100644
--- a/build/cmake/utils/CMakeLists.txt
+++ b/build/cmake/utils/CMakeLists.txt
@@ -39,7 +39,7 @@ if(wxUSE_XRC)
)"
)
@@ -41,7 +41,7 @@ if(wxUSE_XRC)
endif()

install(CODE "execute_process( \
- COMMAND ${CMAKE_COMMAND} -E create_symlink \
+ COMMAND ${CMAKE_COMMAND} -E copy \
${CMAKE_INSTALL_PREFIX}/bin/wxrc-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${EXE_SUFFIX} \
${CMAKE_INSTALL_PREFIX}/bin/${wxrc_output_name}${EXE_SUFFIX} \
${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX} \
)"
35 changes: 35 additions & 0 deletions ports/wxwidgets/nanosvg-ext-depend.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
index 8c9275974f..3758261299 100644
--- a/build/cmake/init.cmake
+++ b/build/cmake/init.cmake
@@ -615,3 +615,6 @@ if(wxBUILD_PRECOMP)
wx_option_force_value(wxBUILD_PRECOMP OFF)
endif()
endif(wxBUILD_PRECOMP)
+
+find_package(unofficial-nanosvg CONFIG REQUIRED)
+list(APPEND wxTOOLKIT_LIBRARIES unofficial::nanosvg::nanosvg)
diff --git a/src/generic/bmpsvg.cpp b/src/generic/bmpsvg.cpp
index 76f20dce4c..7a7c24b4dd 100644
--- a/src/generic/bmpsvg.cpp
+++ b/src/generic/bmpsvg.cpp
@@ -26,7 +26,7 @@
// your source tree doesn't contain 3rdparty/nanosvg and you should initialize
// and update the corresponding submodule.
#ifdef __has_include
- #if ! __has_include("../../3rdparty/nanosvg/src/nanosvg.h")
+ #if 0
#error You need to run "git submodule update --init 3rdparty/nanosvg".
#undef wxHAS_SVG
#endif
@@ -60,8 +60,8 @@
#define NANOSVG_IMPLEMENTATION
#define NANOSVGRAST_IMPLEMENTATION
#define NANOSVG_ALL_COLOR_KEYWORDS
-#include "../../3rdparty/nanosvg/src/nanosvg.h"
-#include "../../3rdparty/nanosvg/src/nanosvgrast.h"
+#include <nanosvg.h>
+#include <nanosvgrast.h>

#ifdef __VISUALC__
#pragma warning(pop)
19 changes: 12 additions & 7 deletions ports/wxwidgets/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO wxWidgets/wxWidgets
REF 9c0a8be1dc32063d91ed1901fd5fcd54f4f955a1 #v3.1.5
SHA512 33817f766b36d24e5e6f4eb7666f2e4c1ec305063cb26190001e0fc82ce73decc18697e8005da990a1c99dc1ccdac9b45bb2bbe5ba73e6e2aa860c768583314c
REF 35a6d7b15fedfdb5198bb6c28b31cda33b2c2a76 #v3.1.6-final
SHA512 f42b97a695e037130da9935e3abf117c0720325f194fcdabace95fa16a5ca06d49e35db9616bb0ef16600044397739459551a6276f3c239bd4fc160ecb6cdc16
HEAD_REF master
PATCHES
install-layout.patch
mingw-output-name.patch
fix-build.patch
fix-linux-configure.patch # Remove this patch in the next update
fix-libs-export.patch
relocatable-wx-config.patch
nanosvg-ext-depend.patch
fix-libs-export.patch
)

if(VCPKG_TARGET_IS_LINUX)
Expand All @@ -31,6 +29,12 @@ These development packages can be installed on Ubuntu systems via
endforeach()
endif()

vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
sound wxUSE_SOUND
)

set(OPTIONS "")
if(VCPKG_TARGET_IS_OSX)
list(APPEND OPTIONS -DCOTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES=9999)
Expand Down Expand Up @@ -75,7 +79,8 @@ endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DwxUSE_REGEX=builtin
${FEATURE_OPTIONS}
-DwxUSE_REGEX=sys
-DwxUSE_ZLIB=sys
-DwxUSE_EXPAT=sys
-DwxUSE_LIBJPEG=sys
Expand Down
18 changes: 16 additions & 2 deletions ports/wxwidgets/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "wxwidgets",
"version-semver": "3.1.5",
"port-version": 11,
"version": "3.1.6",
"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 All @@ -19,6 +18,8 @@
"expat",
"libjpeg-turbo",
"libpng",
"nanosvg",
"pcre2",
"tiff",
{
"name": "vcpkg-cmake",
Expand All @@ -30,9 +31,22 @@
},
"zlib"
],
"default-features": [
"sound"
],
"features": {
"example": {
"description": "Example source code and CMake project"
},
"sound": {
"description": "Build wxSound support",
"dependencies": [
{
"name": "sdl2",
"default-features": false,
"platform": "!windows & !osx"
}
]
}
}
}
8 changes: 6 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4776,6 +4776,10 @@
"baseline": "2019-08-20",
"port-version": 2
},
"nanosvg": {
"baseline": "2022-04-29",
"port-version": 0
},
"nanovg": {
"baseline": "2019-08-30",
"port-version": 5
Expand Down Expand Up @@ -7533,8 +7537,8 @@
"port-version": 0
},
"wxwidgets": {
"baseline": "3.1.5",
"port-version": 11
"baseline": "3.1.6",
"port-version": 0
},
"x-plane": {
"baseline": "3.0.3",
Expand Down
9 changes: 9 additions & 0 deletions versions/n-/nanosvg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "827223ed18553b608489e328101549261d0c9d5a",
"version-date": "2022-04-29",
"port-version": 0
}
]
}
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": "16d9f0aabf4f0df68bebd7b42ff6005d952f9392",
"version": "3.1.6",
"port-version": 0
},
{
"git-tree": "3f891e383d71c7665ba49dcc254d8b2094c00c2b",
"version-semver": "3.1.5",
Expand Down