2016-08-29 13:48:59 +03:00
|
|
|
import os
|
|
|
|
|
2016-09-15 11:15:23 +03:00
|
|
|
SF_MIRROR = 'http://iweb.dl.sourceforge.net'
|
2016-08-29 14:53:48 +03:00
|
|
|
PILLOW_DEPENDS_DIR = 'C:\\pillow-depends\\'
|
2016-08-29 13:48:59 +03:00
|
|
|
|
|
|
|
pythons = { # '26': 7,
|
|
|
|
'27': 7,
|
|
|
|
# '32': 7,
|
|
|
|
'33': 7.1,
|
|
|
|
'34': 7.1}
|
|
|
|
|
|
|
|
VIRT_BASE = "c:/vp/"
|
|
|
|
X64_EXT = os.environ.get('X64_EXT', "x64")
|
|
|
|
|
|
|
|
libs = {
|
2016-08-29 14:53:48 +03:00
|
|
|
# 'openjpeg': {
|
|
|
|
# 'filename': 'openjpeg-2.0.0-win32-x86.zip',
|
|
|
|
# 'version': '2.0'
|
|
|
|
# },
|
2016-08-29 13:48:59 +03:00
|
|
|
'zlib': {
|
2017-01-17 11:36:04 +03:00
|
|
|
'url': 'http://zlib.net/zlib1211.zip',
|
|
|
|
'filename': PILLOW_DEPENDS_DIR + 'zlib1211.zip',
|
|
|
|
'dir': 'zlib-1.2.11',
|
2016-08-29 13:48:59 +03:00
|
|
|
},
|
|
|
|
'jpeg': {
|
2016-09-15 11:15:23 +03:00
|
|
|
'url': 'http://www.ijg.org/files/jpegsr9b.zip',
|
2016-08-29 14:53:48 +03:00
|
|
|
'filename': PILLOW_DEPENDS_DIR + 'jpegsr9b.zip',
|
2016-08-29 13:48:59 +03:00
|
|
|
'dir': 'jpeg-9b',
|
|
|
|
},
|
|
|
|
'tiff': {
|
2017-03-27 12:04:42 +03:00
|
|
|
'url': 'ftp://download.osgeo.org/libtiff/tiff-4.0.7.zip',
|
2017-03-25 15:13:00 +03:00
|
|
|
'filename': PILLOW_DEPENDS_DIR + 'tiff-4.0.7.zip',
|
|
|
|
'dir': 'tiff-4.0.7',
|
2016-08-29 13:48:59 +03:00
|
|
|
},
|
|
|
|
'freetype': {
|
2017-02-14 12:27:02 +03:00
|
|
|
'url': 'https://download.savannah.gnu.org/releases/freetype/freetype-2.7.1.tar.gz',
|
2017-01-02 06:32:08 +03:00
|
|
|
'filename': PILLOW_DEPENDS_DIR + 'freetype-2.7.1.tar.gz',
|
|
|
|
'dir': 'freetype-2.7.1',
|
2016-08-29 13:48:59 +03:00
|
|
|
},
|
|
|
|
'lcms': {
|
2016-09-15 11:15:23 +03:00
|
|
|
'url': SF_MIRROR+'/project/lcms/lcms/2.7/lcms2-2.7.zip',
|
2016-08-29 14:53:48 +03:00
|
|
|
'filename': PILLOW_DEPENDS_DIR + 'lcms2-2.7.zip',
|
2016-08-29 13:48:59 +03:00
|
|
|
'dir': 'lcms2-2.7',
|
|
|
|
},
|
|
|
|
'tcl-8.5': {
|
2016-09-15 11:15:23 +03:00
|
|
|
'url': SF_MIRROR+'/project/tcl/Tcl/8.5.19/tcl8519-src.zip',
|
2016-08-29 14:53:48 +03:00
|
|
|
'filename': PILLOW_DEPENDS_DIR + 'tcl8519-src.zip',
|
2016-08-29 13:48:59 +03:00
|
|
|
'dir': '',
|
|
|
|
},
|
|
|
|
'tk-8.5': {
|
2016-09-15 11:15:23 +03:00
|
|
|
'url': SF_MIRROR+'/project/tcl/Tcl/8.5.19/tk8519-src.zip',
|
2016-08-29 14:53:48 +03:00
|
|
|
'filename': PILLOW_DEPENDS_DIR + 'tk8519-src.zip',
|
2016-08-29 13:48:59 +03:00
|
|
|
'dir': '',
|
|
|
|
'version': '8.5.19',
|
|
|
|
},
|
|
|
|
'tcl-8.6': {
|
2016-11-19 09:26:51 +03:00
|
|
|
'url': SF_MIRROR+'/project/tcl/Tcl/8.6.6/tcl866-src.zip',
|
|
|
|
'filename': PILLOW_DEPENDS_DIR + 'tcl866-src.zip',
|
2016-08-29 13:48:59 +03:00
|
|
|
'dir': '',
|
|
|
|
},
|
|
|
|
'tk-8.6': {
|
2016-11-19 09:26:51 +03:00
|
|
|
'url': SF_MIRROR+'/project/tcl/Tcl/8.6.6/tk866-src.zip',
|
|
|
|
'filename': PILLOW_DEPENDS_DIR + 'tk866-src.zip',
|
2016-08-29 13:48:59 +03:00
|
|
|
'dir': '',
|
2016-11-19 09:26:51 +03:00
|
|
|
'version': '8.6.6',
|
2016-08-29 13:48:59 +03:00
|
|
|
},
|
|
|
|
'webp': {
|
2017-02-09 11:14:25 +03:00
|
|
|
'url': 'http://downloads.webmproject.org/releases/webp/libwebp-0.6.0.tar.gz',
|
|
|
|
'filename': PILLOW_DEPENDS_DIR + 'libwebp-0.6.0.tar.gz',
|
|
|
|
'dir': 'libwebp-0.6.0',
|
2016-08-29 13:48:59 +03:00
|
|
|
},
|
|
|
|
'openjpeg': {
|
2016-11-19 10:22:53 +03:00
|
|
|
'url': SF_MIRROR+'/project/openjpeg/openjpeg/2.1.2/openjpeg-2.1.2.tar.gz',
|
|
|
|
'filename': PILLOW_DEPENDS_DIR + 'openjpeg-2.1.2.tar.gz',
|
|
|
|
'dir': 'openjpeg-2.1.2',
|
2016-08-29 13:48:59 +03:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
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',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-08-29 15:06:48 +03:00
|
|
|
def pyversion_from_env():
|
2016-08-29 13:48:59 +03:00
|
|
|
py = os.environ['PYTHON']
|
|
|
|
|
|
|
|
py_version = '27'
|
|
|
|
for k in pythons.keys():
|
|
|
|
if k in py:
|
|
|
|
py_version = k
|
|
|
|
break
|
|
|
|
|
|
|
|
if '64' in py:
|
|
|
|
py_version = '%s%s' % (py_version, X64_EXT)
|
|
|
|
|
|
|
|
return py_version
|
|
|
|
|
|
|
|
|
2016-08-29 15:06:48 +03:00
|
|
|
def compiler_from_env():
|
2016-08-29 13:48:59 +03:00
|
|
|
py = os.environ['PYTHON']
|
|
|
|
|
|
|
|
for k, v in pythons.items():
|
|
|
|
if k in py:
|
|
|
|
compiler_version = v
|
|
|
|
break
|
|
|
|
|
|
|
|
bit = 32
|
|
|
|
if '64' in py:
|
|
|
|
bit = 64
|
|
|
|
|
|
|
|
return compilers[(compiler_version, bit)]
|