aboutsummaryrefslogtreecommitdiffstats
path: root/community/glm
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-12-28 17:55:55 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-12-28 17:55:55 +0000
commit5a7e6b2c5738e229983bb88fbcaf3d5450e5508c (patch)
tree1164e458da0e145bd9970d16125656f454ade2da /community/glm
parent7c40f0b24259d0c92883fb3e33a7b4c1f77c65b9 (diff)
downloadaports-5a7e6b2c5738e229983bb88fbcaf3d5450e5508c.tar.bz2
aports-5a7e6b2c5738e229983bb88fbcaf3d5450e5508c.tar.xz
community/glm: fix tests on big-endian machines
Diffstat (limited to 'community/glm')
-rw-r--r--community/glm/APKBUILD9
-rw-r--r--community/glm/fix-endian-test.patch30
2 files changed, 36 insertions, 3 deletions
diff --git a/community/glm/APKBUILD b/community/glm/APKBUILD
index d9a63c3973..798cd5a91e 100644
--- a/community/glm/APKBUILD
+++ b/community/glm/APKBUILD
@@ -1,14 +1,16 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=glm
pkgver=0.9.9.3
-pkgrel=0
+pkgrel=1
pkgdesc="C++ mathematics library for graphics programming"
url="http://glm.g-truc.net/"
arch="noarch"
license="MIT"
makedepends="cmake"
subpackages="$pkgname-dev"
-source="https://github.com/g-truc/glm/releases/download/$pkgver/glm-$pkgver.zip"
+source="https://github.com/g-truc/glm/releases/download/$pkgver/glm-$pkgver.zip
+ fix-endian-test.patch
+ "
builddir="$srcdir/$pkgname"
build() {
@@ -33,4 +35,5 @@ package() {
make install DESTDIR="$pkgdir"
}
-sha512sums="eb7589345eb627d9fda84771bd2cf3eb0e4e9e48bf6bb7490bd8844b66558717de5dc96cde9d66e81f7ba4e54090f18dbe1bbccb2452ed0ed8c17cdf7b6e4aa2 glm-0.9.9.3.zip"
+sha512sums="eb7589345eb627d9fda84771bd2cf3eb0e4e9e48bf6bb7490bd8844b66558717de5dc96cde9d66e81f7ba4e54090f18dbe1bbccb2452ed0ed8c17cdf7b6e4aa2 glm-0.9.9.3.zip
+54fd8926e3e8271ea32ff25b433003e7eef5611ac7b3c397c0e3b5cd6b139071dba774964c8ae4f8859523a354fec45e38d4ad8fdd46f930f21ce529cc95a65e fix-endian-test.patch"
diff --git a/community/glm/fix-endian-test.patch b/community/glm/fix-endian-test.patch
new file mode 100644
index 0000000000..7ae44dc96c
--- /dev/null
+++ b/community/glm/fix-endian-test.patch
@@ -0,0 +1,30 @@
+diff --git a/test/gtc/gtc_packing.cpp b/test/gtc/gtc_packing.cpp
+index 5830999..86167c5 100644
+--- a/test/gtc/gtc_packing.cpp
++++ b/test/gtc/gtc_packing.cpp
+@@ -5,6 +5,8 @@
+ #include <cstdio>
+ #include <vector>
+
++#include <endian.h>
++
+ void print_bits(float const& s)
+ {
+ union
+@@ -154,6 +156,7 @@ int test_U3x10_1x2()
+ Error += glm::all(glm::equal(v0, v1)) ? 0 : 1;
+ }
+
++#if BYTE_ORDER == LITTLE_ENDIAN
+ glm::u8vec4 const v0(0xff, 0x77, 0x0, 0x33);
+ glm::uint32 const p0 = *reinterpret_cast<glm::uint32 const*>(&v0[0]);
+ glm::uint32 const r0 = 0x330077ff;
+@@ -165,7 +168,7 @@ int test_U3x10_1x2()
+ glm::uint32 const r1 = 0xc001dcff;
+
+ Error += p1 == r1 ? 0 : 1;
+-
++#endif
+ return Error;
+ }
+