From 1ad678a5eab80240cfb2851ba073154b6192cef0 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Fri, 4 Apr 2014 13:01:07 -0700 Subject: [PATCH] build pillow for all the pythons --- winbuild/build.py | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 winbuild/build.py diff --git a/winbuild/build.py b/winbuild/build.py new file mode 100644 index 000000000..5e04166e5 --- /dev/null +++ b/winbuild/build.py @@ -0,0 +1,55 @@ +#/usr/bin/env python34 + +from config import * + +def setup_vms(): + ret = [] + for py in pythons.keys(): + for arch in ('', 'x64'): + ret.append("virtualenv -p c:/Python%s%s/python.exe --clear %s%s%s" % + (py, arch, VIRT_BASE, py, arch)) + return "\n".join(ret) + +def header(op): + return r""" +setlocal +set MPLSRC=%%~dp0\.. +set INCLIB=%%~dp0\depends +set BLDOPT=%s +cd /D %%MPLSRC%% +""" % (op) + +def footer(): + return """endlocal +exit +""" + +def build_one(py_ver, compiler): + args = {} + args.update(compiler) + args['py_ver'] = py_ver + return r""" +setlocal EnableDelayedExpansion +call "%%ProgramFiles%%\Microsoft SDKs\Windows\%(env_version)s\Bin\SetEnv.Cmd" /Release %(env_flags)s +set DISTUTILS_USE_SDK=1 +set LIB=%%LIB%%;%%INCLIB%%\%(inc_dir)s +set INCLUDE=%%INCLUDE%%;%%INCLIB%%\%(inc_dir)s;%%INCLIB%%\tcl85\include + +setlocal +set LIB=%%LIB%%;C:\Python%(py_ver)s\tcl +rd /q /s build +call c:\vp\%(py_ver)s\Scripts\python.exe setup.py %%BLDOPT%% +endlocal + +endlocal +""" % args + +script = [setup_vms(), header('install')] +for py_version, compiler_version in pythons.items(): + script.append(build_one(py_version, compilers[(compiler_version, 32)])) + script.append(build_one("%sx64" %py_version, compilers[(compiler_version, 64)])) +script.append(footer()) + +with open('build_pillows.cmd', 'w') as f: + f.write("\n".join(script)) +