Pillow/winbuild/config.py

146 lines
3.9 KiB
Python
Raw Normal View History

2015-06-11 23:11:26 +03:00
import os
2014-04-05 00:00:52 +04:00
SF_MIRROR = 'http://iweb.dl.sourceforge.net'
2015-08-25 15:27:18 +03:00
pythons = { # '26': 7,
2015-06-20 06:43:14 +03:00
'27': 7,
2015-08-25 15:27:18 +03:00
# '32': 7,
2015-06-20 06:43:14 +03:00
'33': 7.1,
'34': 7.1}
2014-04-05 00:00:52 +04:00
VIRT_BASE = "c:/vp/"
2015-06-20 06:43:14 +03:00
X64_EXT = os.environ.get('X64_EXT', "x64")
2014-04-05 00:00:52 +04:00
2015-06-26 10:39:13 +03:00
libs = {
'zlib': {
'url': 'http://zlib.net/zlib128.zip',
'hash': 'md5:126f8676442ffbd97884eb4d6f32afb4',
'dir': 'zlib-1.2.8',
},
'jpeg': {
2016-01-21 11:50:36 +03:00
'url': 'http://www.ijg.org/files/jpegsr9b.zip',
'hash': 'md5:a21b8024d78ba05857a75272b4fa95ec', # not found - generated by wiredfool
'dir': 'jpeg-9b',
2015-06-26 10:39:13 +03:00
},
'tiff': {
2015-09-14 12:34:19 +03:00
'url': 'ftp://ftp.remotesensing.org/pub/libtiff/tiff-4.0.6.zip',
'hash': 'md5:f5b485d750b2001255ed64224b98b857',
'dir': 'tiff-4.0.6',
2015-06-26 10:39:13 +03:00
},
'freetype': {
2016-07-19 13:19:34 +03:00
'url': 'http://download.savannah.gnu.org/releases/freetype/freetype-2.6.5.tar.gz',
'hash': 'md5:31b2276515d9ee1c7f37d9c9f4f3145a',
'dir': 'freetype-2.6.5',
2015-06-26 10:39:13 +03:00
},
'lcms': {
'url': SF_MIRROR+'/project/lcms/lcms/2.7/lcms2-2.7.zip',
'hash': 'sha1:7ff1a5b721ca719760ba6eb4ec6f38d5e65381cf',
'dir': 'lcms2-2.7',
},
'tcl-8.5': {
2016-02-28 15:40:57 +03:00
'url': SF_MIRROR+'/project/tcl/Tcl/8.5.19/tcl8519-src.zip',
'hash': 'sha1:9de57fd34bd688716c16c978db96fa16a5fde924',
2015-06-26 10:39:13 +03:00
'dir': '',
},
'tk-8.5': {
2016-02-28 15:40:57 +03:00
'url': SF_MIRROR+'/project/tcl/Tcl/8.5.19/tk8519-src.zip',
'hash': 'sha1:78d0d2c81e024e0b48bfd7b2cc16718f08f46ed9',
2015-06-26 10:39:13 +03:00
'dir': '',
2016-02-28 15:40:57 +03:00
'version': '8.5.19',
2015-06-26 10:39:13 +03:00
},
'tcl-8.6': {
2016-03-05 03:54:53 +03:00
'url': SF_MIRROR+'/project/tcl/Tcl/8.6.5/tcl865-src.zip',
'hash': 'md5:932e360acb40ec760ebeed659bc893de',
2015-06-26 10:39:13 +03:00
'dir': '',
},
'tk-8.6': {
2016-03-05 03:54:53 +03:00
'url': SF_MIRROR+'/project/tcl/Tcl/8.6.5/tk865-src.zip',
'hash': 'md5:f2f5802a5a3b1f70b906e6930db12089',
2015-06-26 10:39:13 +03:00
'dir': '',
2016-03-05 03:54:53 +03:00
'version': '8.6.5',
2015-06-26 10:39:13 +03:00
},
'webp': {
2015-12-25 06:46:00 +03:00
'url': 'http://downloads.webmproject.org/releases/webp/libwebp-0.5.0.tar.gz',
'hash': 'sha1:d3de815b272fcf88fc4f2dc1ab65d176bcb8df68',
'dir': 'libwebp-0.5.0',
2015-06-26 10:39:13 +03:00
},
'openjpeg': {
'url': SF_MIRROR+'/project/openjpeg/openjpeg/2.1.0/openjpeg-2.1.0.tar.gz',
'hash': 'md5:f6419fcc233df84f9a81eb36633c6db6',
'dir': 'openjpeg-2.1.0',
},
}
bin_libs = {
2015-06-26 10:39:13 +03:00
'openjpeg': {
'filename': 'openjpeg-2.0.0-win32-x86.zip',
'hash': 'sha1:xxx',
'version': '2.0'
},
}
compilers = {
(7, 64): {
'env_version': 'v7.0',
'vc_version': '2008',
'env_flags': '/x64 /xp',
'inc_dir': 'msvcr90-x64',
'platform': 'x64',
'webp_platform': 'x64',
},
(7, 32): {
'env_version': 'v7.0',
'vc_version': '2008',
'env_flags': '/x86 /xp',
'inc_dir': 'msvcr90-x32',
'platform': 'Win32',
'webp_platform': 'x86',
},
(7.1, 64): {
'env_version': 'v7.1',
'vc_version': '2010',
'env_flags': '/x64 /vista',
'inc_dir': 'msvcr10-x64',
'platform': 'x64',
'webp_platform': 'x64',
},
(7.1, 32): {
'env_version': 'v7.1',
'vc_version': '2010',
'env_flags': '/x86 /vista',
'inc_dir': 'msvcr10-x32',
'platform': 'Win32',
'webp_platform': 'x86',
},
}
2015-06-11 23:11:26 +03:00
def pyversion_fromEnv():
py = os.environ['PYTHON']
py_version = '27'
2015-06-20 04:34:34 +03:00
for k in pythons.keys():
2015-06-11 23:11:26 +03:00
if k in py:
py_version = k
break
if '64' in py:
py_version = '%s%s' % (py_version, X64_EXT)
2015-06-11 23:11:26 +03:00
return py_version
2015-06-20 06:43:14 +03:00
2015-06-11 23:11:26 +03:00
def compiler_fromEnv():
py = os.environ['PYTHON']
2015-06-20 06:43:14 +03:00
for k, v in pythons.items():
2015-06-11 23:11:26 +03:00
if k in py:
compiler_version = v
break
bit = 32
if '64' in py:
bit = 64
return compilers[(compiler_version, bit)]