From d6919ca66736ca96d486278385c24ac88db530b6 Mon Sep 17 00:00:00 2001
From: Thomas Hansen <thomas.hansen@gmail.com>
Date: Sun, 27 Oct 2013 18:02:48 -0500
Subject: [PATCH] iphonesimulator...works (at least on my setup with this
 coomit...Mavericks XCode 5.01 iPhone SDK 7.0.3

---
 .../Python-2.7.1-ctypes_duplicate.patch       | 41 +++++++------------
 tools/populate-project.sh                     |  6 +--
 2 files changed, 18 insertions(+), 29 deletions(-)

diff --git a/src/python_files/Python-2.7.1-ctypes_duplicate.patch b/src/python_files/Python-2.7.1-ctypes_duplicate.patch
index c895dc5..9f42e1c 100644
--- a/src/python_files/Python-2.7.1-ctypes_duplicate.patch
+++ b/src/python_files/Python-2.7.1-ctypes_duplicate.patch
@@ -1,34 +1,23 @@
---- Python2.7-old/Modules/_ctypes/cfield.c	2010-05-09 16:46:46.000000000 +0200
-+++ Python2.7-new/Modules/_ctypes/cfield.c	2013-08-27 00:21:15.000000000 +0200
-@@ -1747,24 +1747,6 @@
- } ffi_type;
+--- Python-2.7.1.old/Modules/_ctypes/cfield.c	2010-05-09 09:46:46.000000000 -0500
++++ Python-2.7.1/Modules/_ctypes/cfield.c	2013-10-27 16:13:05.000000000 -0500
+@@ -1748,6 +1748,7 @@
  */
  
--/* align and size are bogus for void, but they must not be zero */
--ffi_type ffi_type_void = { 1, 1, FFI_TYPE_VOID };
--
--ffi_type ffi_type_uint8 = { 1, 1, FFI_TYPE_UINT8 };
--ffi_type ffi_type_sint8 = { 1, 1, FFI_TYPE_SINT8 };
--
--ffi_type ffi_type_uint16 = { 2, 2, FFI_TYPE_UINT16 };
--ffi_type ffi_type_sint16 = { 2, 2, FFI_TYPE_SINT16 };
--
--ffi_type ffi_type_uint32 = { 4, 4, FFI_TYPE_UINT32 };
--ffi_type ffi_type_sint32 = { 4, 4, FFI_TYPE_SINT32 };
--
--ffi_type ffi_type_uint64 = { 8, LONG_LONG_ALIGN, FFI_TYPE_UINT64 };
--ffi_type ffi_type_sint64 = { 8, LONG_LONG_ALIGN, FFI_TYPE_SINT64 };
--
--ffi_type ffi_type_float = { sizeof(float), FLOAT_ALIGN, FFI_TYPE_FLOAT };
--ffi_type ffi_type_double = { sizeof(double), DOUBLE_ALIGN, FFI_TYPE_DOUBLE };
--
- #ifdef ffi_type_longdouble
+ /* align and size are bogus for void, but they must not be zero */
++/*
+ ffi_type ffi_type_void = { 1, 1, FFI_TYPE_VOID };
+ 
+ ffi_type ffi_type_uint8 = { 1, 1, FFI_TYPE_UINT8 };
+@@ -1769,9 +1770,11 @@
  #undef ffi_type_longdouble
  #endif
-@@ -1772,6 +1754,4 @@
+   /* This is already defined on OSX */
++/*
  ffi_type ffi_type_longdouble = { sizeof(long double), LONGDOUBLE_ALIGN,
                                   FFI_TYPE_LONGDOUBLE };
  
--ffi_type ffi_type_pointer = { sizeof(void *), VOID_P_ALIGN, FFI_TYPE_POINTER };
--
+ ffi_type ffi_type_pointer = { sizeof(void *), VOID_P_ALIGN, FFI_TYPE_POINTER };
++*/
+ 
  /*---------------- EOF ----------------*/
+
diff --git a/tools/populate-project.sh b/tools/populate-project.sh
index 3199606..223ea0e 100755
--- a/tools/populate-project.sh
+++ b/tools/populate-project.sh
@@ -31,8 +31,8 @@ try rsync -av --delete $SRCDIR/ $YOURAPPDIR
 echo "-> Compile to pyo"
 $HOSTPYTHON -OO -m compileall $YOURAPPDIR
 
-echo "-> Remove unused files (pyc, py)"
-find $YOURAPPDIR -iname '*.py' -exec rm {} \;
-find $YOURAPPDIR -iname '*.pyc' -exec rm {} \;
+#echo "-> Remove unused files (pyc, py)"
+#find $YOURAPPDIR -iname '*.py' -exec rm {} \;
+#find $YOURAPPDIR -iname '*.pyc' -exec rm {} \;
 
 echo "-> Source code of $APPNAME updated."