# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 119847 2014-05-08 01:44:42Z devans@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-Pillow
version             2.4.0
revision            1
categories-append   devel
platforms           darwin
license             BSD

python.versions     26 27 32 33 34

maintainers         stromnov openmaintainer

description         Python Imaging Library (fork)

long_description    ${description}

homepage            http://github.com/python-imaging/Pillow
master_sites        http://pypi.python.org/packages/source/P/Pillow/

distname            Pillow-${version}

checksums           rmd160  2692fee280a9abc595ebbb8df6d6a73f5c83667a \
                    sha256  2865c68b3a5638466b1837bf4a67c447e0cfdf7463309a068aad0e90aa03f58a

if {${name} ne ${subport}} {
    use_zip             yes

    conflicts       py${python.version}-pil

    depends_build       port:py${python.version}-setuptools
    depends_lib-append  port:py${python.version}-tkinter \
                        port:zlib \
                        port:jpeg \
                        port:tiff \
                        port:lcms \
                        port:webp \
                        port:openjpeg \
                        port:freetype

    patchfiles          patch-setup.py.diff

    post-patch {
        reinplace "s|@prefix@|${prefix}|g" ${worksrcpath}/setup.py
    }

    #build.args-append   --enable-zlib

    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       ${master_sites}
    livecheck.regex     {Pillow-(\d+(?:\.\d+)*)\.[tz]}
}
