[Pythonmac-SIG] PIL for OS-X
Bill Janssen
janssen at parc.com
Thu Apr 10 02:38:48 CEST 2008
> But you're right, it would be nice to get that down to a single script.
> I'll get a start on that. Do you think it should download the tarballs
> too (curl) ?
Feel free to start with my script here.
I download the tarballs, unpack PIL and all the prereq packages in
/tmp, and go to work. ${distdir} could be "/usr/local".
Bill
----------------------------------------------------------
set tempfile=/tmp/foo-$$
cd libpng-*
./configure --prefix=${distdir}
make
make install
cd ../jpeg*
./configure --prefix=${distdir}
make
make install
make install-lib
make install-headers
ranlib ${distdir}/lib/libjpeg.a
setenv CPPFLAGS "-I${distdir}/include"
setenv LDFLAGS "-L${distdir}/lib"
setenv CXXFLAGS "-I${distdir}/include"
cd ../jbig2dec*
./configure --prefix=${distdir}
make
make install
cd ../ghostscript-8*
ln -s ../jpeg-6b ./jpeg
# Macs may not have X11, so make sure not to link it in by accident
./configure --without-x --prefix=${distdir}
make
make install
cd ../fonts
install -m 444 * ${distdir}/share/ghostscript/fonts
cd ../tiff-*
./configure --prefix=${distdir} --without-x
make
make install
cd ../freetype-2.*
# first, get rid of erroneous mac flag
cp include/freetype/config/ftconfig.h ${tempfile}
rm -f include/freetype/config/ftconfig.h
sed -e 's/#define FT_MACINTOSH 1/#undef FT_MACINTOSH/' < ${tempfile} > include/freetype/config/ftconfig.h
# next, enable the bytecode interpreter
rm -f ${tempfile}
cp include/freetype/config/ftoption.h ${tempfile}
rm -f include/freetype/config/ftoption.h
sed -e 's;/\* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER \*/;#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER;' < ${tempfile} > include/freetype/config/ftoption.h
# now build
./configure --prefix=${distdir}
make
make install
cp ${distdir}/include/ft2build.h ${distdir}/include/freetype2/ # for xpdf
cd ../t1lib-5.*
./configure --without-x --without-athena --prefix=${distdir}
make without_doc
make install
cd ../Imaging-1.1.*
rm -f ${tempfile}
cp setup.py ${tempfile}
sed -e "s;/sw;${distdir};" < ${tempfile} > setup.py
python setup.py build
python setup.py install --prefix=${distdir}
More information about the Pythonmac-SIG
mailing list