diff --git a/testing/alembic/0001-Big-endian-support.patch b/testing/alembic/0001-Big-endian-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..58e3cb258781f7048bc620ee2dabfbbcc37e6cce --- /dev/null +++ b/testing/alembic/0001-Big-endian-support.patch @@ -0,0 +1,97 @@ +From dca59953bcd4536cd10ecb11cb213b05523907bb Mon Sep 17 00:00:00 2001 +From: Damian Kurek <starfire24680@gmail.com> +Date: Thu, 29 Oct 2020 15:08:42 +0100 +Subject: [PATCH] Big endian support + +--- + lib/Alembic/Ogawa/IStreams.cpp | 30 +++++++++++++++--------------- + lib/Alembic/Ogawa/OStream.cpp | 14 -------------- + 2 files changed, 15 insertions(+), 29 deletions(-) + +diff --git a/lib/Alembic/Ogawa/IStreams.cpp b/lib/Alembic/Ogawa/IStreams.cpp +index 5927295d..c31f8028 100644 +--- a/lib/Alembic/Ogawa/IStreams.cpp ++++ b/lib/Alembic/Ogawa/IStreams.cpp +@@ -47,6 +47,7 @@ + #include <unistd.h> + #include <errno.h> + #include <cstring> ++ #include <endian.h> + + #elif defined(_WIN32) + +@@ -622,21 +623,6 @@ public: + + void init(IStreamReaderPtr iReader, size_t iNumStreams) + { +- // simple temporary endian check +- union +- { +- Util::uint32_t l; +- char c[4]; +- } u; +- +- u.l = 0x01234567; +- +- if (u.c[0] != 0x67) +- { +- throw std::runtime_error( +- "Ogawa currently only supports little-endian reading."); +- } +- + if (iNumStreams == 0 || iReader == NULL || !iReader->isOpen()) return; + + Alembic::Util::uint64_t firstGroupPos = 0; +@@ -655,10 +641,24 @@ public: + return; + } + bool filefrozen = (header[5] == char(0xff)); ++ ++ + Alembic::Util::uint16_t fileversion = (header[6] << 8) | header[7]; + Alembic::Util::uint64_t groupPos = *((Alembic::Util::uint64_t*) (&(header[8]))); + Alembic::Util::uint64_t filesize = iReader->size(); + ++ #if (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && __BYTE_ORDER == __BIG_ENDIAN) || (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN) ++ fileversion = (header[7] << 8) | header[6]; ++ groupPos = (groupPos>>56) | ++ ((groupPos<<40) & 0x00FF000000000000ULL) | ++ ((groupPos<<24) & 0x0000FF0000000000ULL) | ++ ((groupPos<<8) & 0x000000FF00000000ULL) | ++ ((groupPos>>8) & 0x00000000FF000000ULL) | ++ ((groupPos>>24) & 0x0000000000FF0000ULL) | ++ ((groupPos>>40) & 0x000000000000FF00ULL) | ++ (groupPos<<56); ++ #endif ++ + if (i == 0) + { + firstGroupPos = groupPos; +diff --git a/lib/Alembic/Ogawa/OStream.cpp b/lib/Alembic/Ogawa/OStream.cpp +index 59690285..083bccc5 100644 +--- a/lib/Alembic/Ogawa/OStream.cpp ++++ b/lib/Alembic/Ogawa/OStream.cpp +@@ -135,20 +135,6 @@ bool OStream::isValid() + + void OStream::init() + { +- // simple temporary endian check +- union { +- Util::uint32_t l; +- char c[4]; +- } u; +- +- u.l = 0x01234567; +- +- if (u.c[0] != 0x67) +- { +- throw std::runtime_error( +- "Ogawa currently only supports little-endian writing."); +- } +- + if (isValid()) + { + const char header[] = { +-- +2.28.0 + diff --git a/testing/alembic/0001-Fix-char-default-signedness-to-signed-char.patch b/testing/alembic/0001-Fix-char-default-signedness-to-signed-char.patch deleted file mode 100644 index a1fc10495f488a5fe5a502463735dad457d06ade..0000000000000000000000000000000000000000 --- a/testing/alembic/0001-Fix-char-default-signedness-to-signed-char.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 54e101ee793caa2c7dd514e6e9acece98a536984 Mon Sep 17 00:00:00 2001 -From: Kurkodejm <starfire24680@gmail.com> -Date: Wed, 12 Aug 2020 17:42:31 +0200 -Subject: [PATCH] Fix char default signedness to signed char, since char on ARM - is by default unsigned - ---- - lib/Alembic/AbcCoreHDF5/StringReadUtil.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/Alembic/AbcCoreHDF5/StringReadUtil.cpp b/lib/Alembic/AbcCoreHDF5/StringReadUtil.cpp -index 45425398..bfc0bfd5 100644 ---- a/lib/Alembic/AbcCoreHDF5/StringReadUtil.cpp -+++ b/lib/Alembic/AbcCoreHDF5/StringReadUtil.cpp -@@ -47,13 +47,13 @@ template <class CharT> - static inline hid_t GetNativeDtype(); - - template <> --inline hid_t GetNativeDtype<char>() { return H5T_NATIVE_CHAR; } -+inline hid_t GetNativeDtype<char>() { return H5T_NATIVE_SCHAR; } - - template <> - inline hid_t GetNativeDtype<wchar_t>() - { - // return H5T_NATIVE_INT32; -- if ( sizeof( wchar_t ) == 1 ) { return H5T_NATIVE_CHAR; } -+ if ( sizeof( wchar_t ) == 1 ) { return H5T_NATIVE_SCHAR; } - else if ( sizeof( wchar_t ) == 2 ) { return H5T_NATIVE_INT16; } - else - { --- -2.27.0 - diff --git a/testing/alembic/APKBUILD b/testing/alembic/APKBUILD index b2bbdbba291e696edef7bcbd621b3e2fcc1fdc35..08d3e3551128270b2c2ec84574b3d4b6322f490c 100644 --- a/testing/alembic/APKBUILD +++ b/testing/alembic/APKBUILD @@ -1,16 +1,16 @@ # Contributor: Damian Kurek <starfire24680@gmail.com> # Maintainer: Damian Kurek <starfire24680@gmail.com> pkgname=alembic -pkgver=1.7.15 +pkgver=1.7.16 pkgrel=0 pkgdesc="open framework for storing and sharing scene data" url="https://www.alembic.io/" -arch="all !s390x !mips64" #alembic does not support big-endian, which s390x uses +arch="s390x" #just for testing license="BSD-3-Clause" makedepends="openexr-dev hdf5-dev zlib-dev cmake boost-dev" subpackages="$pkgname-dev" source="$pkgname-$pkgver.tar.gz::https://github.com/alembic/alembic/archive/$pkgver.tar.gz - 0001-Fix-char-default-signedness-to-signed-char.patch" + 0001-Big-endian-support.patch" build() { cmake -B build \ @@ -28,5 +28,5 @@ package() { make -C build DESTDIR="$pkgdir" install } -sha512sums="a16ce301607530e04021b60227781b1e82927a85545a5c273062d8afd5b13949462d0957e0bdf05a04813fab864631760b4d264f289198b7c825dafbe6324382 alembic-1.7.15.tar.gz -ed782c91ac13627cf8e098a0e4c78e46414b00f1258847580c80c74af3e1341e7b5e8c8afae7e3dc8a038c04944cc4b3294c9840c4f016008bd3993e36dd585f 0001-Fix-char-default-signedness-to-signed-char.patch" +sha512sums="bd4777dc4abf15bfb8307b00fd2d67671e89944d0dd8a74a657f4aee49e6a1cd0ab1fe5bb7f9afc63abcce2123466bb8a9a3886d41724ed2c242bc61d7d5b3a1 alembic-1.7.16.tar.gz +7ab28ad7fc4b36c5c0d1d7a8c63e17ef4147b01b67c0520ccb50dd136aab317821272b3d7c53793830933b14271b141c2d98d348cfd5e6a66d696a06163b26ba 0001-Big-endian-support.patch"