Package: assimp
Version: 3.3.1~dfsg-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: [email protected]
Usertags: mips-patch
Hi,
Package assimp FTBFS on big-endian architectures with following error:
In file included from /«PKGBUILDDIR»/code/glTFAsset.h:65:0,
from /«PKGBUILDDIR»/code/glTFImporter.cpp:55:
/«PKGBUILDDIR»/code/glTFAsset.inl: In member function 'void
glTF::Asset::ReadBinaryHeader(Assimp::IOStream&)':
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been
declared
# define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAsset.inl:906:5: note: in expansion of macro 'AI_SWAP4'
AI_SWAP4(header.version);
^~~~~~~~
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been
declared
# define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAsset.inl:912:5: note: in expansion of macro 'AI_SWAP4'
AI_SWAP4(header.sceneFormat);
^~~~~~~~
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been
declared
# define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAsset.inl:917:5: note: in expansion of macro 'AI_SWAP4'
AI_SWAP4(header.length);
^~~~~~~~
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been
declared
# define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAsset.inl:918:5: note: in expansion of macro 'AI_SWAP4'
AI_SWAP4(header.sceneLength);
^~~~~~~~
/«PKGBUILDDIR»/code/glTFAssetWriter.inl: In member function 'void
glTF::AssetWriter::WriteBinaryData(Assimp::IOStream*, size_t)':
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been
declared
# define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAssetWriter.inl:397:9: note: in expansion of macro
'AI_SWAP4'
AI_SWAP4(header.version);
^~~~~~~~
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been
declared
# define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAssetWriter.inl:400:9: note: in expansion of macro
'AI_SWAP4'
AI_SWAP4(header.length);
^~~~~~~~
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been
declared
# define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAssetWriter.inl:403:9: note: in expansion of macro
'AI_SWAP4'
AI_SWAP4(header.sceneLength);
^~~~~~~~
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been
declared
# define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAssetWriter.inl:406:9: note: in expansion of macro
'AI_SWAP4'
AI_SWAP4(header.sceneFormat);
^~~~~~~~
build logs:
https://buildd.debian.org/status/fetch.php?pkg=assimp&arch=hppa&ver=3.3.1%7Edfsg-1&stamp=1470683943
https://buildd.debian.org/status/fetch.php?pkg=assimp&arch=m68k&ver=3.3.1%7Edfsg-1&stamp=1470682578
https://buildd.debian.org/status/fetch.php?pkg=assimp&arch=mips&ver=3.3.1%7Edfsg-1&stamp=1470684366
https://buildd.debian.org/status/fetch.php?pkg=assimp&arch=powerpc&ver=3.3.1%7Edfsg-1&stamp=1470676134
https://buildd.debian.org/status/fetch.php?pkg=assimp&arch=ppc64&ver=3.3.1%7Edfsg-1&stamp=1470681578
https://buildd.debian.org/status/fetch.php?pkg=assimp&arch=s390x&ver=3.3.1%7Edfsg-1&stamp=1470677803
https://buildd.debian.org/status/fetch.php?pkg=assimp&arch=sparc64&ver=3.3.1%7Edfsg-1&stamp=1470842903
Macros aren't namespaced, pre-processor knows nothing about namespaces.
AI_SWAP4(p) is just replaced with ByteSwap::Swap4(&(p)) function call, because
of a missing namespace the compiler can't find the ByteSwap class.
The attached patch fixes the build errors for big-endian architectures by adding
the missing "using namespace Assimp" to glTFAsset.inl file.
With this patch I was able to build assimp successfully for mips.
It may fix the build for other architectures too.
Regards,
Daniel
--- assimp-3.3.1~dfsg.orig/code/glTFAsset.inl
+++ assimp-3.3.1~dfsg/code/glTFAsset.inl
@@ -40,6 +40,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE
#include "StringUtils.h"
+using namespace Assimp;
+
namespace glTF {
namespace {