commit:     5cc674352064a5cada27f14b2c98ba9b5f7a1261
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  5 16:05:57 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri Jun  5 16:06:13 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5cc67435

media-libs/assimp: Fix tests

Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 media-libs/assimp/assimp-5.0.1.ebuild              |  4 ++
 .../assimp-5.0.1-fix-aiGetLegalStringTest.patch    | 76 ++++++++++++++++++++++
 .../assimp/files/assimp-5.0.1-fix-unittests.patch  | 37 +++++++++++
 .../assimp/files/assimp-5.0.1-projectversion.patch | 22 +++++++
 .../assimp/files/assimp-5.0.1-versiontest.patch    | 23 +++++++
 5 files changed, 162 insertions(+)

diff --git a/media-libs/assimp/assimp-5.0.1.ebuild 
b/media-libs/assimp/assimp-5.0.1.ebuild
index 96281b1fd32..cb827e7ac42 100644
--- a/media-libs/assimp/assimp-5.0.1.ebuild
+++ b/media-libs/assimp/assimp-5.0.1.ebuild
@@ -35,6 +35,10 @@ PATCHES=(
        "${FILESDIR}/${PN}-5.0.0-unzip-of.patch"
        "${FILESDIR}/${PN}-5.0.0-findassimp.patch"
        "${FILESDIR}/${P}-GNUInstallDirs.patch" # bug 701912
+       "${FILESDIR}/${P}-projectversion.patch"
+       "${FILESDIR}/${P}-fix-unittests.patch"
+       "${FILESDIR}/${P}-fix-aiGetLegalStringTest.patch"
+       "${FILESDIR}/${P}-versiontest.patch"
 )
 
 src_configure() {

diff --git 
a/media-libs/assimp/files/assimp-5.0.1-fix-aiGetLegalStringTest.patch 
b/media-libs/assimp/files/assimp-5.0.1-fix-aiGetLegalStringTest.patch
new file mode 100644
index 00000000000..b0db38a0e8a
--- /dev/null
+++ b/media-libs/assimp/files/assimp-5.0.1-fix-aiGetLegalStringTest.patch
@@ -0,0 +1,76 @@
+From 059ee0e091f1c658c20202a9123bdf90fc7fa307 Mon Sep 17 00:00:00 2001
+From: RichardTea <[email protected]>
+Date: Fri, 11 Oct 2019 16:28:14 +0100
+Subject: [PATCH] Update assimp legal and version
+
+Will now report the major and minor versions specified in cmakelists
+---
+ code/Common/Version.cpp | 14 +++++---------
+ test/unit/utVersion.cpp |  2 +-
+ 2 files changed, 6 insertions(+), 10 deletions(-)
+
+diff --git a/code/Common/Version.cpp b/code/Common/Version.cpp
+index 868cfb06af..cf1da7d5ba 100644
+--- a/code/Common/Version.cpp
++++ b/code/Common/Version.cpp
+@@ -46,8 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
DAMAGE.
+ #include <assimp/scene.h>
+ #include "ScenePrivate.h"
+ 
+-static const unsigned int MajorVersion = 5;
+-static const unsigned int MinorVersion = 0;
++#include "revision.h"
+ 
+ // 
--------------------------------------------------------------------------------
+ // Legal information string - don't remove this.
+@@ -56,9 +55,9 @@ static const char* LEGAL_INFORMATION =
+ "Open Asset Import Library (Assimp).\n"
+ "A free C/C++ library to import various 3D file formats into applications\n\n"
+ 
+-"(c) 2008-2020, assimp team\n"
++"(c) 2006-2020, assimp team\n"
+ "License under the terms and conditions of the 3-clause BSD license\n"
+-"https://github.com/assimp/assimp\n";
++"http://assimp.org\n";
+ ;
+ 
+ // 
------------------------------------------------------------------------------------------------
+@@ -70,13 +69,13 @@ ASSIMP_API const char*  aiGetLegalString  ()    {
+ // 
------------------------------------------------------------------------------------------------
+ // Get Assimp minor version
+ ASSIMP_API unsigned int aiGetVersionMinor ()    {
+-    return MinorVersion;
++    return VER_MINOR;
+ }
+ 
+ // 
------------------------------------------------------------------------------------------------
+ // Get Assimp major version
+ ASSIMP_API unsigned int aiGetVersionMajor ()    {
+-    return MajorVersion;
++    return VER_MAJOR;
+ }
+ 
+ // 
------------------------------------------------------------------------------------------------
+@@ -104,9 +103,6 @@ ASSIMP_API unsigned int aiGetCompileFlags ()    {
+     return flags;
+ }
+ 
+-// include current build revision, which is even updated from time to time -- 
:-)
+-#include "revision.h"
+-
+ // 
------------------------------------------------------------------------------------------------
+ ASSIMP_API unsigned int aiGetVersionRevision() {
+     return GitVersion;
+diff --git a/test/unit/utVersion.cpp b/test/unit/utVersion.cpp
+index 233b2fb0b2..66e832baae 100644
+--- a/test/unit/utVersion.cpp
++++ b/test/unit/utVersion.cpp
+@@ -48,7 +48,7 @@ TEST_F( utVersion, aiGetLegalStringTest ) {
+     EXPECT_NE( lv, nullptr );
+     std::string text( lv );
+ 
+-    size_t pos( text.find( std::string( "2017" ) ) );
++    size_t pos( text.find( std::string( "2019" ) ) );
+     EXPECT_NE( pos, std::string::npos );
+ }
+ 

diff --git a/media-libs/assimp/files/assimp-5.0.1-fix-unittests.patch 
b/media-libs/assimp/files/assimp-5.0.1-fix-unittests.patch
new file mode 100644
index 00000000000..1b1efa02742
--- /dev/null
+++ b/media-libs/assimp/files/assimp-5.0.1-fix-unittests.patch
@@ -0,0 +1,37 @@
+From ecd413c86c031900832028c94c0d55488cf26a0a Mon Sep 17 00:00:00 2001
+From: Kim Kulling <[email protected]>
+Date: Sun, 6 Oct 2019 20:19:59 +0200
+Subject: [PATCH] Update utVersion.cpp
+
+Fix the unittests as well.
+---
+ test/unit/utVersion.cpp | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/test/unit/utVersion.cpp b/test/unit/utVersion.cpp
+index 5cfc91ccdd..233b2fb0b2 100644
+--- a/test/unit/utVersion.cpp
++++ b/test/unit/utVersion.cpp
+@@ -4,8 +4,6 @@ Open Asset Import Library (assimp)
+ 
+ Copyright (c) 2006-2019, assimp team
+ 
+-
+-
+ All rights reserved.
+ 
+ Redistribution and use of this software in source and binary forms,
+@@ -55,11 +53,11 @@ TEST_F( utVersion, aiGetLegalStringTest ) {
+ }
+ 
+ TEST_F( utVersion, aiGetVersionMinorTest ) {
+-    EXPECT_EQ( aiGetVersionMinor(), 1U );
++    EXPECT_EQ( aiGetVersionMinor(), 0U );
+ }
+     
+ TEST_F( utVersion, aiGetVersionMajorTest ) {
+-    EXPECT_EQ( aiGetVersionMajor(), 4U );
++    EXPECT_EQ( aiGetVersionMajor(), 5U );
+ }
+ 
+ TEST_F( utVersion, aiGetCompileFlagsTest ) {

diff --git a/media-libs/assimp/files/assimp-5.0.1-projectversion.patch 
b/media-libs/assimp/files/assimp-5.0.1-projectversion.patch
new file mode 100644
index 00000000000..ed82e1b0b4b
--- /dev/null
+++ b/media-libs/assimp/files/assimp-5.0.1-projectversion.patch
@@ -0,0 +1,22 @@
+From 13a2f22835cfe4093860de3e3d33782f854a2e58 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lo=C3=AFc?= <[email protected]>
+Date: Tue, 14 Jan 2020 16:26:24 +0100
+Subject: [PATCH] Fix Assimp patch version to match the last bug fix release
+
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 23b6f6d618..e14c4aa21f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -51,7 +51,7 @@ IF(HUNTER_ENABLED)
+   add_definitions(-DASSIMP_USE_HUNTER)
+ ENDIF(HUNTER_ENABLED)
+ 
+-PROJECT( Assimp VERSION 5.0.0 )
++PROJECT( Assimp VERSION 5.0.1 )
+ 
+ # All supported options ###############################################
+ 

diff --git a/media-libs/assimp/files/assimp-5.0.1-versiontest.patch 
b/media-libs/assimp/files/assimp-5.0.1-versiontest.patch
new file mode 100644
index 00000000000..8267fc004d6
--- /dev/null
+++ b/media-libs/assimp/files/assimp-5.0.1-versiontest.patch
@@ -0,0 +1,23 @@
+From 9aea72f70e3f10f7db903c24a2c19a7fd769e3b8 Mon Sep 17 00:00:00 2001
+From: Marc-Antoine Lortie <[email protected]>
+Date: Mon, 20 Jan 2020 09:14:04 -0500
+Subject: [PATCH] Changed date in test aiGetLegalStringTest to the appropriate
+ year.
+
+---
+ test/unit/utVersion.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/unit/utVersion.cpp b/test/unit/utVersion.cpp
+index ca54620533..aa75a26d85 100644
+--- a/test/unit/utVersion.cpp
++++ b/test/unit/utVersion.cpp
+@@ -48,7 +48,7 @@ TEST_F( utVersion, aiGetLegalStringTest ) {
+     EXPECT_NE( lv, nullptr );
+     std::string text( lv );
+ 
+-    size_t pos( text.find( std::string( "2019" ) ) );
++    size_t pos( text.find( std::string( "2020" ) ) );
+     EXPECT_NE( pos, std::string::npos );
+ }
+ 

Reply via email to