Skip to content

Instantly share code, notes, and snippets.

@djay
Created March 11, 2014 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djay/9477048 to your computer and use it in GitHub Desktop.
Save djay/9477048 to your computer and use it in GitHub Desktop.
Pillow custom build that isn't isolated from system libraries
[zlib]
recipe = zc.recipe.cmmi
url = ${urls:zlib}
depends-on = ${:url}
[urls]
libjpeg = http://www.ijg.org/files/jpegsrc.v8.tar.gz
libpng = http://prdownloads.sourceforge.net/libpng/libpng-1.5.12.tar.gz?download
libtiff = http://www.imagemagick.org/download/delegates/tiff-4.0.3.tar.gz
zlib = http://zlib.net/zlib-1.2.8.tar.gz
[libjpeg]
recipe = zc.recipe.cmmi
url = ${urls:libjpeg}
extra_options =
--enable-static --enable-shared --with-jpeg8
#configure-options-darwin=--host x86_64-apple-darwin
depends-on = ${:url} ${:extra_options}
[libpng]
recipe = zc.recipe.cmmi
url = ${urls:libpng}
depends-on = ${:url}
[libtiff]
recipe = zc.recipe.cmmi
url = ${urls:libtiff}
#environment = CPPFLAGS=-I${libjpeg:location}/include -I${zlib:location}/include
# LDFLAGS=-L${libjpeg:location}/lib -L${zlib:location}/lib -Wl,-rpath -Wl,${libjpeg:location}/lib -Wl,-rpath -Wl,${zlib:location}/lib
extra_options =
--disable-static
--without-x
--disable-lzma
--disable-jpeg
--disable-zip
#environment =
# CPPFLAGS=-I${libjpeg:location}/include -I${zlib:location}/include
# LDFLAGS=-L${libjpeg:location}/lib -Wl,-rpath=${libjpeg:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
depends-on = ${:url} ${libjpeg:depends-on} ${zlib:depends-on}
# WARNING: Pillow ignores these dependencies if it finds system versions https://github.com/python-imaging/Pillow/issues/542
[Pillow]
recipe = zc.recipe.egg:custom
egg = Pillow
include-dirs =
${zlib:location}/include
${libjpeg:location}/include
${libpng:location}/include
${libtiff:location}/include
library-dirs =
${zlib:location}/lib
${libjpeg:location}/lib
${libtiff:location}/lib
rpath =
${zlib:location}/lib
${libjpeg:location}/lib
${libtiff:location}/lib
#hack to force updating
depends-on = ${libjpeg:depends-on} ${libpng:depends-on} ${zlib:depends-on} ${libtiff:depends-on} rebuild1
# TODO: should be more comprehensive test. PIL comes with it's own built in test
[test-pillow]
recipe = plone.recipe.command >= 1.1
command = ${buildout:bin-directory}/${test-pillow-py:interpreter} -c 'from PIL import Image; Image.new("L", (100, 100)).save("test.jpg")'
update-command = ${:command}
stop-on-error = true
# if it fails, ensure it's built in develop-eggs
[test-pillow-py]
recipe = zc.recipe.egg
eggs = ${instance:eggs}
interpreter = test-pillow-py
[versions]
#required for docx
Pillow = >= 2.3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment