From 28d70428562d48ba8b3eae5437e05e2a9d892cc0 Mon Sep 17 00:00:00 2001 From: Thomas Hansen Date: Fri, 25 Oct 2013 15:23:44 -0500 Subject: [PATCH] Fixes for changes introduced by installing new XCode5 CommandLineTools, which put system headers in /usr/local. This change makes sure that the hostpython is using the system sdk, and PIL does not explicitly include /usr/include etc. as the highest priority path to look for headers in...that wont work if we are cross compiling. --- src/pil_files/patch_pil.patch | 28 ++++++++++++++++++++++------ tools/build-python.sh | 7 ++++--- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/pil_files/patch_pil.patch b/src/pil_files/patch_pil.patch index 0e54fd9..7e2f2f6 100644 --- a/src/pil_files/patch_pil.patch +++ b/src/pil_files/patch_pil.patch @@ -1,6 +1,6 @@ diff -rupN Imaging-1.1.7/_imaging.c Imaging-1.1.7_patched/_imaging.c ---- Imaging-1.1.7/_imaging.c 2009-11-02 12:18:48.000000000 +0100 -+++ Imaging-1.1.7_patched/_imaging.c 2013-07-12 10:58:39.000000000 +0200 +--- Imaging-1.1.7/_imaging.c 2009-11-02 05:18:48.000000000 -0600 ++++ Imaging-1.1.7_patched/_imaging.c 2013-10-25 15:07:23.000000000 -0500 @@ -71,12 +71,28 @@ * See the README file for information on usage and redistribution. */ @@ -32,8 +32,8 @@ diff -rupN Imaging-1.1.7/_imaging.c Imaging-1.1.7_patched/_imaging.c #define WITH_IMAGECHOPS /* ImageChops support */ #define WITH_IMAGEDRAW /* ImageDraw support */ diff -rupN Imaging-1.1.7/libImaging/Quant.c Imaging-1.1.7_patched/libImaging/Quant.c ---- Imaging-1.1.7/libImaging/Quant.c 2009-11-01 02:29:14.000000000 +0100 -+++ Imaging-1.1.7_patched/libImaging/Quant.c 2013-07-12 10:59:06.000000000 +0200 +--- Imaging-1.1.7/libImaging/Quant.c 2009-10-31 20:29:14.000000000 -0500 ++++ Imaging-1.1.7_patched/libImaging/Quant.c 2013-10-25 15:07:23.000000000 -0500 @@ -20,10 +20,15 @@ #include "Imaging.h" @@ -60,8 +60,8 @@ diff -rupN Imaging-1.1.7/libImaging/Quant.c Imaging-1.1.7_patched/libImaging/Qua unsigned long scale; } PixelHashData; diff -rupN Imaging-1.1.7/setup.py Imaging-1.1.7_patched/setup.py ---- Imaging-1.1.7/setup.py 2009-11-15 17:06:10.000000000 +0100 -+++ Imaging-1.1.7_patched/setup.py 2013-07-12 10:58:30.000000000 +0200 +--- Imaging-1.1.7/setup.py 2009-11-15 10:06:10.000000000 -0600 ++++ Imaging-1.1.7_patched/setup.py 2013-10-25 15:08:08.000000000 -0500 @@ -88,6 +88,7 @@ from distutils.command.build_ext import try: @@ -70,6 +70,22 @@ diff -rupN Imaging-1.1.7/setup.py Imaging-1.1.7_patched/setup.py except ImportError: _tkinter = None +@@ -208,11 +209,11 @@ class pil_build_ext(build_ext): + add_directory(include_dirs, tcl_dir) + + # standard locations +- add_directory(library_dirs, "/usr/local/lib") +- add_directory(include_dirs, "/usr/local/include") ++ #add_directory(library_dirs, "/usr/local/lib") ++ #add_directory(include_dirs, "/usr/local/include") + +- add_directory(library_dirs, "/usr/lib") +- add_directory(include_dirs, "/usr/include") ++ #add_directory(library_dirs, "/usr/lib") ++ #add_directory(include_dirs, "/usr/include") + + # + # insert new dirs *before* default libs, to avoid conflicts @@ -283,6 +284,14 @@ class pil_build_ext(build_ext): # # core library diff --git a/tools/build-python.sh b/tools/build-python.sh index 8698d78..5a635b0 100755 --- a/tools/build-python.sh +++ b/tools/build-python.sh @@ -28,8 +28,9 @@ try cp $KIVYIOSROOT/src/python_files/_scproxy.py Lib/_scproxy.py echo "Building for native machine ============================================" -try ./configure CC="$CCACHE clang -Qunused-arguments -fcolor-diagnostics" LDFLAGS="-lsqlite3" -try make python.exe Parser/pgen +OSX_SDK_ROOT=`xcrun --sdk macosx --show-sdk-path` +try ./configure CC="clang -Qunused-arguments -fcolor-diagnostics" LDFLAGS="-lsqlite3" CFLAGS="--sysroot=$OSX_SDK_ROOT" +try make -j4 python.exe Parser/pgen try mv python.exe hostpython try mv Parser/pgen Parser/hostpgen try make distclean @@ -67,7 +68,7 @@ try ./configure CC="$ARM_CC" LD="$ARM_LD" \ try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$IOS_PYTHON_VERSION-pyconfig.patch try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$IOS_PYTHON_VERSION-ctypes_duplicate.patch -try make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen \ +try make -j4 HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen \ CROSS_COMPILE_TARGET=yes try make install HOSTPYTHON=./hostpython CROSS_COMPILE_TARGET=yes \