diff --git a/mingw-w64-ogre3d/011-mingw-check-security-coockie-not-available.patch b/mingw-w64-ogre3d/011-mingw-check-security-coockie-not-available.patch deleted file mode 100644 index 4a0ddd4436..0000000000 --- a/mingw-w64-ogre3d/011-mingw-check-security-coockie-not-available.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/RenderSystems/Direct3D9/src/OgreD3D9Plugin.cpp b/RenderSystems/Direct3D9/src/OgreD3D9Plugin.cpp -index 6c08fd5da0..84a48b58e9 100644 ---- a/RenderSystems/Direct3D9/src/OgreD3D9Plugin.cpp -+++ b/RenderSystems/Direct3D9/src/OgreD3D9Plugin.cpp -@@ -33,6 +33,7 @@ THE SOFTWARE. - extern "C" { - #include "OgreMinGWSupport.h" - void _chkstk(); -+void __security_check_cookie(intptr_t i); - } - #endif - -diff --git a/RenderSystems/Direct3D9/src/OgreMinGWSupport.cpp b/RenderSystems/Direct3D9/src/OgreMinGWSupport.cpp -index 4bc377ac09..9a6fef69d7 100644 ---- a/RenderSystems/Direct3D9/src/OgreMinGWSupport.cpp -+++ b/RenderSystems/Direct3D9/src/OgreMinGWSupport.cpp -@@ -44,7 +44,9 @@ extern "C" { - - // MSVC uses security cookies to prevent some buffer overflow attacks. - // provide dummy implementations. -- void __security_check_cookie(intptr_t i) -+ intptr_t __security_cookie; -+ -+ void __security_check_cookie(intptr_t i) - { - } - } diff --git a/mingw-w64-ogre3d/012-add-link-library.patch b/mingw-w64-ogre3d/012-add-link-library.patch deleted file mode 100644 index 2460c32346..0000000000 --- a/mingw-w64-ogre3d/012-add-link-library.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ogre3d-2.0.0.r7490.07ad8061ec8d/RenderSystems/Direct3D11/CMakeLists.txt.orig 2015-02-17 17:14:01.858800000 +0300 -+++ ogre3d-2.0.0.r7490.07ad8061ec8d/RenderSystems/Direct3D11/CMakeLists.txt 2015-02-17 17:14:34.821600000 +0300 -@@ -31,6 +31,9 @@ - if(OGRE_PROFILING AND DirectX9_FOUND) - target_link_libraries(RenderSystem_Direct3D11 ${DirectX9_LIBRARY}) - endif() -+if (MINGW) -+ target_link_libraries(RenderSystem_Direct3D11 psapi) -+endif () - - if(WINDOWS_STORE OR WINDOWS_PHONE) - set_target_properties(RenderSystem_Direct3D11 PROPERTIES VS_WINRT_COMPONENT "true") diff --git a/mingw-w64-ogre3d/014-custom-install.patch b/mingw-w64-ogre3d/014-custom-install.patch deleted file mode 100644 index 8b1c902549..0000000000 --- a/mingw-w64-ogre3d/014-custom-install.patch +++ /dev/null @@ -1,77 +0,0 @@ ---- ogre3d-1.11.1/CMake/CMakeLists.txt.orig 2015-02-18 06:49:28.643600000 +0300 -+++ ogre3d-1.11.1/CMake/CMakeLists.txt 2015-02-18 06:50:00.389600000 +0300 -@@ -13,7 +13,7 @@ - # directory, but can also be used for custom projects. - ############################################################# - --if(WIN32 OR APPLE) -+if(MSVC OR APPLE) - set(OGRE_CMAKE_DIR "CMake") - else() - set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake") ---- ogre3d-1.11.1/Docs/CMakeLists.txt.orig 2015-02-18 06:46:47.946600000 +0300 -+++ ogre3d-1.11.1/Docs/CMakeLists.txt 2015-02-18 06:47:05.325000000 +0300 -@@ -13,9 +13,9 @@ - ############################################################### - - # Set docs target directory --if (WIN32 OR APPLE) -+if (MSVC OR APPLE) - set(OGRE_DOCS_PATH "Docs") --elseif (UNIX) -+elseif (UNIX OR MINGW) - set(OGRE_DOCS_PATH "share/doc/OGRE") - endif () - ---- ogre3d-1.11.1/CMake/InstallResources.cmake.orig 2015-02-18 06:34:55.206800000 +0300 -+++ ogre3d-1.11.1/CMake/InstallResources.cmake 2015-02-18 06:42:48.448400000 +0300 -@@ -12,7 +12,7 @@ - ################################################################## - - if (WIN32) -- set(OGRE_MEDIA_PATH "Media") -+ set(OGRE_MEDIA_PATH "share/OGRE/Media") - set(OGRE_MEDIA_DIR_REL "${CMAKE_INSTALL_PREFIX}/${OGRE_MEDIA_PATH}") - set(OGRE_TEST_MEDIA_DIR_REL "../Tests/${OGRE_MEDIA_PATH}") - set(OGRE_PLUGIN_DIR_REL "${CMAKE_INSTALL_PREFIX}/bin") -@@ -242,7 +242,7 @@ - # Create the CMake package files - include(CMakePackageConfigHelpers) - --if(WIN32 OR APPLE) -+if(MSVC OR APPLE) - set(OGRE_CMAKE_DIR "CMake") - else() - set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake") ---- ogre3d-1.11.1/CMake/ConfigureBuild.cmake.orig 2015-02-18 06:56:58.156600000 +0300 -+++ ogre3d-1.11.1/CMake/ConfigureBuild.cmake 2015-02-18 06:58:52.333000000 +0300 -@@ -148,9 +148,13 @@ - endif () - - # Create the pkg-config package files on Unix systems --if (UNIX) -+if (UNIX OR MINGW) - set(OGRE_PLUGIN_PREFIX "") -- set(OGRE_PLUGIN_EXT ".so") -+ if (MINGW) -+ set(OGRE_PLUGIN_EXT ".dll") -+ else() -+ set(OGRE_PLUGIN_EXT ".so") -+ endif() - set(OGRE_PAGING_ADDITIONAL_PACKAGES "") - if (OGRE_STATIC) - set(OGRE_PLUGIN_PREFIX "lib") ---- ogre3d-1.12.0/Samples/CMakeLists.txt.orig 2015-02-18 13:59:42.807600000 +0300 -+++ ogre3d-1.12.0/Samples/CMakeLists.txt 2015-02-18 13:59:57.800200000 +0300 -@@ -81,9 +81,9 @@ - - # Install sample sources - if (OGRE_INSTALL_SAMPLES_SOURCE) -- if (WIN32 OR APPLE) -+ if (MSVC OR APPLE) - set(OGRE_SAMPLES_DIR Samples) -- elseif (UNIX) -+ elseif (UNIX OR MINGW) - set(OGRE_SAMPLES_DIR share/OGRE/Samples) - endif () - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${OGRE_SAMPLES_DIR} diff --git a/mingw-w64-ogre3d/014-install-pkhconfig-and-fix-plugin-extension.patch b/mingw-w64-ogre3d/014-install-pkhconfig-and-fix-plugin-extension.patch new file mode 100644 index 0000000000..63b8cc9033 --- /dev/null +++ b/mingw-w64-ogre3d/014-install-pkhconfig-and-fix-plugin-extension.patch @@ -0,0 +1,17 @@ +--- a/CMake/ConfigureBuild.cmake ++++ b/CMake/ConfigureBuild.cmake +@@ -156,8 +156,12 @@ + endif () + + # Create the pkg-config package files on Unix systems +-if (UNIX) +- set(OGRE_PLUGIN_EXT ".so") ++if (UNIX OR MINGW) ++ if (MINGW) ++ set(OGRE_PLUGIN_EXT ".dll") ++ else() ++ set(OGRE_PLUGIN_EXT ".so") ++ endif() + set(OGRE_PAGING_ADDITIONAL_PACKAGES "") + if (OGRE_STATIC) + set(OGRE_PLUGIN_EXT ".a") diff --git a/mingw-w64-ogre3d/020-dx11-mingw.patch b/mingw-w64-ogre3d/020-dx11-mingw.patch deleted file mode 100644 index 0466718004..0000000000 --- a/mingw-w64-ogre3d/020-dx11-mingw.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 3fafb147242f32079dd3b57b8a80ad9fbbb415cb Mon Sep 17 00:00:00 2001 -From: Pavel Rojtberg -Date: Sun, 25 Oct 2020 14:58:31 +0100 -Subject: [PATCH] CMake: DirectX11 - fix discovery when using MINGW and having - W10SDK - ---- - CMake/Packages/FindDirectX11.cmake | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMake/Packages/FindDirectX11.cmake b/CMake/Packages/FindDirectX11.cmake -index 64c2343cbd1..1122783b092 100644 ---- a/CMake/Packages/FindDirectX11.cmake -+++ b/CMake/Packages/FindDirectX11.cmake -@@ -18,7 +18,7 @@ if(WIN32) # The only platform it makes sense to check for DirectX11 SDK - include(FindPkgMacros) - findpkg_begin(DirectX11) - -- if( NOT MSVC90 ) -+ if( MSVC AND NOT MSVC90 ) - # Windows 10.x SDK - get_filename_component(kit10_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" REALPATH) - file(GLOB W10SDK_VERSIONS RELATIVE ${kit10_dir}/Include ${kit10_dir}/Include/10.*) # enumerate pre-release and not yet known release versions diff --git a/mingw-w64-ogre3d/021-aarch64.patch b/mingw-w64-ogre3d/021-aarch64.patch deleted file mode 100644 index b6ed039229..0000000000 --- a/mingw-w64-ogre3d/021-aarch64.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -bur ogre-1.12.6-c/OgreMain/src/OgrePlatformInformation.cpp ogre-1.12.6/OgreMain/src/OgrePlatformInformation.cpp ---- ogre-1.12.6-c/OgreMain/src/OgrePlatformInformation.cpp 2020-04-25 17:11:59.000000000 -0600 -+++ ogre-1.12.6/OgreMain/src/OgrePlatformInformation.cpp 2022-08-09 21:44:43.608972000 -0600 -@@ -36,7 +36,7 @@ - - #if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID - #include -- #elif OGRE_CPU == OGRE_CPU_ARM -+ #elif OGRE_CPU == OGRE_CPU_ARM && !defined(__MINGW32__) - #include - #if __MACH__ - #include diff --git a/mingw-w64-ogre3d/PKGBUILD b/mingw-w64-ogre3d/PKGBUILD index bb432a69c5..315c753a36 100644 --- a/mingw-w64-ogre3d/PKGBUILD +++ b/mingw-w64-ogre3d/PKGBUILD @@ -3,8 +3,9 @@ _realname=ogre3d pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=1.12.6 -pkgrel=6 +pkgver=13.4.4 +imgui_ver=1.87 +pkgrel=1 pkgdesc="A cross-platform 3D game engine (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') @@ -15,58 +16,57 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-pkg-config" "${MINGW_PACKAGE_PREFIX}-cmake" "${MINGW_PACKAGE_PREFIX}-swig" - "git") + "${MINGW_PACKAGE_PREFIX}-assimp" + "${MINGW_PACKAGE_PREFIX}-freeimage" + "${MINGW_PACKAGE_PREFIX}-openexr" + "${MINGW_PACKAGE_PREFIX}-pugixml" + "${MINGW_PACKAGE_PREFIX}-qt6-base") depends=("${MINGW_PACKAGE_PREFIX}-boost" - "${MINGW_PACKAGE_PREFIX}-cppunit" - "${MINGW_PACKAGE_PREFIX}-freeimage" + "${MINGW_PACKAGE_PREFIX}-bullet" "${MINGW_PACKAGE_PREFIX}-freetype" "${MINGW_PACKAGE_PREFIX}-glsl-optimizer" "${MINGW_PACKAGE_PREFIX}-hlsl2glsl" - "${MINGW_PACKAGE_PREFIX}-intel-tbb" - "${MINGW_PACKAGE_PREFIX}-openexr" "${MINGW_PACKAGE_PREFIX}-SDL2" - "${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-pugixml" "${MINGW_PACKAGE_PREFIX}-tinyxml" "${MINGW_PACKAGE_PREFIX}-winpthreads" - "${MINGW_PACKAGE_PREFIX}-zlib" - "${MINGW_PACKAGE_PREFIX}-zziplib") + "${MINGW_PACKAGE_PREFIX}-zlib") +optdepends=("${MINGW_PACKAGE_PREFIX}-assimp" + "${MINGW_PACKAGE_PREFIX}-freeimage" + "${MINGW_PACKAGE_PREFIX}-openexr" + "${MINGW_PACKAGE_PREFIX}-python: python bindings" + "${MINGW_PACKAGE_PREFIX}-pugixml" + "${MINGW_PACKAGE_PREFIX}-qt6-base: integration with the Qt Library for window creation and input") options=('staticlibs' '!strip') # '!buildflags' source=(${_realname}-${pkgver}.tar.gz::"https://github.com/OGRECave/ogre/archive/v${pkgver}.tar.gz" - git+https://github.com/ocornut/imgui.git#commit=e5cb04b132cba94f902beb6186cb58b864777012 + https://github.com/ocornut/imgui/archive/v${imgui_ver}.tar.gz 002-link-shared-freeimage.patch 004-use-mingw-w64-directx.patch 010-missing-include.patch - 011-mingw-check-security-coockie-not-available.patch - 012-add-link-library.patch - 014-custom-install.patch - 020-dx11-mingw.patch - 021-aarch64.patch) -sha256sums=('c6347094733b459b6e8bb10f6ae234a66b635e3ef4212ba536b8fa146a775acf' - 'SKIP' + 014-install-pkhconfig-and-fix-plugin-extension.patch) +sha256sums=('7cf05dbb3acbfc9326daecb60429a8ae9ce7625fb425e6a29de00cf77454596f' + 'b54ceb35bda38766e36b87c25edf7a1cd8fd2cb8c485b245aedca6fb85645a20' '67966d6e0791c5804ed5cbec116594ebb72e9633118c31458dfa16181fdd01b2' 'c7ca64dbd9a8f3f0271c12739807021a5c0782d254c4142c6e86746a96a44438' 'd4e812fceb3dadc20c85857e3e624654cbc6bd4ebd20990fed2e5e84adfa9272' - '60145b0dcbacc5da8528c0accc5a3fbe1f00fe81c1b14f312c2f128594eb93c4' - 'fb4db83c9d42358a63bf4a11792cdea43482d69f09d7da9467782af32ba1bfb7' - '12845dd3270a6b05ab52e982213a7f2687b51a09cd6b598c0550555d3d94ac6d' - '67a99e88d1d096e92849cffcf818f991c12edaeadeb8f96f0593bb41905d6e3e' - '10d671ead8a44f05fe6ae8a65118c843b4646b84c98774ad34b8d15267edc2a9') + '3794f51c0752492dd02f2b7fc150f210fe0b2b6ee8d8dc72740c009f258c55da') + +# Helper macros to help make tasks easier # +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying ${_patch}" + patch -Nbp1 -i "${srcdir}/${_patch}" + done +} prepare() { - # Workaround packaging bug - cp -rf imgui/* ogre-${pkgver}/Components/Overlay/src/imgui/ - cd "${srcdir}/ogre-${pkgver}" - patch -p1 -i ${srcdir}/002-link-shared-freeimage.patch - patch -p1 -i ${srcdir}/004-use-mingw-w64-directx.patch - patch -p1 -i ${srcdir}/010-missing-include.patch - patch -p1 -i ${srcdir}/011-mingw-check-security-coockie-not-available.patch - patch -p1 -i ${srcdir}/012-add-link-library.patch - patch -p1 -i ${srcdir}/014-custom-install.patch - # https://github.com/OGRECave/ogre/commit/3fafb147242f32079dd3b57b8a80ad9fbbb415cb - patch -p1 -i ${srcdir}/020-dx11-mingw.patch - patch -p1 -i ${srcdir}/021-aarch64.patch + apply_patch_with_msg \ + 002-link-shared-freeimage.patch \ + 004-use-mingw-w64-directx.patch \ + 010-missing-include.patch \ + 014-install-pkhconfig-and-fix-plugin-extension.patch } build() { @@ -77,12 +77,16 @@ build() { extra_config+=( -DCMAKE_BUILD_TYPE=Release ) fi + CXXFLAGS+=" -Wno-ignored-attributes -Wno-inconsistent-missing-override" + rm -rf ${srcdir}/build-${MSYSTEM} mkdir build-${MSYSTEM} && cd build-${MSYSTEM} + cp -r "${srcdir}"/imgui-${imgui_ver} . + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX" \ ${MINGW_PREFIX}/bin/cmake.exe \ - -G"MSYS Makefiles" \ + -G"Ninja" \ -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ -DOGRE_DEPENDENCIES_DIR=${MINGW_PREFIX} \ -DOGRE_INSTALL_TOOLS=ON \ @@ -103,16 +107,27 @@ build() { -DOGRE_INSTALL_SAMPLES=ON \ -DOGRE_CONFIG_FILESYSTEM_UNICODE=ON \ $([[ ${MSYSTEM_CARCH} == aarch64 ]] && echo "-DOGRE_BUILD_RENDERSYSTEM_D3D9=OFF") \ + -DOGRE_BUILD_TESTS=OFF \ + -DOGRE_INSTALL_PDB=OFF \ + -DOGRE_MEDIA_PATH=share/OGRE/Media \ + -DOGRE_CMAKE_DIR=lib/OGRE/cmake \ + -DOGRE_DOCS_PATH=share/doc/OGRE \ + -DOGRE_PLUGINS_PATH=lib/OGRE \ -DPYTHON_EXECUTABLE="${MINGW_PREFIX}/bin/python.exe" \ "${extra_config[@]}" \ ../ogre-${pkgver} - make + ${MINGW_PREFIX}/bin/cmake --build . } package() { cd "${srcdir}/build-${MSYSTEM}" - make -j1 DESTDIR=${pkgdir} install + DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install . + + local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) + for _f in "${pkgdir}${MINGW_PREFIX}"/lib/OGRE/cmake/*.cmake; do + sed -e "s|${PREFIX_WIN}|\$\{_IMPORT_PREFIX\}|g" -i ${_f} + done install -Dm0644 ${srcdir}/ogre-${pkgver}/LICENSE ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE mkdir -p ${pkgdir}${MINGW_PREFIX}/share/OGRE/Media/fonts