From 319de8cd9b24d0c93b7be0eacd2d11ad9cc915b1 Mon Sep 17 00:00:00 2001
From: Edric Milaret <edric.ladent-milaret@savoirfairelinux.com>
Date: Thu, 9 Jun 2016 11:06:45 -0400
Subject: [PATCH] ios: allow vorbis to build

Change-Id: I8cfcc346c2f5305fdfde10b2967882a973d8411f
Tuleap: #313
---
 contrib/src/vorbis/ios.patch | 13 +++++++++++++
 contrib/src/vorbis/rules.mak |  4 ++++
 2 files changed, 17 insertions(+)
 create mode 100644 contrib/src/vorbis/ios.patch

diff --git a/contrib/src/vorbis/ios.patch b/contrib/src/vorbis/ios.patch
new file mode 100644
index 0000000000..44fd3c1666
--- /dev/null
+++ b/contrib/src/vorbis/ios.patch
@@ -0,0 +1,13 @@
+--- libvorbis/configure.ac.orig	2012-09-07 00:17:47.000000000 +0200
++++ libvorbis/configure.ac	2012-09-07 00:18:01.000000000 +0200
+@@ -199,8 +199,8 @@
+ 		PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char $sparc_cpu" ;;
+ 	*-*-darwin*)
+ 		DEBUG="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O0 -fsigned-char"
+-		CFLAGS="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O4 -ffast-math -fsigned-char"
+-		PROFILE="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -pg -O4 -ffast-math -fsigned-char";;
++		CFLAGS="-DDARWIN -fno-common -Wall -O3 -ffast-math -fsigned-char"
++		PROFILE="-DDARWIN -fno-common -Wall -pg -O3 -ffast-math -fsigned-char";;
+ 	*-*-os2*)
+ 		# Use -W instead of -Wextra because gcc on OS/2 is an old version.
+ 		DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
diff --git a/contrib/src/vorbis/rules.mak b/contrib/src/vorbis/rules.mak
index 12b23a3345..d4ce0ef3f8 100644
--- a/contrib/src/vorbis/rules.mak
+++ b/contrib/src/vorbis/rules.mak
@@ -25,7 +25,11 @@ $(TARBALLS)/libvorbis-$(VORBIS_VERSION).tar.xz:
 
 vorbis: libvorbis-$(VORBIS_VERSION).tar.xz .sum-vorbis
 	$(UNPACK)
+ifndef HAVE_IOS
 	$(APPLY) $(SRC)/vorbis/osx.patch
+else
+	$(APPLY) $(SRC)/vorbis/ios.patch
+endif
 	$(UPDATE_AUTOCONFIG)
 	$(MOVE)
 
-- 
GitLab