freebsd-ports/graphics/py-pillow/Makefile
Mathieu Arnold 551be3c723 Convert Python ports to FLAVORS.
Ports using USE_PYTHON=distutils are now flavored.  They will
  automatically get flavors (py27, py34, py35, py36) depending on what
  versions they support.

  There is also a USE_PYTHON=flavors for ports that do not use distutils
  but need FLAVORS to be set.  A USE_PYTHON=noflavors can be set if
  using distutils but flavors are not wanted.

  A new USE_PYTHON=optsuffix that will add PYTHON_PKGNAMESUFFIX has been
  added to cope with Python ports that did not have the Python
  PKGNAMEPREFIX but are flavored.

  USES=python now also exports a PY_FLAVOR variable that contains the
  current python flavor.  It can be used in dependency lines when the
  port itself is not python flavored.  For example, deskutils/calibre.

  By default, all the flavors are generated.  To only generate flavors
  for the versions in PYTHON2_DEFAULT and PYTHON3_DEFAULT, define
  BUILD_DEFAULT_PYTHON_FLAVORS in your make.conf.

  In all the ports with Python dependencies, the *_DEPENDS entries MUST
  end with the flavor so that the framework knows which to build/use.
  This is done by appending '@${PY_FLAVOR}' after the origin (or
  @${FLAVOR} if in a Python module with Python flavors, as the content
  will be the same).  For example:

    RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR}

PR:		223071
Reviewed by:	portmgr, python
Sponsored by:	Absolight
Differential Revision:	https://reviews.freebsd.org/D12464
2017-11-30 15:50:30 +00:00

79 lines
2.5 KiB
Makefile

# Created by: Kubilay Kocak <koobs@FreeBSD.org>
# $FreeBSD$
PORTNAME= pillow
PORTVERSION= 3.4.2
PORTREVISION= 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 JPEG2000 LCMS PNG TIFF TKINTER WEBP
OPTIONS_DEFAULT= FREETYPE JPEG JPEG2000 PNG TKINTER WEBP
LCMS_DESC= Little Color Management System
TKINTER_DESC= Tkinter (Tcl/Tk) BitmapImage & PhotoImage support
FREETYPE_LIB_DEPENDS= libfreetype.so: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
JPEG2000_LIB_DEPENDS= libopenjp2.so:graphics/openjpeg
JPEG2000_VARS= PYDISTUTILS_BUILDARGS+=--enable-jpeg2000
JPEG2000_VARS_OFF= PYDISTUTILS_BUILDARGS+=--disable-jpeg2000
LCMS_LIB_DEPENDS= liblcms2.so: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: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:x11-toolkits/py-tkinter@${FLAVOR}
TKINTER_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}tkinter>0:x11-toolkits/py-tkinter@${FLAVOR}
TKINTER_VARS= PYDISTUTILS_BUILDARGS+="--include-dirs=${TCL_INCLUDEDIR}:${TK_INCLUDEDIR}"
WEBP_LIB_DEPENDS= libwebp.so:graphics/webp
WEBP_VARS= PYDISTUTILS_BUILDARGS+=--enable-webp --enable-webpmux
WEBP_VARS_OFF= PYDISTUTILS_BUILDARGS+=--disable-webp --disable-webpmux
USES= cpe python
USE_GITHUB= yes
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>