Remove +tk variant, provide pil
This commit is contained in:
parent
652a5eb592
commit
2efc67da60
@ -24,6 +24,7 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class Openjpeg(Package):
|
class Openjpeg(Package):
|
||||||
"""
|
"""
|
||||||
OpenJPEG is an open-source JPEG 2000 codec written in C language.
|
OpenJPEG is an open-source JPEG 2000 codec written in C language.
|
||||||
@ -42,6 +43,7 @@ class Openjpeg(Package):
|
|||||||
version('1.5.2', '545f98923430369a6b046ef3632ef95c')
|
version('1.5.2', '545f98923430369a6b046ef3632ef95c')
|
||||||
version('1.5.1', 'd774e4b5a0db5f0f171c4fc0aabfa14e')
|
version('1.5.1', 'd774e4b5a0db5f0f171c4fc0aabfa14e')
|
||||||
|
|
||||||
|
depends_on('cmake')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
cmake('.', *std_cmake_args)
|
cmake('.', *std_cmake_args)
|
||||||
|
@ -24,14 +24,19 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class PyPil(Package):
|
class PyPil(Package):
|
||||||
"""The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities."""
|
"""The Python Imaging Library (PIL) adds image processing capabilities
|
||||||
|
to your Python interpreter. This library supports many file formats,
|
||||||
|
and provides powerful image processing and graphics capabilities."""
|
||||||
|
|
||||||
homepage = "http://www.pythonware.com/products/pil/"
|
homepage = "http://www.pythonware.com/products/pil/"
|
||||||
url = "http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz"
|
url = "http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz"
|
||||||
|
|
||||||
version('1.1.7', 'fc14a54e1ce02a0225be8854bfba478e')
|
version('1.1.7', 'fc14a54e1ce02a0225be8854bfba478e')
|
||||||
|
|
||||||
|
provides('pil')
|
||||||
|
|
||||||
extends('python')
|
extends('python')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
|
@ -34,27 +34,35 @@ class PyPillow(Package):
|
|||||||
homepage = "https://python-pillow.org/"
|
homepage = "https://python-pillow.org/"
|
||||||
url = "https://pypi.python.org/packages/source/P/Pillow/Pillow-3.0.0.tar.gz"
|
url = "https://pypi.python.org/packages/source/P/Pillow/Pillow-3.0.0.tar.gz"
|
||||||
|
|
||||||
version('3.2.0', '7cfd093c11205d9e2ebe3c51dfcad510')
|
# TODO: This version should be deleted once the next release comes out.
|
||||||
|
# TODO: It fixes a bug that prevented us from linking to Tk/Tcl.
|
||||||
|
# TODO: Tk/Tcl support is necessary for tkinter bitmap and photo images.
|
||||||
|
# TODO: If you require this support, run the following command:
|
||||||
|
# TODO: `spack install py-pillow@3.3.0.dev0 ^python+tk`
|
||||||
|
version('3.3.0.dev0', git='https://github.com/python-pillow/Pillow.git',
|
||||||
|
commit='30eced62868141a6c859a4370efd40b9434a7c3f')
|
||||||
|
|
||||||
|
version('3.2.0', '7cfd093c11205d9e2ebe3c51dfcad510', preferred=True)
|
||||||
version('3.0.0', 'fc8ac44e93da09678eac7e30c9b7377d')
|
version('3.0.0', 'fc8ac44e93da09678eac7e30c9b7377d')
|
||||||
|
|
||||||
|
provides('pil')
|
||||||
|
|
||||||
# These defaults correspond to Pillow defaults
|
# These defaults correspond to Pillow defaults
|
||||||
variant('jpeg', default=True, description='Provide JPEG functionality')
|
variant('jpeg', default=True, description='Provide JPEG functionality')
|
||||||
variant('zlib', default=True, description='Access to compressed PNGs')
|
variant('zlib', default=True, description='Access to compressed PNGs')
|
||||||
variant('tiff', default=False, description='Access to TIFF files')
|
variant('tiff', default=False, description='Access to TIFF files')
|
||||||
variant('freetype', default=False, description='Font related services')
|
variant('freetype', default=False, description='Font related services')
|
||||||
variant('lcms', default=False, description='Color management')
|
variant('lcms', default=False, description='Color management')
|
||||||
variant('tk', default=False, description='Support for tkinter bitmap and photo images')
|
|
||||||
variant('jpeg2000', default=False, description='Provide JPEG 2000 functionality')
|
variant('jpeg2000', default=False, description='Provide JPEG 2000 functionality')
|
||||||
|
|
||||||
# Spack does not (yet) support these modes of building
|
# Spack does not (yet) support these modes of building
|
||||||
# variant('webp', default=False, description='Provide the WebP format')
|
# variant('webp', default=False, description='Provide the WebP format')
|
||||||
# variant('webpmux', default=False, description='WebP metadata, relies on WebP support')
|
# variant('webpmux', default=False, description='WebP metadata, relies on WebP support')
|
||||||
# variant('imagequant', default=False, description='Provide improved color quantization')
|
# variant('imagequant', default=False, description='Provide improved color quantization')
|
||||||
|
|
||||||
provides('PIL')
|
|
||||||
|
|
||||||
# Required dependencies
|
# Required dependencies
|
||||||
extends('python')
|
extends('python')
|
||||||
|
depends_on('binutils')
|
||||||
depends_on('py-setuptools')
|
depends_on('py-setuptools')
|
||||||
|
|
||||||
# Recommended dependencies
|
# Recommended dependencies
|
||||||
@ -62,16 +70,14 @@ class PyPillow(Package):
|
|||||||
depends_on('zlib', when='+zlib')
|
depends_on('zlib', when='+zlib')
|
||||||
|
|
||||||
# Optional dependencies
|
# Optional dependencies
|
||||||
depends_on('libtiff', when='+tiff')
|
depends_on('libtiff', when='+tiff')
|
||||||
depends_on('freetype', when='+freetype')
|
depends_on('freetype', when='+freetype')
|
||||||
depends_on('lcms', when='+lcms')
|
depends_on('lcms', when='+lcms')
|
||||||
depends_on('tcl', when='+tk')
|
|
||||||
depends_on('tk', when='+tk')
|
|
||||||
depends_on('openjpeg', when='+jpeg2000')
|
depends_on('openjpeg', when='+jpeg2000')
|
||||||
|
|
||||||
# Spack does not (yet) support these modes of building
|
# Spack does not (yet) support these modes of building
|
||||||
# depends_on('webp', when='+webp')
|
# depends_on('webp', when='+webp')
|
||||||
# depends_on('webpmux', when='+webpmux')
|
# depends_on('webpmux', when='+webpmux')
|
||||||
# depends_on('imagequant', when='+imagequant')
|
# depends_on('imagequant', when='+imagequant')
|
||||||
|
|
||||||
def patch(self):
|
def patch(self):
|
||||||
@ -106,11 +112,6 @@ def patch(self):
|
|||||||
'LCMS_ROOT = ("{0}", "{1}")'.format(
|
'LCMS_ROOT = ("{0}", "{1}")'.format(
|
||||||
spec['lcms'].prefix.lib,
|
spec['lcms'].prefix.lib,
|
||||||
spec['lcms'].prefix.include))
|
spec['lcms'].prefix.include))
|
||||||
if '+tk' in spec:
|
|
||||||
setup.filter('TCL_ROOT = None',
|
|
||||||
'TCL_ROOT = ("{0}", "{1}")'.format(
|
|
||||||
spec['tcl'].prefix.lib,
|
|
||||||
spec['tcl'].prefix.include))
|
|
||||||
if '+jpeg2000' in spec:
|
if '+jpeg2000' in spec:
|
||||||
setup.filter('JPEG2K_ROOT = None',
|
setup.filter('JPEG2K_ROOT = None',
|
||||||
'JPEG2K_ROOT = ("{0}", "{1}")'.format(
|
'JPEG2K_ROOT = ("{0}", "{1}")'.format(
|
||||||
@ -118,18 +119,12 @@ def patch(self):
|
|||||||
spec['openjpeg'].prefix.include))
|
spec['openjpeg'].prefix.include))
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
build_args = [
|
def variant_to_flag(variant):
|
||||||
'--{0}-jpeg'.format('enable' if '+jpeg' in spec else 'disable'),
|
able = 'enable' if '+{0}'.format(variant) in spec else 'disable'
|
||||||
'--{0}-zlib'.format('enable' if '+zlib' in spec else 'disable'),
|
return '--{0}-{1}'.format(able, variant)
|
||||||
'--{0}-tiff'.format('enable' if '+tiff' in spec else 'disable'),
|
|
||||||
'--{0}-freetype'.format(
|
variants = ['jpeg', 'zlib', 'tiff', 'freetype', 'lcms', 'jpeg2000']
|
||||||
'enable' if '+freetype' in spec else 'disable'),
|
build_args = list(map(variant_to_flag, variants))
|
||||||
'--{0}-lcms'.format('enable' if '+lcms' in spec else 'disable'),
|
|
||||||
'--{0}-tk'.format('enable' if '+tk' in spec else 'disable'),
|
|
||||||
'--{0}-tcl'.format('enable' if '+tk' in spec else 'disable'),
|
|
||||||
'--{0}-jpeg2000'.format(
|
|
||||||
'enable' if '+jpeg2000' in spec else 'disable')
|
|
||||||
]
|
|
||||||
|
|
||||||
python('setup.py', 'build_ext', *build_args)
|
python('setup.py', 'build_ext', *build_args)
|
||||||
python('setup.py', 'install', '--prefix={0}'.format(prefix))
|
python('setup.py', 'install', '--prefix={0}'.format(prefix))
|
||||||
|
Loading…
Reference in New Issue
Block a user