Skip to content

Instantly share code, notes, and snippets.

@lynx-r1
Created October 29, 2012 13:11
Show Gist options
  • Save lynx-r1/3973452 to your computer and use it in GitHub Desktop.
Save lynx-r1/3973452 to your computer and use it in GitHub Desktop.
Patch to Pillow that uses custom libs before system
diff --git a/setup.py b/setup.py
index e26aa43..9a744fa 100644
--- a/setup.py
+++ b/setup.py
@@ -93,6 +93,18 @@ class pil_build_ext(build_ext):
_add_directory(include_dirs, "libImaging")
#
+ # add configured kits
+
+ for root in (TCL_ROOT, JPEG_ROOT, TCL_ROOT, TIFF_ROOT, ZLIB_ROOT,
+ FREETYPE_ROOT, LCMS_ROOT):
+ if isinstance(root, type(())):
+ lib_root, include_root = root
+ else:
+ lib_root = include_root = root
+ _add_directory(library_dirs, lib_root)
+ _add_directory(include_dirs, include_root)
+
+ #
# add platform directories
if sys.platform == "cygwin":
@@ -167,18 +179,6 @@ class pil_build_ext(build_ext):
TCL_ROOT = None
#
- # add configured kits
-
- for root in (TCL_ROOT, JPEG_ROOT, TCL_ROOT, TIFF_ROOT, ZLIB_ROOT,
- FREETYPE_ROOT, LCMS_ROOT):
- if isinstance(root, type(())):
- lib_root, include_root = root
- else:
- lib_root = include_root = root
- _add_directory(library_dirs, lib_root)
- _add_directory(include_dirs, include_root)
-
- #
# add standard directories
# look for tcl specific subdirectory (e.g debian)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment