From edfce3b4558644d61fbef4c88ff4bd106b0809f8 Mon Sep 17 00:00:00 2001 From: Jonathan Hale Date: Sat, 28 Mar 2020 04:37:33 +0100 Subject: [magnum/magnum-plugins] Fix patches for --head builds (#10158) * [magnum] Update patches for --head builds Signed-off-by: Squareys * [magnum-plugins] Remove obsolete patch Since basisu port has been updated, we can now use it without patching the magnum-plugins code for compatibility. Signed-off-by: Squareys * [corrade] Remove obsolete warning and flag Signed-off-by: Squareys * [magnum] Rename patches to reflect order of application Signed-off-by: Squareys * [corrade/magnum/magnum-plugins] Update port versions Signed-off-by: Squareys --- ports/corrade/CONTROL | 2 +- ports/corrade/portfile.cmake | 10 ----- ports/magnum-plugins/003-use-outdated-basisu.patch | 27 -------------- ports/magnum-plugins/CONTROL | 2 +- ports/magnum-plugins/portfile.cmake | 1 - ports/magnum/001-sdl-includes.patch | 36 ------------------ ports/magnum/001-tools-path.patch | 26 +++++++++++++ ports/magnum/002-sdl-includes-head.patch | 43 ++++++++++++++++++++++ ports/magnum/002-sdl-includes.patch | 36 ++++++++++++++++++ ports/magnum/002-tools-path.patch | 26 ------------- ports/magnum/CONTROL | 2 +- ports/magnum/portfile.cmake | 16 ++++++-- 12 files changed, 121 insertions(+), 106 deletions(-) delete mode 100644 ports/magnum-plugins/003-use-outdated-basisu.patch delete mode 100644 ports/magnum/001-sdl-includes.patch create mode 100644 ports/magnum/001-tools-path.patch create mode 100644 ports/magnum/002-sdl-includes-head.patch create mode 100644 ports/magnum/002-sdl-includes.patch delete mode 100644 ports/magnum/002-tools-path.patch diff --git a/ports/corrade/CONTROL b/ports/corrade/CONTROL index a8217b2e8..091144941 100644 --- a/ports/corrade/CONTROL +++ b/ports/corrade/CONTROL @@ -1,5 +1,5 @@ Source: corrade -Version: 2019.10 +Version: 2019.10-1 Description: C++11/C++14 multiplatform utility library Homepage: https://magnum.graphics/corrade/ Default-Features: interconnect, pluginmanager, testsuite, utility diff --git a/ports/corrade/portfile.cmake b/ports/corrade/portfile.cmake index 76f76959b..3c82bd94b 100644 --- a/ports/corrade/portfile.cmake +++ b/ports/corrade/portfile.cmake @@ -25,16 +25,6 @@ foreach(_feature IN LISTS ALL_FEATURES) endif() endforeach() -if(NOT VCPKG_CMAKE_SYSTEM_NAME) - # building for Windows desktop - if (VCPKG_PLATFORM_TOOLSET STREQUAL "v142" AND NOT VCPKG_USE_HEAD_VERSION) - message("**********") - message("WARNING: Visual Studio 2019 is not official supported by Corrade/Magnum team. Please use --head version if you intend to have upstream support.") - message("**********") - set(_CUSTOM_BUILD_FLAGS "-DCORRADE_MSVC2017_COMPATIBILITY=ON") - endif() -endif() - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja diff --git a/ports/magnum-plugins/003-use-outdated-basisu.patch b/ports/magnum-plugins/003-use-outdated-basisu.patch deleted file mode 100644 index 61e7c52ac..000000000 --- a/ports/magnum-plugins/003-use-outdated-basisu.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 4d59a1eafc7a5828a0dedc92a713b3394d5f64fc Mon Sep 17 00:00:00 2001 -From: Squareys -Date: Wed, 6 Nov 2019 18:45:17 +0100 -Subject: [PATCH] fix vcpkg build - ---- - src/MagnumPlugins/BasisImageConverter/BasisImageConverter.cpp | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/MagnumPlugins/BasisImageConverter/BasisImageConverter.cpp b/src/MagnumPlugins/BasisImageConverter/BasisImageConverter.cpp -index db3a39cb..d5c80b11 100644 ---- a/src/MagnumPlugins/BasisImageConverter/BasisImageConverter.cpp -+++ b/src/MagnumPlugins/BasisImageConverter/BasisImageConverter.cpp -@@ -106,7 +106,9 @@ Containers::Array BasisImageConverter::doExportToData(const ImageView2D& i - - /* Hierarchical virtual selector codebook options */ - PARAM_CONFIG_FIX_NAME(global_sel_pal, bool, "global_selector_palette"); -- PARAM_CONFIG_FIX_NAME(auto_global_sel_pal, bool, "auto_global_selector_palette"); -+ /* vcpkg version is begind 54304fa01443280bbaa9854f16c9f1756b17b40b, which changes name -+ * to m_auto_global_sel_pal */ -+ params.m_no_auto_global_sel_pal = !configuration().value("auto_global_selector_palette"); - PARAM_CONFIG_FIX_NAME(no_hybrid_sel_cb, bool, "no_hybrid_selector_codebook"); - PARAM_CONFIG_FIX_NAME(global_pal_bits, int, "global_palette_bits"); - PARAM_CONFIG_FIX_NAME(global_mod_bits, int, "global_modifier_bits"); --- -2.17.0.windows.1 - diff --git a/ports/magnum-plugins/CONTROL b/ports/magnum-plugins/CONTROL index 285c120fb..39d0d1016 100644 --- a/ports/magnum-plugins/CONTROL +++ b/ports/magnum-plugins/CONTROL @@ -1,5 +1,5 @@ Source: magnum-plugins -Version: 2019.10-1 +Version: 2019.10-2 Build-Depends: magnum[core] Description: Plugins for magnum, C++11/C++14 graphics middleware for games and data visualization Homepage: https://magnum.graphics/ diff --git a/ports/magnum-plugins/portfile.cmake b/ports/magnum-plugins/portfile.cmake index cf458cf1f..1fc50e203 100644 --- a/ports/magnum-plugins/portfile.cmake +++ b/ports/magnum-plugins/portfile.cmake @@ -17,7 +17,6 @@ vcpkg_from_github( PATCHES 001-tools-path.patch ${_RELEASE_ONLY_PATCHES} - 003-use-outdated-basisu.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) diff --git a/ports/magnum/001-sdl-includes.patch b/ports/magnum/001-sdl-includes.patch deleted file mode 100644 index b7ae6a446..000000000 --- a/ports/magnum/001-sdl-includes.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp -index 46ade2d00..24d8eabe7 100644 ---- a/src/Magnum/Platform/Sdl2Application.cpp -+++ b/src/Magnum/Platform/Sdl2Application.cpp -@@ -26,7 +26,7 @@ - #include "Sdl2Application.h" - - #include --#include -+#include - #ifndef CORRADE_TARGET_EMSCRIPTEN - #include - #else -diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h -index 1a50b1c72..45e88edf5 100644 ---- a/src/Magnum/Platform/Sdl2Application.h -+++ b/src/Magnum/Platform/Sdl2Application.h -@@ -46,13 +46,13 @@ - #define SDL_MAIN_HANDLED - #endif - /* SDL.h includes the world, adding 50k LOC. We don't want that either. */ --#include --#include --#include --#include -+#include -+#include -+#include -+#include - - #ifdef CORRADE_TARGET_WINDOWS_RT --#include /* For SDL_WinRTRunApp */ -+#include /* For SDL_WinRTRunApp */ - #include /* For the WinMain entrypoint */ - #endif - diff --git a/ports/magnum/001-tools-path.patch b/ports/magnum/001-tools-path.patch new file mode 100644 index 000000000..18a351c2e --- /dev/null +++ b/ports/magnum/001-tools-path.patch @@ -0,0 +1,26 @@ +diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake +index e63bc03..052006f 100644 +--- a/modules/FindCorrade.cmake ++++ b/modules/FindCorrade.cmake +@@ -397,7 +397,7 @@ foreach(_component ${Corrade_FIND_COMPONENTS}) + if(_component MATCHES ${_CORRADE_EXECUTABLE_COMPONENTS}) + add_executable(Corrade::${_component} IMPORTED) + +- find_program(CORRADE_${_COMPONENT}_EXECUTABLE corrade-${_component}) ++ find_program(CORRADE_${_COMPONENT}_EXECUTABLE corrade-${_component} PATH_SUFFIXES corrade) + mark_as_advanced(CORRADE_${_COMPONENT}_EXECUTABLE) + + if(CORRADE_${_COMPONENT}_EXECUTABLE) +diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake +index 8df555d..12f7aa4 100644 +--- a/modules/FindMagnum.cmake ++++ b/modules/FindMagnum.cmake +@@ -493,7 +493,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) + if(_component MATCHES ${_MAGNUM_EXECUTABLE_COMPONENTS}) + add_executable(Magnum::${_component} IMPORTED) + +- find_program(MAGNUM_${_COMPONENT}_EXECUTABLE magnum-${_component}) ++ find_program(MAGNUM_${_COMPONENT}_EXECUTABLE magnum-${_component} PATH_SUFFIXES magnum) + mark_as_advanced(MAGNUM_${_COMPONENT}_EXECUTABLE) + + if(MAGNUM_${_COMPONENT}_EXECUTABLE) diff --git a/ports/magnum/002-sdl-includes-head.patch b/ports/magnum/002-sdl-includes-head.patch new file mode 100644 index 000000000..fb2ffed8d --- /dev/null +++ b/ports/magnum/002-sdl-includes-head.patch @@ -0,0 +1,43 @@ +diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp +index 276c7ee55..90c52f3cb 100644 +--- a/src/Magnum/Platform/Sdl2Application.cpp ++++ b/src/Magnum/Platform/Sdl2Application.cpp +@@ -34,7 +34,7 @@ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpragma-pack" + #endif +-#include ++#include + #ifdef CORRADE_TARGET_CLANG_CL + #pragma clang diagnostic pop + #endif +diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h +index b2426d513..176729fdb 100644 +--- a/src/Magnum/Platform/Sdl2Application.h ++++ b/src/Magnum/Platform/Sdl2Application.h +@@ -57,11 +57,11 @@ + #pragma clang diagnostic ignored "-Wpragma-pack" + #endif + /* SDL.h includes the world, adding 50k LOC. We don't want that either. */ +-#include +-#include +-#include /* huh, why is this not pulled in implicitly?! */ +-#include +-#include ++#include ++#include ++#include /* huh, why is this not pulled in implicitly?! */ ++#include ++#include + + #ifdef CORRADE_TARGET_IOS + /* Including SDL_main.h unconditionally would mean it'd override Corrade::Main +@@ -74,7 +74,7 @@ + #endif + + #ifdef CORRADE_TARGET_WINDOWS_RT +-#include /* For SDL_WinRTRunApp */ ++#include /* For SDL_WinRTRunApp */ + #include /* For the WinMain entrypoint */ + #endif + #ifdef CORRADE_TARGET_CLANG_CL diff --git a/ports/magnum/002-sdl-includes.patch b/ports/magnum/002-sdl-includes.patch new file mode 100644 index 000000000..b7ae6a446 --- /dev/null +++ b/ports/magnum/002-sdl-includes.patch @@ -0,0 +1,36 @@ +diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp +index 46ade2d00..24d8eabe7 100644 +--- a/src/Magnum/Platform/Sdl2Application.cpp ++++ b/src/Magnum/Platform/Sdl2Application.cpp +@@ -26,7 +26,7 @@ + #include "Sdl2Application.h" + + #include +-#include ++#include + #ifndef CORRADE_TARGET_EMSCRIPTEN + #include + #else +diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h +index 1a50b1c72..45e88edf5 100644 +--- a/src/Magnum/Platform/Sdl2Application.h ++++ b/src/Magnum/Platform/Sdl2Application.h +@@ -46,13 +46,13 @@ + #define SDL_MAIN_HANDLED + #endif + /* SDL.h includes the world, adding 50k LOC. We don't want that either. */ +-#include +-#include +-#include +-#include ++#include ++#include ++#include ++#include + + #ifdef CORRADE_TARGET_WINDOWS_RT +-#include /* For SDL_WinRTRunApp */ ++#include /* For SDL_WinRTRunApp */ + #include /* For the WinMain entrypoint */ + #endif + diff --git a/ports/magnum/002-tools-path.patch b/ports/magnum/002-tools-path.patch deleted file mode 100644 index 18a351c2e..000000000 --- a/ports/magnum/002-tools-path.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake -index e63bc03..052006f 100644 ---- a/modules/FindCorrade.cmake -+++ b/modules/FindCorrade.cmake -@@ -397,7 +397,7 @@ foreach(_component ${Corrade_FIND_COMPONENTS}) - if(_component MATCHES ${_CORRADE_EXECUTABLE_COMPONENTS}) - add_executable(Corrade::${_component} IMPORTED) - -- find_program(CORRADE_${_COMPONENT}_EXECUTABLE corrade-${_component}) -+ find_program(CORRADE_${_COMPONENT}_EXECUTABLE corrade-${_component} PATH_SUFFIXES corrade) - mark_as_advanced(CORRADE_${_COMPONENT}_EXECUTABLE) - - if(CORRADE_${_COMPONENT}_EXECUTABLE) -diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake -index 8df555d..12f7aa4 100644 ---- a/modules/FindMagnum.cmake -+++ b/modules/FindMagnum.cmake -@@ -493,7 +493,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) - if(_component MATCHES ${_MAGNUM_EXECUTABLE_COMPONENTS}) - add_executable(Magnum::${_component} IMPORTED) - -- find_program(MAGNUM_${_COMPONENT}_EXECUTABLE magnum-${_component}) -+ find_program(MAGNUM_${_COMPONENT}_EXECUTABLE magnum-${_component} PATH_SUFFIXES magnum) - mark_as_advanced(MAGNUM_${_COMPONENT}_EXECUTABLE) - - if(MAGNUM_${_COMPONENT}_EXECUTABLE) diff --git a/ports/magnum/CONTROL b/ports/magnum/CONTROL index 0570cb4dc..2d7d69455 100644 --- a/ports/magnum/CONTROL +++ b/ports/magnum/CONTROL @@ -1,5 +1,5 @@ Source: magnum -Version: 2019.10 +Version: 2019.10-1 Build-Depends: corrade[utility] Description: C++11/C++14 graphics middleware for games and data visualization Homepage: https://magnum.graphics/ diff --git a/ports/magnum/portfile.cmake b/ports/magnum/portfile.cmake index 113698702..7a13baccc 100644 --- a/ports/magnum/portfile.cmake +++ b/ports/magnum/portfile.cmake @@ -1,4 +1,15 @@ -include(vcpkg_common_functions) +# Patches that are independent of --head flag +set(_PATCHES 001-tools-path.patch) + +# Patches that are only applied to --head builds +if(VCPKG_USE_HEAD_VERSION) + list(APPEND _PATCHES 002-sdl-includes-head.patch) + +# Patches that are only applied to release builds +else() + list(APPEND _PATCHES 002-sdl-includes.patch) +endif() + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mosra/magnum @@ -6,8 +17,7 @@ vcpkg_from_github( SHA512 b1c991199fa9b09b780ea822de4b2251c70fcc95e7f28bb14a6184861d92fcd4c6e6fe43ad21acfbfd191cd46e79bf58b867240ad6f706b07cd1fbe145b8eaff HEAD_REF master PATCHES - 001-sdl-includes.patch - 002-tools-path.patch + ${_PATCHES} ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) -- cgit v1.2.3