Skip to content

Commit ad5693d

Browse files
committed
finished win32 release scripts
svn path=/trunk/matplotlib/; revision=7147
1 parent 5edf334 commit ad5693d

File tree

5 files changed

+214
-93
lines changed

5 files changed

+214
-93
lines changed

release/win32/Makefile

+41-14
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,47 @@
1-
PYTHON=C:/Python26/python.exe
2-
SRCDIR=${PWD}
3-
ZLIBVERSION=1.2.3
4-
PNGVERSION=1.2.33
5-
FREETYPEVERSION=2.3.7
6-
MPLVERSION=0.98.5.3
1+
PYTHON = C:/Python26/python.exe
2+
SRCDIR = ${PWD} # autoconf needs this path
3+
WINSRCDIR = `${PWD}/data/mingw_path.sh ${PWD}` # distutils needs windows paths
4+
ZLIBVERSION = 1.2.3
5+
PNGVERSION = 1.2.33
6+
FREETYPEVERSION = 2.3.7
7+
#TCLTKVERSION = 8.4.19 # Before Python 2.6
8+
TCLTKVERSION = 8.5.7 # Python 2.6
9+
MPLVERSION = 0.98.6svn
710

811
## You shouldn't need to configure past this point
912

10-
CFLAGS="-Os -I${SRCDIR}/zlib-${ZLIBVERSION} -I${SRCDIR}/libpng-${PNGVERSION} -I${SRCDIR}/freetype-${FREETYPEVERSION}/include"
13+
CFLAGS = -Os
14+
CFLAGS += -I${SRCDIR}/zlib-${ZLIBVERSION}
15+
CFLAGS += -I${SRCDIR}/libpng-${PNGVERSION}
16+
CFLAGS += -I${SRCDIR}/freetype-${FREETYPEVERSION}/include
17+
CFLAGS += -I${SRCDIR}/tcl${TCLTKVERSION}-src/generic
18+
CFLAGS += -I${SRCDIR}/tcl${TCLTKVERSION}-src/win
19+
CFLAGS += -I${SRCDIR}/tk${TCLTKVERSION}-src/generic
20+
CFLAGS += -I${SRCDIR}/tk${TCLTKVERSION}-src/win
21+
CFLAGS += -I${SRCDIR}/tk${TCLTKVERSION}-src/X11
1122

12-
LDFLAGS="-L${SRCDIR}/zlib-${ZLIBVERSION} -L${SRCDIR}/libpng-${PNGVERSION} -L${SRCDIR}/freetype-${FREETYPEVERSION}"
23+
LDFLAGS = -L${SRCDIR}/zlib-${ZLIBVERSION}
24+
LDFLAGS += -L${SRCDIR}/libpng-${PNGVERSION}
25+
LDFLAGS += -L${SRCDIR}/freetype-${FREETYPEVERSION}s
26+
27+
PY_INCLUDE = "${WINSRCDIR}\\zlib-${ZLIBVERSION};${WINSRCDIR}/libpng-${PNGVERSION};${WINSRCDIR}/freetype-${FREETYPEVERSION}/include;${WINSRCDIR}/tcl${TCLTKVERSION}/generic;${WINSRCDIR}/tcl${TCLTKVERSION}/win;${WINSRCDIR}/tk${TCLTKVERSION}/generic;${WINSRCDIR}/tk${TCLTKVERSION}/win;${WINSRCDIR}/tk${TCLTKVERSION}/xlib"
28+
29+
PY_LINKER = "${WINSRCDIR}/zlib-${ZLIBVERSION};${WINSRCDIR}/libpng-${PNGVERSION};${WINSRCDIR}/freetype-${FREETYPEVERSION}"
1330

1431
clean:
1532
rm -rf zlib-${ZLIBVERSION}.tar.gz libpng-${PNGVERSION}.tar.bz2 \
1633
freetype-${FREETYPEVERSION}.tar.bz2 \
34+
tcl${TCLTKVERSION}-src.tar.gz tk${TCLTKVERSION}-src.tar.gz \
1735
zlib-${ZLIBVERSION} libpng-${PNGVERSION} freetype-${FREETYPEVERSION} \
36+
tcl${TCLTKVERSION} tk${TCLTKVERSION} \
1837
matplotlib-${MPLVERSION} *~
1938

