testing/pixz: fix endian problems on ppc64 / s390x

This commit is contained in:
William Pitcock 2018-02-19 22:33:12 +00:00
parent 326b8d5240
commit 64d162606f
2 changed files with 29 additions and 1 deletions

View File

@ -16,6 +16,7 @@ install=""
subpackages="$pkgname-doc"
source="https://github.com/vasi/pixz/releases/download/v$pkgver/pixz-$pkgver.tar.xz
0001-use-posix-shell-for-tests.patch
endian.patch
"
builddir="$srcdir/pixz-$pkgver"
@ -43,4 +44,5 @@ package() {
}
sha512sums="361a8d8b736c350e4e3fd19b5d36777129a087eb81439d05edc08f9378938583bef8fc70e440ffd22efb6dad1f6494c6c3e532d7dd1ab12c9350b6078aa993d7 pixz-1.0.6.tar.xz
f9333adaefb8f6bae4bc1841185f6289b362895c46702e213392aae4954ec2fe81d169a21fcd5eec2d0f96d243ec4add1f8ae89dc6480f603231c954da47d4ed 0001-use-posix-shell-for-tests.patch"
f9333adaefb8f6bae4bc1841185f6289b362895c46702e213392aae4954ec2fe81d169a21fcd5eec2d0f96d243ec4add1f8ae89dc6480f603231c954da47d4ed 0001-use-posix-shell-for-tests.patch
8fc05d70837b3377ca09e0e1fc91d3a0998e49c710544e9ff0d04139a5400bb3d540375c02ebee849341981b23832a382cda85248e33d9cca9c99289c03cfa45 endian.patch"

26
testing/pixz/endian.patch Normal file
View File

@ -0,0 +1,26 @@
--- pixz-1.0.6.orig/src/endian.c
+++ pixz-1.0.6/src/endian.c
@@ -19,19 +19,19 @@
#include <sys/endian.h>
#endif
-#if !HAVE_DECL_HTOLE64
+#if !HAVE_DECL_HTOLE64 && !defined(htole64)
# if __BYTE_ORDER == __LITTLE_ENDIAN
# define htole64(x) (x)
# else
-# define htole64(x) __bswap_64 (x)
+# define htole64(x) __bswap64 (x)
# endif
#endif
-#if !HAVE_DECL_LE64TOH
+#if !HAVE_DECL_LE64TOH && !defined(le64toh)
# if __BYTE_ORDER == __LITTLE_ENDIAN
# define le64toh(x) (x)
# else
-# define le64toh(x) __bswap_64 (x)
+# define le64toh(x) __bswap64 (x)
# endif
#endif