From 007144b1e642fa9699d4bf4e42a7678ef55f25c4 Mon Sep 17 00:00:00 2001 From: James Chang Date: Thu, 29 Nov 2018 01:47:15 +0800 Subject: [PATCH 1/4] [ogre] Update to 1.11.3 --- ports/ogre/001-cmake-install-dir.patch | 16 ++--- .../002-link-optimized-lib-workaround.patch | 37 ++++++++++++ ports/ogre/CONTROL | 2 +- ports/ogre/portfile.cmake | 60 +++++++++---------- 4 files changed, 74 insertions(+), 41 deletions(-) create mode 100644 ports/ogre/002-link-optimized-lib-workaround.patch diff --git a/ports/ogre/001-cmake-install-dir.patch b/ports/ogre/001-cmake-install-dir.patch index 27c6d2f70f..548f946f7e 100644 --- a/ports/ogre/001-cmake-install-dir.patch +++ b/ports/ogre/001-cmake-install-dir.patch @@ -1,5 +1,5 @@ ---- a/cmake/CMakeLists.txt -+++ b/cmake/CMakeLists.txt +--- a/CMake/CMakeLists.txt ++++ b/CMake/CMakeLists.txt @@ -13,10 +13,12 @@ # directory, but can also be used for custom projects. ############################################################# @@ -8,7 +8,7 @@ - set(OGRE_CMAKE_DIR "CMake") -else() - set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake") -+if (NOT DEFINED OGRE_CMAKE_DIR) ++if(NOT DEFINED OGRE_CMAKE_DIR) + if(WIN32 OR APPLE) + set(OGRE_CMAKE_DIR "CMake") + else() @@ -16,10 +16,10 @@ + endif() endif() - set(INST_FILES ---- a/cmake/InstallResources.cmake -+++ b/cmake/InstallResources.cmake -@@ -241,10 +241,12 @@ endif () + set(INST_FILES Utils/FindPkgMacros.cmake) +--- a/CMake/InstallResources.cmake ++++ b/CMake/InstallResources.cmake +@@ -242,10 +242,12 @@ # Create the CMake package files include(CMakePackageConfigHelpers) @@ -27,7 +27,7 @@ - set(OGRE_CMAKE_DIR "CMake") -else() - set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake") -+if (NOT DEFINED OGRE_CMAKE_DIR) ++if(NOT DEFINED OGRE_CMAKE_DIR) + if(WIN32 OR APPLE) + set(OGRE_CMAKE_DIR "CMake") + else() diff --git a/ports/ogre/002-link-optimized-lib-workaround.patch b/ports/ogre/002-link-optimized-lib-workaround.patch new file mode 100644 index 0000000000..b2678f488d --- /dev/null +++ b/ports/ogre/002-link-optimized-lib-workaround.patch @@ -0,0 +1,37 @@ +--- a/CMake/Dependencies.cmake ++++ b/CMake/Dependencies.cmake +@@ -199,6 +199,11 @@ + # Find zlib + find_package(ZLIB) + macro_log_feature(ZLIB_FOUND "zlib" "Simple data compression library" "http://www.zlib.net" FALSE "" "") ++# replace optimized/debug keyword with generator expression ++unset(ZLIB_LIBRARY) ++set(ZLIB_LIBRARY $<$:${ZLIB_LIBRARY_RELEASE}> $<$:${ZLIB_LIBRARY_DEBUG}>) ++unset(ZLIB_LIBRARIES) ++set(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) + + if (ZLIB_FOUND) + # Find zziplib +@@ -213,6 +218,11 @@ + # Find FreeType + find_package(Freetype) + macro_log_feature(FREETYPE_FOUND "freetype" "Portable font engine" "http://www.freetype.org" FALSE "" "") ++# replace optimized/debug keyword with generator expression ++unset(FREETYPE_LIBRARY) ++set(FREETYPE_LIBRARY $<$:${FREETYPE_LIBRARY_RELEASE}> $<$:${FREETYPE_LIBRARY_DEBUG}>) ++unset(FREETYPE_LIBRARIES) ++set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY}) + + # Find X11 + if (UNIX AND NOT APPLE AND NOT ANDROID AND NOT EMSCRIPTEN) +--- src.orig/CMake/Utils/FindPkgMacros.cmake ++++ src.new/CMake/Utils/FindPkgMacros.cmake +@@ -82,7 +82,7 @@ + if (${PREFIX}_FWK) + set(${PREFIX} ${${PREFIX}_FWK}) + elseif (${PREFIX}_REL AND ${PREFIX}_DBG) +- set(${PREFIX} optimized ${${PREFIX}_REL} debug ${${PREFIX}_DBG}) ++ set(${PREFIX} $<$:${${PREFIX}_REL}> $<$:${${PREFIX}_DBG}>) + elseif (${PREFIX}_REL) + set(${PREFIX} ${${PREFIX}_REL}) + elseif (${PREFIX}_DBG) diff --git a/ports/ogre/CONTROL b/ports/ogre/CONTROL index f7d93e7b25..0ec16b4de8 100644 --- a/ports/ogre/CONTROL +++ b/ports/ogre/CONTROL @@ -1,5 +1,5 @@ Source: ogre -Version: 1.10.11 +Version: 1.11.3 Build-Depends: freeimage, freetype, zlib, zziplib Description: 3D Object-Oriented Graphics Rendering Engine diff --git a/ports/ogre/portfile.cmake b/ports/ogre/portfile.cmake index 8281960c6f..4b4e63e021 100644 --- a/ports/ogre/portfile.cmake +++ b/ports/ogre/portfile.cmake @@ -3,15 +3,16 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO OGRECave/ogre - REF v1.10.11 - SHA512 2dfedd6f0a0de1a8c687c001439138b233200ca11e5c9940debf43d8a0380ca6472e0b5f4d599f0e22ca2049d0a5d34066ef41b6bc4912130694fa5d851fc900 + REF v1.11.3 + SHA512 af52821022ab6148e64fdf183b1aa4607b101c7d0edc20d2ccc909f50eed218d7a283fa3b58260fd41cd3f324ecafad8c5137c66e05786580b043240551b2c42 HEAD_REF master ) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES - "${CMAKE_CURRENT_LIST_DIR}/001-cmake-install-dir.patch" + ${CMAKE_CURRENT_LIST_DIR}/001-cmake-install-dir.patch + ${CMAKE_CURRENT_LIST_DIR}/002-link-optimized-lib-workaround.patch ) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) @@ -58,10 +59,7 @@ vcpkg_configure_cmake( -DOGRE_INSTALL_CMAKE=ON -DOGRE_INSTALL_VSPROPS=OFF -DOGRE_STATIC=${OGRE_STATIC} - -DOGRE_UNITY_BUILD=OFF - -DOGRE_USE_STD11=ON -DOGRE_CONFIG_THREAD_PROVIDER=std - -DOGRE_NODE_STORAGE_LEGACY=OFF -DOGRE_BUILD_RENDERSYSTEM_D3D11=ON -DOGRE_BUILD_RENDERSYSTEM_GL=ON -DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=ON @@ -95,33 +93,31 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link ${CURRENT_PACKAGES_DIR}/lib/manual-link) +if(NOT VCPKG_CMAKE_SYSTEM_NAME) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/OgreMain.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMain.lib) + else() + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/OgreMainStatic.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMainStatic.lib) + endif() + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/OgreMain_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/OgreMain_d.lib) + else() + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/OgreMainStatic_d.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMainStatic_d.lib) + endif() + endif() -file(GLOB MAIN_REL ${CURRENT_PACKAGES_DIR}/lib/OgreMain.lib ${CURRENT_PACKAGES_DIR}/lib/OgreMainStatic.lib) -file(COPY ${MAIN_REL} DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) -file(GLOB MAIN_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/OgreMain_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/OgreMainStatic_d.lib) -file(COPY ${MAIN_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) -file(REMOVE ${MAIN_REL} ${MAIN_DBG}) - -# Ogre installs custom cmake config files which don't follow the normal pattern. -# This normally makes them completely incompatible with multi-config generators, but with some effort it can be done. -file(READ "${CURRENT_PACKAGES_DIR}/share/ogre/OGREConfig.cmake" _contents) -string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${PACKAGE_PREFIX_DIR}" _contents "${_contents}") -string(REPLACE "SDL2main.lib" "SDL2main$<$:d>.lib" _contents "${_contents}") -string(REPLACE "SDL2.lib" "SDL2$<$:d>.lib" _contents "${_contents}") -string(REPLACE "\${PACKAGE_PREFIX_DIR}/lib" "\${PACKAGE_PREFIX_DIR}$<$:/debug>/lib" _contents "${_contents}") -string(REPLACE "{OGRE_PREFIX_DIR}/lib" "{OGRE_PREFIX_DIR}$<$:/debug>/lib" _contents "${_contents}") - -string(REPLACE "\"Ogre\${COMPONENT}\"" "\"Ogre\${COMPONENT}$<$:_d>\"" _contents "${_contents}") -string(REPLACE "\"Ogre\${COMPONENT}Static\"" "\"Ogre\${COMPONENT}Static$<$:_d>\"" _contents "${_contents}") - -string(REPLACE "\"\${TYPE}_\${COMPONENT}\"" "\"\${TYPE}_\${COMPONENT}$<$:_d>\"" _contents "${_contents}") -string(REPLACE "\"\${TYPE}_\${COMPONENT}Static\"" "\"\${TYPE}_\${COMPONENT}Static$<$:_d>\"" _contents "${_contents}") - -string(REPLACE "\"OgreMain\"" "\"\${PACKAGE_PREFIX_DIR}/lib/manual-link/OgreMain$<$:_d>.lib\"" _contents "${_contents}") -string(REPLACE "\"OgreMainStatic\"" "\"\${PACKAGE_PREFIX_DIR}/lib/manual-link/OgreMainStatic$<$:_d>.lib\"" _contents "${_contents}") - -file(WRITE "${CURRENT_PACKAGES_DIR}/share/ogre/OGREConfig.cmake" "${_contents}") + file(GLOB SHARE_FILES ${CURRENT_PACKAGES_DIR}/share/ogre/*.cmake) + foreach(SHARE_FILE ${SHARE_FILES}) + file(READ "${SHARE_FILE}" _contents) + string(REPLACE "lib/OgreMain" "lib/manual-link/OgreMain" _contents "${_contents}") + file(WRITE "${SHARE_FILE}" "${_contents}") + endforeach() +endif() # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ogre RENAME copyright) From 3ade65784513552ccea874baf73d57800bab9e5c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 28 Nov 2018 23:23:38 -0800 Subject: [PATCH 2/4] [ogre] Slight modernization --- ports/ogre/CONTROL | 2 +- ports/ogre/portfile.cmake | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ports/ogre/CONTROL b/ports/ogre/CONTROL index 0ec16b4de8..9930486e4e 100644 --- a/ports/ogre/CONTROL +++ b/ports/ogre/CONTROL @@ -1,5 +1,5 @@ Source: ogre -Version: 1.11.3 +Version: 1.11.3-1 Build-Depends: freeimage, freetype, zlib, zziplib Description: 3D Object-Oriented Graphics Rendering Engine diff --git a/ports/ogre/portfile.cmake b/ports/ogre/portfile.cmake index 4b4e63e021..8d4e0b490b 100644 --- a/ports/ogre/portfile.cmake +++ b/ports/ogre/portfile.cmake @@ -6,13 +6,9 @@ vcpkg_from_github( REF v1.11.3 SHA512 af52821022ab6148e64fdf183b1aa4607b101c7d0edc20d2ccc909f50eed218d7a283fa3b58260fd41cd3f324ecafad8c5137c66e05786580b043240551b2c42 HEAD_REF master -) - -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} PATCHES - ${CMAKE_CURRENT_LIST_DIR}/001-cmake-install-dir.patch - ${CMAKE_CURRENT_LIST_DIR}/002-link-optimized-lib-workaround.patch + 001-cmake-install-dir.patch + 002-link-optimized-lib-workaround.patch ) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) From ad29f3823f31464aa3cac70c2d853f6d82ad1bec Mon Sep 17 00:00:00 2001 From: Phil Christensen Date: Tue, 4 Dec 2018 14:49:47 -0800 Subject: [PATCH 3/4] [ogre] bump CONTROL version number --- ports/ogre/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/ogre/CONTROL b/ports/ogre/CONTROL index 9930486e4e..4ce413bfbf 100644 --- a/ports/ogre/CONTROL +++ b/ports/ogre/CONTROL @@ -1,5 +1,5 @@ Source: ogre -Version: 1.11.3-1 +Version: 1.11.3-2 Build-Depends: freeimage, freetype, zlib, zziplib Description: 3D Object-Oriented Graphics Rendering Engine From 457ca501f56b68cdc93273c76d0e8fe6b9805ff1 Mon Sep 17 00:00:00 2001 From: Phil Christensen Date: Thu, 6 Dec 2018 14:13:02 -0800 Subject: [PATCH 4/4] [ogre] add missing 'debug' to rename path --- ports/ogre/CONTROL | 2 +- ports/ogre/portfile.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/ogre/CONTROL b/ports/ogre/CONTROL index 4ce413bfbf..288e558e94 100644 --- a/ports/ogre/CONTROL +++ b/ports/ogre/CONTROL @@ -1,5 +1,5 @@ Source: ogre -Version: 1.11.3-2 +Version: 1.11.3-3 Build-Depends: freeimage, freetype, zlib, zziplib Description: 3D Object-Oriented Graphics Rendering Engine diff --git a/ports/ogre/portfile.cmake b/ports/ogre/portfile.cmake index 8d4e0b490b..74cb8a1c0a 100644 --- a/ports/ogre/portfile.cmake +++ b/ports/ogre/portfile.cmake @@ -103,7 +103,7 @@ if(NOT VCPKG_CMAKE_SYSTEM_NAME) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/OgreMain_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/OgreMain_d.lib) else() - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/OgreMainStatic_d.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMainStatic_d.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/OgreMainStatic_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/OgreMainStatic_d.lib) endif() endif()