2039
fetch_deps:
2140
wget http://www.zlib.net/zlib-${ZLIBVERSION}.tar.gz
2241
wget http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-${PNGVERSION}.tar.bz2
2342
wget http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPEVERSION}.tar.bz2
43+
wget http://prdownloads.sourceforge.net/tcl/tcl${TCLTKVERSION}-src.tar.gz
44+
wget http://prdownloads.sourceforge.net/tcl/tk${TCLTKVERSION}-src.tar.gz
2445

2546
zlib:
2647
rm -rf zlib-${ZLIBVERSION}
@@ -33,8 +54,8 @@ png: zlib
3354
rm -rf libpng-${PNGVERSION}
3455
tar xvfj libpng-${PNGVERSION}.tar.bz2
3556
cd libpng-${PNGVERSION} &&\
36-
export CFLAGS=${CFLAGS} &&\
37-
export LDFLAGS=${LDFLAGS} &&\
57+
export CFLAGS="${CFLAGS}" &&\
58+
export LDFLAGS="${LDFLAGS}" &&\
3859
./configure --disable-shared &&\
3960
make -j3 &&\
4061
cp .libs/libpng.a .
@@ -48,15 +69,21 @@ freetype:
4869
mingw32-make -j3 &&\
4970
cp objs/libfreetype.a .
5071

51-
dependencies: png freetype
72+
tcltk:
73+
rm -rf tcl${TCLTKVERSION}
74+
rm -rf tk${TCLTKVERSION}
75+
tar xvfz tcl${TCLTKVERSION}-src.tar.gz
76+
tar xvfz tk${TCLTKVERSION}-src.tar.gz
77+
78+
dependencies: png freetype tcltk
5279

5380
installers:
5481
rm -rf matplotlib-${MPLVERSION}
5582
tar xvzf matplotlib-${MPLVERSION}.tar.gz
5683
cd matplotlib-${MPLVERSION} &&\
5784
rm -rf build &&\
58-
cp ../data/setup.cfg . &&\
59-
${PYTHON} setup.py build -c mingw32 bdist_wininst &&\
60-
${PYTHON} setupegg.py build -c mingw32 bdist_egg
85+
cp ../data/setup*.* . &&\
86+
${PYTHON} setupwin.py build_ext -c mingw32 -I ${PY_INCLUDE} -L ${PY_LINKER} bdist_wininst &&\
87+
${PYTHON} setupwinegg.py build_ext -c mingw32 -I ${PY_INCLUDE} -L ${PY_LINKER} bdist_egg
6188

6289
all: fetch_deps dependencies installers

release/win32/data/mingw_path.sh

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/sh
2+
3+
# This script will convert a UNIX path to a Win32 native path
4+
UPATH=$1
5+
if test "$UPATH" = ""; then
6+
echo EMPTY
7+
exit 1
8+
fi
9+
#echo "INPUT IS \"$UPATH\"" >&2
10+
if [ -d "$UPATH" ]
11+
then
12+
cd "$UPATH"
13+
WPATH=`pwd -W`
14+
else
15+
# cd up to parent directories until we find
16+
# one that exists. Loop ends at "/".
17+
dpart=`dirname "$UPATH"`
18+
#echo "dpart starts as \"$dpart\"" >&2
19+
while [ ! -d "$dpart" ]
20+
do
21+
dpart=`dirname "$dpart"`
22+
#echo "dpart is \"$dpart\"" >&2
23+
done
24+
#echo "dpart ends as \"$dpart\"" >&2
25+
26+
if [ "$dpart" != "." ]
27+
then
28+
dstart=`expr length "$dpart"`
29+
# If the last character in dpart is not "/",
30+
# then advance dstart by one index. This
31+
# avoids two dir seperators in the result.
32+
last=`expr length "$dpart"`
33+
last=`expr $last - 1`
34+
last=${dpart:$last:1}
35+
#echo "last is \"$last\"" >&2
36+
if [ "$last" != "/" ]
37+
then
38+
dstart=`expr $dstart + 1`
39+
fi
40+
dend=`expr length "$UPATH"`
41+
dlen=`expr $dend - $dstart`
42+
#echo "UPATH is \"$UPATH\"" >&2
43+
#echo "dstart is $dstart, dend is $dend, dlen is $dlen" >&2
44+
bpart=${UPATH:$dstart:$dend}
45+
dpart=`cd "$dpart" ; pwd -W`
46+
#echo "dpart \"$dpart\"" >&2
47+
#echo "bpart \"$bpart\"" >&2
48+
else
49+
dpart=`pwd -W`
50+
bpart=$UPATH
51+
fi
52+
WPATH=${dpart}/${bpart}
53+
fi
54+
#echo "OUTPUT IS \"$WPATH\"" >&2
55+
echo $WPATH
56+
exit 0
57+

