forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.osx
110 lines (89 loc) · 4.17 KB
/
make.osx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# build mpl into a local install dir with
# PREFIX=/Users/jdhunter/dev make -f make.osx fetch deps mpl_install
MPLVERSION=1.0rc1
PYVERSION=2.6
PYTHON=python${PYVERSION}
ZLIBVERSION=1.2.3
PNGVERSION=1.2.39
FREETYPEVERSION=2.3.11
MACOSX_DEPLOYMENT_TARGET=10.6
OSX_SDK_VER=10.6
ARCH_FLAGS="-arch i386-arch x86_64"
## You shouldn't need to configure past this point
#PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig"
#CFLAGS="${ARCH_FLAGS} -I${PREFIX}/include -I${PREFIX}/include/freetype2 -isysroot /Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk"
#LDFLAGS="${ARCH_FLAGS} -L${PREFIX}/lib -syslibroot,/Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk"
PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig"
CFLAGS="-arch i386 -arch x86_64 -I${PREFIX}/include -I${PREFIX}/include/freetype2 -isysroot /Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk"
LDFLAGS="-arch i386 -arch x86_64 -L${PREFIX}/lib -syslibroot,/Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk"
FFLAGS="-arch i386 -arch x86_64"
check-prefix:
@if [ ! -d "$(PREFIX)" ]; then echo Set PREFIX to a directory - see README.osx; exit 1; fi
clean:
rm -rf zlib-${ZLIBVERSION}.tar.gz libpng-${PNGVERSION}.tar.bz2 \
freetype-${FREETYPEVERSION}.tar.bz2 bdist_mpkg-${BDISTMPKGVERSION}.tar.gz \
bdist_mpkg-${BDISTMPKGVERSION} \
zlib-${ZLIBVERSION} libpng-${PNGVERSION} freetype-${FREETYPEVERSION} \
build
fetch:
${PYTHON} -c 'import urllib; urllib.urlretrieve("http://superb-sea2.dl.sourceforge.net/project/libpng/zlib/${ZLIBVERSION}/zlib-${ZLIBVERSION}.tar.gz", "zlib-${ZLIBVERSION}.tar.gz")' &&\
${PYTHON} -c 'import urllib; urllib.urlretrieve("http://sourceforge.net/projects/libpng/files/libpng-stable/${PNGVERSION}/libpng-${PNGVERSION}.tar.gz/download", "libpng-${PNGVERSION}.tar.gz")' &&\
${PYTHON} -c 'import urllib; urllib.urlretrieve("http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPEVERSION}.tar.bz2", "freetype-${FREETYPEVERSION}.tar.bz2")'
zlib: check-prefix
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\
rm -rf zlib-${ZLIBVERSION} &&\
tar xvfz zlib-${ZLIBVERSION}.tar.gz &&\
cd zlib-${ZLIBVERSION} &&\
export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\
export CFLAGS=${CFLAGS} &&\
export LDFLAGS=${LDFLAGS} &&\
./configure --prefix=${PREFIX}&&\
MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} make -j3 install&& \
unset MACOSX_DEPLOYMENT_TARGET
png: zlib check-prefix
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\
rm -rf libpng-${PNGVERSION} &&\
tar xvfz libpng-${PNGVERSION}.tar.gz && \
cd libpng-${PNGVERSION} &&\
export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\
export CFLAGS=${CFLAGS} &&\
export LDFLAGS=${LDFLAGS} &&\
./configure --disable-dependency-tracking --prefix=${PREFIX} &&\
make -j3 install&&\
cp .libs/libpng.a . &&\
unset MACOSX_DEPLOYMENT_TARGET
freetype: zlib check-prefix
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\
rm -rf ${FREETYPEVERSION} &&\
tar xvfj freetype-${FREETYPEVERSION}.tar.bz2 &&\
cd freetype-${FREETYPEVERSION} &&\
export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\
export CFLAGS=${CFLAGS} &&\
export LDFLAGS=${LDFLAGS} &&\
./configure --prefix=${PREFIX} &&\
make -j3 install &&\
cp objs/.libs/libfreetype.a . &&\
unset MACOSX_DEPLOYMENT_TARGET
deps: zlib png freetype
echo 'all done'
mpl_build:
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\
export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\
export CFLAGS=${CFLAGS} &&\
export LDFLAGS=${LDFLAGS} &&\
${PYTHON} setup.py build
mpl_install: check-prefix
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\
export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\
export CFLAGS=${CFLAGS} &&\
export LDFLAGS=${LDFLAGS} &&\
${PYTHON} setup.py install --prefix=${PREFIX}
binaries: check-prefix
unset PKG_CONFIG_PATH &&\
cp release/osx/data/setup.cfg release/osx/data/ReadMe.txt . &&\
export CFLAGS=${CFLAGS} &&\
export LDFLAGS=${LDFLAGS} &&\
rm -f ${PREFIX}/lib/*.dylib &&\
VERSIONER_PYTHON_PREFER_32_BIT=yes bdist_mpkg --readme=ReadMe.txt &&\
hdiutil create -srcdir dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx${OSX_SDK_VER}.mpkg dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx${OSX_SDK_VER}.dmg &&\
VERSIONER_PYTHON_PREFER_32_BIT=yes ${PYTHON} setupegg.py bdist_egg