aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/py-pillow/Makefile
blob: 729bd69eb58739444b357335acfcc597abb57899 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Created by: Kubilay Kocak <koobs@FreeBSD.org>
# $FreeBSD$

PORTNAME=   pillow
PORTVERSION=    3.1.1
CATEGORIES= graphics python
PKGNAMEPREFIX=  ${PYTHON_PKGNAMEPREFIX}

MAINTAINER= koobs@FreeBSD.org
COMMENT=    Fork of the Python Imaging Library (PIL)

LICENSE=    PIL
LICENSE_NAME=   Standard PIL License
LICENSE_FILE=   ${WRKSRC}/LICENSE
LICENSE_PERMS=  dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

OPTIONS_DEFINE=     FREETYPE JPEG LCMS PNG TIFF TKINTER WEBP
OPTIONS_DEFAULT=    FREETYPE JPEG PNG TKINTER WEBP

LCMS_DESC=      Little Color Management System
TKINTER_DESC=       Tkinter (Tcl/Tk) BitmapImage & PhotoImage support

FREETYPE_LIB_DEPENDS=   libfreetype.so:${PORTSDIR}/print/freetype2
FREETYPE_VARS=      PYDISTUTILS_BUILDARGS+=--enable-freetype
FREETYPE_VARS_OFF=  PYDISTUTILS_BUILDARGS+=--disable-freetype

JPEG_USES=      jpeg
JPEG_VARS=      PYDISTUTILS_BUILDARGS+=--enable-jpeg
JPEG_VARS_OFF=      PYDISTUTILS_BUILDARGS+=--disable-jpeg

LCMS_LIB_DEPENDS=   liblcms2.so:${PORTSDIR}/graphics/lcms2
LCMS_VARS=      PYDISTUTILS_BUILDARGS+=--enable-lcms
LCMS_VARS_OFF=      PYDISTUTILS_BUILDARGS+=--disable-lcms

PNG_VARS=       PYDISTUTILS_BUILDARGS+=--enable-zlib
PNG_VARS_OFF=       PYDISTUTILS_BUILDARGS+=--disable-zlib

TIFF_LIB_DEPENDS=   libtiff.so:${PORTSDIR}/graphics/tiff
TIFF_VARS=      PYDISTUTILS_BUILDARGS+=--enable-tiff
TIFF_VARS_OFF=      PYDISTUTILS_BUILDARGS+=--disable-tiff

TKINTER_USES=       tk
TKINTER_BUILD_DEPENDS=  ${PYTHON_PKGNAMEPREFIX}tkinter>0:${PORTSDIR}/x11-toolkits/py-tkinter
TKINTER_RUN_DEPENDS=    ${PYTHON_PKGNAMEPREFIX}tkinter>0:${PORTSDIR}/x11-toolkits/py-tkinter
TKINTER_VARS=       PYDISTUTILS_BUILDARGS+="--enable-tcl --enable-tk --include-dirs=${TCL_INCLUDEDIR}:${TK_INCLUDEDIR}"
TKINTER_VARS_OFF=   PYDISTUTILS_BUILDARGS+="--disable-tcl --disable-tk"

WEBP_LIB_DEPENDS=   libwebp.so:${PORTSDIR}/graphics/webp
WEBP_VARS=      PYDISTUTILS_BUILDARGS+=--enable-webp
WEBP_VARS_OFF=      PYDISTUTILS_BUILDARGS+=--disable-webp

USES=       cpe python
USE_GITHUB= yes
USES=       python
USE_PYTHON= autoplist concurrent distutils

GH_ACCOUNT= python-${PORTNAME}
GH_PROJECT= ${PORTNAME:C/p/P/}

CONFLICTS_INSTALL=  py*-imaging-*

.include <bsd.port.pre.mk>

PYDISTUTILS_BUILD_TARGET=   build build_ext
PYDISTUTILS_BUILDARGS+=     saveopts

post-install:
    ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/PIL/*.so

do-test:
    @cd ${WRKSRC} && \
    ${PYTHON_CMD} ${PYSETUP} build_ext -i && \
    ${PYTHON_CMD} selftest.py && \
    ${PYTHON_CMD} -m nose -vx Tests/test_*.py

.include <bsd.port.post.mk>