[reportlab-users] Installing on Mac OSX

Bill Janssen janssen at parc.com
Thu May 28 17:53:20 EDT 2009


Andrea Riciputi <mr.rech.list at gmail.com> wrote:


> Hi Aaron,

> installing FreeType and PIL from sources scares me a little bit. Both

> of them are quite big packages and I can imagine they also have many

> dependencies in turn. Could you be so kind to give me some more

> details about the procedure?


I do it all the time. Here's a script I use on Macs. Put all the
prereqs .tar.gz files in a directory, the PREREQS-DIR, and then invoke
this script, giving the PREREQS-DIR and where you want it installed
(e.g. "/usr/local") as arguments.

I'll let you figure out exactly what .tar.gz (.tgz or .tar.bz2 will also
work) files you need -- read the script closely to make up that list.

Bill
------------------------------------------------------------
#!/bin/csh
#

if ($# < 1) then
echo "Usage: $0 PREREQS-DIR INSTALL-DIR"
exit 1
endif

set prereqdir=$1
set distdir=$2

set shorthostname=`/bin/hostname`
set ourhostname=`/usr/bin/host $shorthostname | /usr/bin/awk '{print $1}'`

if (-e ${distdir}) then
if ( ! -d ${distdir} ) then
echo "Can't install to file ${distdir}."
exit 1
endif
else
mkdir -p ${distdir}
endif

mkdir -p ${distdir}/man/man1

rm -rf /tmp/install-reportlab-prereqs
mkdir -p /tmp/install-reportlab-prereqs

pushd /tmp/install-reportlab-prereqs

foreach file ( ${prereqdir}/*.tar.gz ${prereqdir}/*.tgz )
tar xvfz $file
end
foreach file ( ${prereqdir}/*.tar.bz2 )
bunzip2 < $file | tar xvf -
end

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

cd ../jbig2dec*
setenv CPPFLAGS "-I${distdir}/include"
setenv LDFLAGS "-L${distdir}/lib"
setenv CXXFLAGS "-I${distdir}/include"
./configure --prefix=${distdir}
make
make install

cd ../tiff-*
./configure --prefix=${distdir}
make
make install

cd ../freetype-2.*
# first, get rid of erroneous mac flag
rm -f /tmp/foo-mac-reportlab
cp include/freetype/config/ftconfig.h /tmp/foo-mac-reportlab
rm -f include/freetype/config/ftconfig.h
sed -e 's/#define FT_MACINTOSH 1/#undef FT_MACINTOSH/' < /tmp/foo-mac-reportlab > include/freetype/config/ftconfig.h
# next, enable the bytecode interpreter
rm -f /tmp/foo-mac-reportlab
cp include/freetype/config/ftoption.h /tmp/foo-mac-reportlab
rm -f include/freetype/config/ftoption.h
sed -e 's;/\* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER \*/;#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER;' < /tmp/foo-mac-reportlab > 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 /tmp/foo-mac-reportlab
cp setup.py /tmp/foo-mac-reportlab
sed -e "s;/sw;${distdir};" < /tmp/foo-mac-reportlab > setup.py
python setup.py build
python setup.py install

cd ../ReportLab_2*
python setup.py build
python setup.py install


More information about the reportlab-users mailing list