--- /dev/null
+--- graphene-0.99.2/src/bench/Makefile.am.orig 2014-06-23 12:40:39.000000000 +0200
++++ graphene-0.99.2/src/bench/Makefile.am 2014-07-26 23:00:42.822085470 +0200
+@@ -11,9 +11,17 @@
+ noinst_LTLIBRARIES =
+ TESTS =
+
++SIMD_CFLAGS=
++if BUILD_WITH_SSE2
++SIMD_CFLAGS+=$(SSE2_CFLAGS)
++endif
++if BUILD_WITH_ARM_NEON
++SIMD_CFLAGS+=$(NEON_CFLAGS)
++endif
++
+ # common library for benchmark utilities
+ libgraphene_bench_la_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src -DG_LOG_DOMAIN=\"Graphene-Bench\"
+-libgraphene_bench_la_CFLAGS = $(GRAPHENE_CFLAGS) $(MAINTAINER_CFLAGS)
++libgraphene_bench_la_CFLAGS = $(GRAPHENE_CFLAGS) $(MAINTAINER_CFLAGS) $(SIMD_CFLAGS)
+ libgraphene_bench_la_LIBADD = $(GRAPHENE_LIBS)
+ libgraphene_bench_la_SOURCES = graphene-bench-utils.h graphene-bench-utils.c
+ noinst_LTLIBRARIES += libgraphene-bench.la
+@@ -39,7 +47,8 @@
+ bench_backends += sse
+
+ matrix_sse_SOURCES = matrix.c
+-matrix_sse_CPPFLAGS = -DGRAPHENE_BENCHMARK=1 -DGRAPHENE_HAS_SSE=1 -DIMPL=\"sse\"
++matrix_sse_CFLAGS = $(SSE2_CFLAGS) $(GLIB_CFLAGS)
++matrix_sse_CPPFLAGS = -DGRAPHENE_BENCHMARK=1 -DGRAPHENE_COMPILATION=1 -DGRAPHENE_HAS_SSE=1 -DIMPL=\"sse\"
+ noinst_PROGRAMS += matrix-sse
+
+ benchmark-sse: matrix-sse$(EXEEXT)
--- /dev/null
+--- graphene-0.99.2/src/graphene-point3d.c.orig 2014-06-23 12:40:39.000000000 +0200
++++ graphene-0.99.2/src/graphene-point3d.c 2014-07-27 08:09:01.524038179 +0200
+@@ -37,6 +37,7 @@
+ #include "config.h"
+
+ #include <math.h>
++#include <stdlib.h>
+
+ #include "graphene-point3d.h"
+ #include "graphene-vec3.h"
+--- graphene-0.99.2/src/graphene-point.c.orig 2014-06-23 12:40:39.000000000 +0200
++++ graphene-0.99.2/src/graphene-point.c 2014-07-27 08:08:36.847372544 +0200
+@@ -36,6 +36,7 @@
+ #include "config.h"
+
+ #include <math.h>
++#include <stdlib.h>
+
+ #include "graphene-point.h"
+ #include "graphene-simd4f.h"
+--- graphene-0.99.2/src/graphene-quad.c.orig 2014-06-23 12:40:39.000000000 +0200
++++ graphene-0.99.2/src/graphene-quad.c 2014-07-27 08:09:21.187370685 +0200
+@@ -35,6 +35,8 @@
+ #include "graphene-rect.h"
+ #include "graphene-line-segment.h"
+
++#include <stdlib.h>
++
+ /**
+ * graphene_quad_alloc: (constructor)
+ *
+--- graphene-0.99.2/src/graphene-quaternion.c.orig 2014-06-23 12:40:39.000000000 +0200
++++ graphene-0.99.2/src/graphene-quaternion.c 2014-07-27 08:09:35.794036737 +0200
+@@ -35,6 +35,7 @@
+ #include "config.h"
+
+ #include <math.h>
++#include <stdlib.h>
+
+ #include "graphene-quaternion.h"
+
+--- graphene-0.99.2/src/graphene-rect.c.orig 2014-06-23 12:40:39.000000000 +0200
++++ graphene-0.99.2/src/graphene-rect.c 2014-07-27 08:09:54.334035960 +0200
+@@ -37,6 +37,7 @@
+ #include "config.h"
+
+ #include <math.h>
++#include <stdlib.h>
+
+ #include "graphene-rect.h"
+
+--- graphene-0.99.2/src/graphene-simd4f.h.orig 2014-06-23 12:40:39.000000000 +0200
++++ graphene-0.99.2/src/graphene-simd4f.h 2014-07-27 08:10:55.077366743 +0200
+@@ -586,7 +586,7 @@ typedef union {
+ __ua.f[3] < __ub.f[3] ? __ua.f[3] : __ub.f[3]); \
+ }))
+
+-# define graphene_simd4f_max (a,b) \
++# define graphene_simd4f_max(a,b) \
+ (G_GNUC_EXTENSION ({ \
+ graphene_simd4f_union_t __ua = { (a) }; \
+ graphene_simd4f_union_t __ub = { (b) }; \
+--- graphene-0.99.2/src/graphene-size.c.orig 2014-06-23 12:40:39.000000000 +0200
++++ graphene-0.99.2/src/graphene-size.c 2014-07-27 08:11:34.260698434 +0200
+@@ -33,6 +33,7 @@
+ #include "config.h"
+
+ #include <math.h>
++#include <stdlib.h>
+
+ #include "graphene-point.h"
+
--- /dev/null
+# NOTE: despite some comments in configure, SSE2 is not selected at runtime;
+# SSE2 option seems to change the ABI of library
+#
+# Conditional build:
+%bcond_without static_libs # static library
+%bcond_with introspection # gobject introspection
+%bcond_with sse2 # x86 SSE2 fast paths
+%bcond_without armneon # ARM NEON fast paths
+#
+%ifarch pentium4 %{x8664}
+%define with_sse2
+%endif
+Summary: Graphene - a thin layer of types for graphic libraries
+Summary(pl.UTF-8): Graphene - cienka warstwa typów dla bibliotek graficznych
+Name: graphene
+Version: 0.99.2
+Release: 1
+License: MIT
+Group: Libraries
+Source0: https://github.com/ebassi/graphene/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: ccd4e4d991fb41ff163b1e27cfc41ea2
+Patch0: %{name}-bench.patch
+Patch1: %{name}-gcc.patch
+URL: https://github.com/ebassi/graphene
+BuildRequires: glib2-devel >= 1:2.40.0
+%{?with_introspection:BuildRequires: gobject-introspection-devel >= 1.41.0}
+BuildRequires: gtk-doc >= 1.20
+BuildRequires: autoconf >= 2.63
+BuildRequires: automake >= 1:1.11
+BuildRequires: libtool >= 2:2.2.6
+BuildRequires: pkgconfig
+Requires: glib2 >= 1:2.40.0
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Graphene provides a small set of mathematical types needed to
+implement graphic libraries that deal with 2D and 3D transformations
+and projections.
+
+%description -l pl.UTF-8
+Graphene udostępnia mały zestaw typów matematycznych potrzebnych przy
+implementowaniu bibliotek graficznych wykonujących przekształcenia i
+rzuty 2D oraz 3D.
+
+%package devel
+Summary: Header files for Graphene library
+Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Graphene
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: glib2-devel >= 1:2.40.0
+
+%description devel
+Header files for Graphene library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki Graphene.
+
+%package static
+Summary: Static Graphene library
+Summary(pl.UTF-8): Statyczna biblioteka Graphene
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
+
+%description static
+Static Graphene library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka Graphene.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__gtkdocize}
+%{__libtoolize}
+%{__aclocal} -I build/autotools
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+ %{!?with_armneon:--disable-arm-neon} \
+ --disable-silent-rules \
+ %{!?with_sse2:--disable-sse2} \
+ %{?with_static_libs:--enable-static}
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+# obsoleted by pkg-config
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgraphene-1.0.la
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE README.md
+%attr(755,root,root) %{_libdir}/libgraphene-1.0.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libgraphene-1.0.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libgraphene-1.0.so
+%{_includedir}/graphene-1.0
+%{_pkgconfigdir}/graphene-1.0.pc
+%{_pkgconfigdir}/graphene-gobject-1.0.pc
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libgraphene-1.0.a
+%endif