release/win32/data/setup.cfg

+79-79
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
1-
# Rename this file to setup.cfg to modify matplotlib's
2-
# build options.
3-
4-
[egg_info]
5-
tag_svn_revision = 1
6-
7-
[status]
8-
# To suppress display of the dependencies and their versions
9-
# at the top of the build log, uncomment the following line:
10-
#suppress = True
11-
#
12-
# Uncomment to insert lots of diagnostic prints in extension code
13-
#verbose = True
14-
15-
[provide_packages]
16-
# By default, matplotlib checks for a few dependencies and
17-
# installs them if missing. This feature can be turned off
18-
# by uncommenting the following lines. Acceptible values are:
19-
# True: install, overwrite an existing installation
20-
# False: do not install
21-
# auto: install only if the package is unavailable. This
22-
# is the default behavior
23-
#
24-
## Date/timezone support:
25-
pytz = True
26-
dateutil = True
27-
28-
29-
[gui_support]
30-
# Matplotlib supports multiple GUI toolkits, including Cocoa,
31-
# GTK, Fltk, MacOSX, Qt, Qt4, Tk, and WX. Support for many of
32-
# these toolkits requires AGG, the Anti-Grain Geometry library,
33-
# which is provided by matplotlib and built by default.
34-
#
35-
# Some backends are written in pure Python, and others require
36-
# extension code to be compiled. By default, matplotlib checks
37-
# for these GUI toolkits during installation and, if present,
38-
# compiles the required extensions to support the toolkit. GTK
39-
# support requires the GTK runtime environment and PyGTK. Wx
40-
# support requires wxWidgets and wxPython. Tk support requires
41-
# Tk and Tkinter. The other GUI toolkits do not require any
42-
# extension code, and can be used as long as the libraries are
43-
# installed on your system.
44-
#
45-
# You can uncomment any the following lines if you know you do
46-
# not want to use the GUI toolkit. Acceptible values are:
47-
# True: build the extension. Exits with a warning if the
48-
# required dependencies are not available
49-
# False: do not build the extension
50-
# auto: build if the required dependencies are available,
51-
# otherwise skip silently. This is the default
52-
# behavior
53-
#
54-
gtk = False
55-
gtkagg = False
56-
tkagg = True
57-
wxagg = False
58-
macosx = False
59-
60-
[rc_options]
61-
# User-configurable options
62-
#
63-
# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg, GTKCairo,
64-
# FltkAgg, MacOSX, Pdf, Ps, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg.
65-
#
66-
# The Agg, Ps, Pdf and SVG backends do not require external
67-
# dependencies. Do not choose GTK, GTKAgg, GTKCairo, MacOSX, TkAgg or WXAgg
68-
# if you have disabled the relevent extension modules. Agg will be used
69-
# by default.
70-
#
71-
backend = TkAgg
72-
#
73-
# The numerix module was historically used to provide
74-
# compatibility between the Numeric, numarray, and NumPy array
75-
# packages. Now that NumPy has emerge as the universal array
76-
# package for python, numerix is not really necessary and is
77-
# maintained to provide backward compatibility. Do not change
78-
# this unless you have a compelling reason to do so.
79-
#numerix = numpy
1+
# Rename this file to setup.cfg to modify matplotlib's
2+
# build options.
3+
4+
[egg_info]
5+
tag_svn_revision = 0
6+
7+
[status]
8+
# To suppress display of the dependencies and their versions
9+
# at the top of the build log, uncomment the following line:
10+
#suppress = True
11+
#
12+
# Uncomment to insert lots of diagnostic prints in extension code
13+
#verbose = True
14+
15+
[provide_packages]
16+
# By default, matplotlib checks for a few dependencies and
17+
# installs them if missing. This feature can be turned off
18+
# by uncommenting the following lines. Acceptible values are:
19+
# True: install, overwrite an existing installation
20+
# False: do not install
21+
# auto: install only if the package is unavailable. This
22+
# is the default behavior
23+
#
24+
## Date/timezone support:
25+
pytz = True
26+
dateutil = True
27+
28+
29+
[gui_support]
30+
# Matplotlib supports multiple GUI toolkits, including Cocoa,
31+
# GTK, Fltk, MacOSX, Qt, Qt4, Tk, and WX. Support for many of
32+
# these toolkits requires AGG, the Anti-Grain Geometry library,
33+
# which is provided by matplotlib and built by default.
34+
#
35+
# Some backends are written in pure Python, and others require
36+
# extension code to be compiled. By default, matplotlib checks
37+
# for these GUI toolkits during installation and, if present,
38+
# compiles the required extensions to support the toolkit. GTK
39+
# support requires the GTK runtime environment and PyGTK. Wx
40+
# support requires wxWidgets and wxPython. Tk support requires
41+
# Tk and Tkinter. The other GUI toolkits do not require any
42+
# extension code, and can be used as long as the libraries are
43+
# installed on your system.
44+
#
45+
# You can uncomment any the following lines if you know you do
46+
# not want to use the GUI toolkit. Acceptible values are:
47+
# True: build the extension. Exits with a warning if the
48+
# required dependencies are not available
49+
# False: do not build the extension
50+
# auto: build if the required dependencies are available,
51+
# otherwise skip silently. This is the default
52+
# behavior
53+
#
54+
gtk = False
55+
gtkagg = False
56+
tkagg = True
57+
wxagg = False
58+
macosx = False
59+
60+
[rc_options]
61+
# User-configurable options
62+
#
63+
# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg, GTKCairo,
64+
# FltkAgg, MacOSX, Pdf, Ps, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg.
65+
#
66+
# The Agg, Ps, Pdf and SVG backends do not require external
67+
# dependencies. Do not choose GTK, GTKAgg, GTKCairo, MacOSX, TkAgg or WXAgg
68+
# if you have disabled the relevent extension modules. Agg will be used
69+
# by default.
70+
#
71+
backend = TkAgg
72+
#
73+
# The numerix module was historically used to provide
74+
# compatibility between the Numeric, numarray, and NumPy array
75+
# packages. Now that NumPy has emerge as the universal array
76+
# package for python, numerix is not really necessary and is
77+
# maintained to provide backward compatibility. Do not change
78+
# this unless you have a compelling reason to do so.
79+
#numerix = numpy

