assimp: Update to 5.0.1
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
_realname=assimp
|
||||
pkgbase=mingw-w64-${_realname}
|
||||
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
|
||||
pkgver=4.1.0
|
||||
pkgrel=3
|
||||
pkgver=5.0.1
|
||||
pkgrel=1
|
||||
pkgdesc="Portable Open Source library to import various well-known 3D model formats in an uniform manner (mingw-w64)"
|
||||
arch=('any')
|
||||
license=('BSD')
|
||||
@@ -18,8 +18,8 @@ url="http://www.assimp.org"
|
||||
source=(${_realname}-${pkgver}.tar.gz::https://github.com/assimp/assimp/archive/v${pkgver}.tar.gz
|
||||
build-fixes.patch)
|
||||
options=('!strip' 'staticlibs')
|
||||
sha256sums=('3520b1e9793b93a2ca3b797199e16f40d61762617e072f2d525fad70f9678a71'
|
||||
'46b2392fbb122b66a4aa67e05c841ff44d8bfdfb0d9a153cb838c3e5263f2fdc')
|
||||
sha256sums=('11310ec1f2ad2cd46b95ba88faca8f7aaa1efe9aa12605c55e3de2b977b3dbfc'
|
||||
'8122b87256094833d8407ad8003c67916459e41472c5cfee58a55ed495d2f50c')
|
||||
|
||||
prepare() {
|
||||
cd ${_realname}-${pkgver}
|
||||
|
||||
@@ -10,81 +10,71 @@ diff -Naur assimp-4.0.1-orig/tools/assimp_view/assimp_view.h assimp-4.0.1/tools/
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
diff -Naur assimp-4.0.1-orig/tools/assimp_view/assimp_view.h assimp-4.0.1/tools/assimp_view/assimp_view.h
|
||||
--- assimp-4.0.1-orig/tools/assimp_view/assimp_view.h 2016-10-21 10:48:42.584965100 +0300
|
||||
+++ assimp-4.0.1/tools/assimp_view/assimp_view.h 2016-10-21 10:49:26.377751400 +0300
|
||||
@@ -183,7 +185,7 @@
|
||||
{
|
||||
// for unsigned types only ...
|
||||
intype mask = (0x1u << (sizeof(type)*8))-1;
|
||||
- return (type)max((intype)0,min(in,mask));
|
||||
+ return (type)std::max((intype)0,std::min(in,mask));
|
||||
}
|
||||
--- assimp-5.0.1/cmake-modules/FindRT.cmake.orig 2020-01-21 15:40:04.317303800 +0300
|
||||
+++ assimp-5.0.1/cmake-modules/FindRT.cmake 2020-01-21 15:46:50.122477100 +0300
|
||||
@@ -7,6 +7,7 @@
|
||||
# Source: https://gitlab.cern.ch/dss/eos/commit/44070e575faaa46bd998708ef03eedb381506ff0
|
||||
#
|
||||
|
||||
+if(NOT WIN32)
|
||||
if(RT_LIBRARIES)
|
||||
set(RT_FIND_QUIETLY TRUE)
|
||||
endif(RT_LIBRARIES)
|
||||
@@ -18,3 +19,4 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(rt DEFAULT_MSG RT_LIBRARY)
|
||||
mark_as_advanced(RT_LIBRARY)
|
||||
+endif()
|
||||
--- assimp-5.0.1/code/CmakeLists.txt.orig 2020-01-21 15:44:41.687075300 +0300
|
||||
+++ assimp-5.0.1/code/CmakeLists.txt 2020-01-21 15:44:45.512369800 +0300
|
||||
@@ -1011,7 +1011,7 @@
|
||||
# RT-extensions is used in "contrib/Open3DGC/o3dgcTimer.h" for collecting statistics. Pointed file
|
||||
# has implementation for different platforms: WIN32, __MACH__ and other ("else" block).
|
||||
FIND_PACKAGE(RT QUIET)
|
||||
-IF (NOT HUNTER_ENABLED AND (RT_FOUND OR MSVC))
|
||||
+IF (NOT HUNTER_ENABLED AND (RT_FOUND OR WIN32))
|
||||
SET( ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC 1 )
|
||||
ADD_DEFINITIONS( -DASSIMP_IMPORTER_GLTF_USE_OPEN3DGC=1 )
|
||||
ELSE ()
|
||||
--- assimp-5.0.1/code/Common/ZipArchiveIOSystem.cpp.orig 2020-01-21 15:45:32.779925400 +0300
|
||||
+++ assimp-5.0.1/code/Common/ZipArchiveIOSystem.cpp 2020-01-21 15:47:11.230264700 +0300
|
||||
@@ -148,7 +148,7 @@
|
||||
zlib_filefunc_def IOSystem2Unzip::get(IOSystem* pIOHandler) {
|
||||
zlib_filefunc_def mapping;
|
||||
|
||||
diff -Naur assimp-4.0.1-orig/tools/assimp_view/assimp_view.cpp assimp-4.0.1/tools/assimp_view/assimp_view.cpp
|
||||
--- assimp-4.0.1-orig/tools/assimp_view/assimp_view.cpp 2016-10-21 10:48:42.584965100 +0300
|
||||
+++ assimp-4.0.1/tools/assimp_view/assimp_view.cpp 2016-10-21 10:49:26.377751400 +0300
|
||||
@@ -42,7 +42,11 @@
|
||||
-#ifdef ASSIMP_USE_HUNTER
|
||||
+#if defined(ASSIMP_USE_HUNTER) || defined(__MINGW32__)
|
||||
mapping.zopen_file = (open_file_func)open;
|
||||
mapping.zread_file = (read_file_func)read;
|
||||
mapping.zwrite_file = (write_file_func)write;
|
||||
--- assimp-5.0.1/include/assimp/defs.h.orig 2020-01-21 16:00:20.225141000 +0300
|
||||
+++ assimp-5.0.1/include/assimp/defs.h 2020-01-21 16:00:52.351516500 +0300
|
||||
@@ -126,7 +126,7 @@
|
||||
* GENBOUNDINGBOXES */
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
-#ifdef _MSC_VER
|
||||
+#ifdef _WIN32
|
||||
# undef ASSIMP_API
|
||||
|
||||
#include "assimp_view.h"
|
||||
+#ifdef __MINGW32__
|
||||
+#include <mmsystem.h>
|
||||
+#else
|
||||
#include <timeapi.h>
|
||||
+#endif
|
||||
#include "StringUtils.h"
|
||||
#include <map>
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -135,7 +135,9 @@
|
||||
# ifdef ASSIMP_BUILD_DLL_EXPORT
|
||||
# define ASSIMP_API __declspec(dllexport)
|
||||
# define ASSIMP_API_WINONLY __declspec(dllexport)
|
||||
-# pragma warning (disable : 4251)
|
||||
+# ifdef _MSC_VER
|
||||
+# pragma warning (disable : 4251)
|
||||
+# endif
|
||||
|
||||
diff -Naur assimp-4.0.1-orig/tools/assimp_view/Display.cpp assimp-4.0.1/tools/assimp_view/Display.cpp
|
||||
--- assimp-4.0.1-orig/tools/assimp_view/Display.cpp 2016-10-21 10:48:46.191201000 +0300
|
||||
+++ assimp-4.0.1/tools/assimp_view/Display.cpp 2016-10-21 10:49:17.437250000 +0300
|
||||
@@ -2249,7 +2249,7 @@
|
||||
const float ny = (float)sRect.bottom;
|
||||
const float x = (float)sDesc.Width;
|
||||
const float y = (float)sDesc.Height;
|
||||
- float f = min((nx-30) / x,(ny-30) / y) * (m_fTextureZoom/1000.0f);
|
||||
+ float f = std::min((nx-30) / x,(ny-30) / y) * (m_fTextureZoom/1000.0f);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in
|
||||
@@ -168,7 +170,7 @@
|
||||
# define ASSIMP_API __attribute__ ((visibility("default")))
|
||||
# define ASSIMP_API_WINONLY
|
||||
# define AI_FORCE_INLINE inline
|
||||
-#endif // (defined _MSC_VER)
|
||||
+#endif // (defined _WIN32)
|
||||
|
||||
float fHalfX = (nx - (f * x)) / 2.0f;
|
||||
float fHalfY = (ny - (f * y)) / 2.0f;
|
||||
diff -Naur assimp-4.0.1-orig/tools/assimp_view/Material.cpp assimp-4.0.1/tools/assimp_view/Material.cpp
|
||||
--- assimp-4.0.1-orig/tools/assimp_view/Material.cpp 2016-07-08 20:29:51.000000000 +0300
|
||||
+++ assimp-4.0.1/tools/assimp_view/Material.cpp 2016-10-21 10:49:47.462604500 +0300
|
||||
@@ -275,7 +275,7 @@
|
||||
for (unsigned int i = 0; i < iSizeFound;++i)
|
||||
info.cFileName[i] = (CHAR)tolower(info.cFileName[i]);
|
||||
|
||||
- if (0 == memcmp(info.cFileName,szFile2, min(iSizeFound,iSize)))
|
||||
+ if (0 == memcmp(info.cFileName,szFile2, std::min(iSizeFound,iSize)))
|
||||
{
|
||||
// we have it. Build the full path ...
|
||||
char* sz = strrchr(szTempB,'*');
|
||||
diff -Naur assimp-4.0.1-orig/tools/assimp_view/MessageProc.cpp assimp-4.0.1/tools/assimp_view/MessageProc.cpp
|
||||
--- assimp-4.0.1-orig/tools/assimp_view/MessageProc.cpp 2016-07-08 20:29:51.000000000 +0300
|
||||
+++ assimp-4.0.1/tools/assimp_view/MessageProc.cpp 2016-10-21 10:50:42.072467800 +0300
|
||||
@@ -45,7 +45,11 @@
|
||||
|
||||
#include <windowsx.h>
|
||||
#include <commdlg.h>
|
||||
+#ifdef __MINGW32__
|
||||
+#include <mmsystem.h>
|
||||
+#else
|
||||
#include <timeapi.h>
|
||||
+#endif
|
||||
|
||||
namespace AssimpView {
|
||||
|
||||
@@ -1056,9 +1056,9 @@
|
||||
ai_assert(strlen(szFileName) <= MAX_PATH);
|
||||
|
||||
// invent a nice default file name
|
||||
- char* sz = max(strrchr(szFileName,'\\'),strrchr(szFileName,'/'));
|
||||
+ char* sz = std::max(strrchr(szFileName,'\\'),strrchr(szFileName,'/'));
|
||||
if (sz) {
|
||||
- strncpy(sz,max(strrchr(g_szFileName,'\\'),strrchr(g_szFileName,'/')),MAX_PATH);
|
||||
+ strncpy(sz,std::max(strrchr(g_szFileName,'\\'),strrchr(g_szFileName,'/')),MAX_PATH);
|
||||
}
|
||||
}
|
||||
else {
|
||||
#ifdef __GNUC__
|
||||
# define AI_WONT_RETURN_SUFFIX __attribute__((noreturn))
|
||||
|
||||
Reference in New Issue
Block a user