Skip to content

Commit

Permalink
[magnum/magnum-plugins] Fix patches for --head builds (#10158)
Browse files Browse the repository at this point in the history
* [magnum] Update patches for --head builds

Signed-off-by: Squareys <[email protected]>

* [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 <[email protected]>

* [corrade] Remove obsolete warning and flag

Signed-off-by: Squareys <[email protected]>

* [magnum] Rename patches to reflect order of application

Signed-off-by: Squareys <[email protected]>

* [corrade/magnum/magnum-plugins] Update port versions

Signed-off-by: Squareys <[email protected]>
  • Loading branch information
Squareys authored Mar 28, 2020
1 parent 9efff11 commit edfce3b
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 44 deletions.
2 changes: 1 addition & 1 deletion ports/corrade/CONTROL
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 0 additions & 10 deletions ports/corrade/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 0 additions & 27 deletions ports/magnum-plugins/003-use-outdated-basisu.patch

This file was deleted.

2 changes: 1 addition & 1 deletion ports/magnum-plugins/CONTROL
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
1 change: 0 additions & 1 deletion ports/magnum-plugins/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
File renamed without changes.
43 changes: 43 additions & 0 deletions ports/magnum/002-sdl-includes-head.patch
Original file line number Diff line number Diff line change
@@ -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 <SDL.h>
+#include <SDL2/SDL.h>
#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 <SDL_keycode.h>
-#include <SDL_mouse.h>
-#include <SDL_version.h> /* huh, why is this not pulled in implicitly?! */
-#include <SDL_video.h>
-#include <SDL_scancode.h>
+#include <SDL2/SDL_keycode.h>
+#include <SDL2/SDL_mouse.h>
+#include <SDL2/SDL_version.h> /* huh, why is this not pulled in implicitly?! */
+#include <SDL2/SDL_video.h>
+#include <SDL2/SDL_scancode.h>

#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 <SDL_main.h> /* For SDL_WinRTRunApp */
+#include <SDL2/SDL_main.h> /* For SDL_WinRTRunApp */
#include <wrl.h> /* For the WinMain entrypoint */
#endif
#ifdef CORRADE_TARGET_CLANG_CL
File renamed without changes.
2 changes: 1 addition & 1 deletion ports/magnum/CONTROL
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
16 changes: 13 additions & 3 deletions ports/magnum/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
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
REF v2019.10
SHA512 b1c991199fa9b09b780ea822de4b2251c70fcc95e7f28bb14a6184861d92fcd4c6e6fe43ad21acfbfd191cd46e79bf58b867240ad6f706b07cd1fbe145b8eaff
HEAD_REF master
PATCHES
001-sdl-includes.patch
002-tools-path.patch
${_PATCHES}
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
Expand Down

0 comments on commit edfce3b

Please sign in to comment.