release/win32/data/setupwin.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from distutils import cygwinccompiler
2+
3+
try:
4+
# Python 2.6
5+
# Replace the msvcr func to return an empty list
6+
cygwinccompiler.get_msvcr
7+
cygwinccompiler.get_msvcr = lambda: []
8+
9+
except AttributeError:
10+
# Before Python 2.6
11+
# Wrap the init func to clear to dll libs
12+
def new_init(self, **kwargs):
13+
cygwinccompiler.CygwinCCompiler.__init__(self, **kwargs)
14+
self.dll_libraries = []
15+
cygwinccompiler.CygwinCCompiler.__init__ = new_init
16+
17+
execfile('setup.py')

release/win32/data/setupwinegg.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from distutils import cygwinccompiler
2+
3+
try:
4+
# Python 2.6
5+
# Replace the msvcr func to return an empty list
6+
cygwinccompiler.get_msvcr
7+
cygwinccompiler.get_msvcr = lambda: []
8+
9+
except AttributeError:
10+
# Before Python 2.6
11+
# Wrap the init func to clear to dll libs
12+
def new_init(self, **kwargs):
13+
cygwinccompiler.CygwinCCompiler.__init__(self, **kwargs)
14+
self.dll_libraries = []
15+
cygwinccompiler.CygwinCCompiler.__init__ = new_init
16+
17+
from setuptools import setup
18+
execfile('setup.py',
19+
{'additional_params' :
20+
{'namespace_packages' : ['mpl_toolkits']}})

0 commit comments

Comments
 (0)