diff --git a/.gitignore b/.gitignore index 315f31c..8ec7e84 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /glm-0.9.4.5.zip /glm-0.9.4.6.zip /glm-0.9.5.2.zip +/glm-0.9.6.1.zip diff --git a/glm-0.9.5.2-aliasfix.patch b/glm-0.9.5.2-aliasfix.patch deleted file mode 100644 index 5574548..0000000 --- a/glm-0.9.5.2-aliasfix.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff -ru glm/glm/gtc/packing.inl glm-aliasfix/glm/gtc/packing.inl ---- glm/glm/gtc/packing.inl 2014-02-08 21:28:22.000000000 +0200 -+++ glm-aliasfix/glm/gtc/packing.inl 2014-06-11 12:29:07.345452993 +0300 -@@ -35,6 +35,26 @@ - namespace glm{ - namespace detail - { -+ GLM_FUNC_QUALIFIER float float_from_bits_of_uint(uint const u) -+ { -+ union { -+ float as_float; -+ uint as_uint; -+ } result; -+ result.as_uint = u; -+ return result.as_float; -+ } -+ -+ GLM_FUNC_QUALIFIER glm::uint uint_from_bits_of_float(float const f) -+ { -+ union { -+ float as_float; -+ uint as_uint; -+ } result; -+ result.as_float = f; -+ return result.as_uint; -+ } -+ - GLM_FUNC_QUALIFIER glm::uint16 float2half(glm::uint32 const & f) - { - // 10 bits => EE EEEFFFFF -@@ -145,7 +165,7 @@ - else if(glm::isinf(x)) - return 0x1f << 6; - -- return float2packed11(reinterpret_cast(x)); -+ return float2packed11(uint_from_bits_of_float(x)); - } - - GLM_FUNC_QUALIFIER float packed11bitToFloat(glm::uint x) -@@ -158,7 +178,7 @@ - return ~0;//Inf - - uint result = packed11ToFloat(x); -- return reinterpret_cast(result); -+ return float_from_bits_of_uint(result); - } - - GLM_FUNC_QUALIFIER glm::uint floatTo10bit(float x) -@@ -170,7 +190,7 @@ - else if(glm::isinf(x)) - return 0x1f << 5; - -- return float2packed10(reinterpret_cast(x)); -+ return float2packed10(uint_from_bits_of_float(x)); - } - - GLM_FUNC_QUALIFIER float packed10bitToFloat(glm::uint x) -@@ -183,7 +203,7 @@ - return ~0;//Inf - - uint result = packed10ToFloat(x); -- return reinterpret_cast(result); -+ return float_from_bits_of_uint(result); - } - - // GLM_FUNC_QUALIFIER glm::uint f11_f11_f10(float x, float y, float z) diff --git a/glm-0.9.6.1-ulp.patch b/glm-0.9.6.1-ulp.patch new file mode 100644 index 0000000..c5ccb95 --- /dev/null +++ b/glm-0.9.6.1-ulp.patch @@ -0,0 +1,21 @@ +diff -ru glm/glm/gtc/ulp.inl glm-ulp/glm/gtc/ulp.inl +--- glm/glm/gtc/ulp.inl 2014-12-09 21:13:54.000000000 +0200 ++++ glm-ulp/glm/gtc/ulp.inl 2015-01-06 16:29:47.497932633 +0200 +@@ -316,7 +316,7 @@ + if(x < y) + { + T temp = x; +- while(temp != y)// && ulp < std::numeric_limits::max()) ++ while(temp < y)// && ulp < std::numeric_limits::max()) + { + ++ulp; + temp = next_float(temp); +@@ -325,7 +325,7 @@ + else if(y < x) + { + T temp = y; +- while(temp != x)// && ulp < std::numeric_limits::max()) ++ while(temp < x)// && ulp < std::numeric_limits::max()) + { + ++ulp; + temp = next_float(temp); diff --git a/glm.spec b/glm.spec index c0e6729..8b771f5 100644 --- a/glm.spec +++ b/glm.spec @@ -2,15 +2,15 @@ %global debug_package %{nil} Name: glm -Version: 0.9.5.2 -Release: 4%{?dist} +Version: 0.9.6.1 +Release: 1%{?dist} Summary: C++ mathematics library for graphics programming License: MIT URL: http://glm.g-truc.net/ Source0: http://downloads.sourceforge.net/ogl-math/%{name}-%{version}/%{name}-%{version}.zip Patch0: glm-0.9.5.2-smallercount.patch -Patch1: glm-0.9.5.2-aliasfix.patch +Patch1: glm-0.9.6.1-ulp.patch BuildRequires: cmake @@ -74,7 +74,7 @@ sed -i 's/\r//' doc/api/doxygen.css sed -i 's/\r//' doc/api/tabs.css %patch0 -p1 -b .smallercount -%patch1 -p1 -b .aliasfix +%patch1 -p1 -b .ulp %build mkdir build @@ -85,9 +85,10 @@ make %{?_smp_mflags} %check cd build -# The packing test is disabled because it has never -# worked on i686. -ctest --output-on-failure -E test-gtc_packing +# Some tests are disabled due to known upstream bugs: +# https://github.com/g-truc/glm/issues/212 +# https://github.com/g-truc/glm/issues/296 +ctest --output-on-failure -E '(test-gtc_packing|test-gtc_integer)' %install cd build @@ -96,6 +97,11 @@ make install DESTDIR=$RPM_BUILD_ROOT find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' find $RPM_BUILD_ROOT -name CMakeLists.txt -exec rm -f {} ';' +# This is not packaged until there is consensus that +# packages should install FindSomething.cmake files. +# https://bugzilla.redhat.com/show_bug.cgi?id=1022088 +rm $RPM_BUILD_ROOT%{_libdir}/cmake/FindGLM.cmake + %files devel %doc copying.txt readme.txt %{_includedir}/%{name} @@ -105,6 +111,9 @@ find $RPM_BUILD_ROOT -name CMakeLists.txt -exec rm -f {} ';' %doc doc/api/ %changelog +* Tue Jan 06 2015 Joonas Sarajärvi - 0.9.6.1-1 +- Update to upstream GLM version 0.9.6.1 + * Sat Aug 16 2014 Fedora Release Engineering - 0.9.5.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild diff --git a/sources b/sources index 24de7c4..1e277a1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -dd8332ef13c325e1e785130a92c168bd glm-0.9.5.2.zip +b1c5f1811d3fac4e3f4932bdab0cb7a6 glm-0.9.6.1.zip