freebsd-ports/x11-toolkits/py-wxPython30/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

68 lines
2 KiB
Makefile

# $FreeBSD$
PORTNAME= wxPython
PORTVERSION= 3.0.2.0
PORTREVISION= 4
DISTVERSIONPREFIX= src-
CATEGORIES= x11-toolkits python
MASTER_SITES= SF/wxpython/wxPython/${PORTVERSION}
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
PKGNAMESUFFIX= 30
MAINTAINER= python@FreeBSD.org
COMMENT= GUI toolkit for the Python programming language
DIST_SUBDIR= python
WRKSRC_SUBDIR= wxPython
USES= compiler:c++11-lib python:2.7 shebangfix tar:bzip2
SHEBANG_FILES= wx/tools/Editra/Editra.pyw
.if defined(WITH_WXVERSION_ONLY)
PKGNAMESUFFIX= -common
USE_PYTHON= py3kplist flavors
do-build:
${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py -d ${PYTHON_SITELIBDIR} -f ${WRKSRC}/wxversion
${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py -d ${PYTHON_SITELIBDIR} -f ${WRKSRC}/wxversion
do-install:
@${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
${INSTALL_DATA} ${WRKSRC}/wxversion/wxversion.py* ${STAGEDIR}${PYTHON_SITELIBDIR}/
${TOUCH} ${STAGEDIR}${PYTHON_SITELIBDIR}/wx.pth
.else
WXPORT= gtk2
WX_PYTHON_DIR= wx-${WX_VERSION}-${WXPORT}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}wxPython-common>0:x11-toolkits/py-wxPython-common@${FLAVOR}
USES+= gettext pkgconfig
USE_WX= 3.0
WANT_UNICODE= yes
USE_PYTHON= distutils autoplist
PYDISTUTILS_BUILDARGS= WX_CONFIG="${WX_CONFIG}" \
WXPORT="${WXPORT}" \
NO_SCRIPTS=1 \
INSTALL_MULTIVERSION=1
PYDISTUTILS_CONFIGUREARGS+= ${PYDISTUTILS_BUILDARGS}
PYDISTUTILS_INSTALLARGS+= ${PYDISTUTILS_BUILDARGS}
post-patch:
@${REINPLACE_CMD} -E \
-e 's,distutils\.command\.install\.install\),setuptools.command.install.install),g' \
-e 's,distutils\.command\.install$$,setuptools.command.install,g' \
-e 's,distutils\.command\.install\.install\.,setuptools.command.install.install.,g' \
${WRKSRC}/config.py
post-install:
@${ECHO_CMD} "@unexec ${REINPLACE_CMD} -i '' -e '\,${WX_PYTHON_DIR}$$,d' ${PYTHON_SITELIBDIR}/wx.pth 2>/dev/null || true" >> ${TMPPLIST}
@${ECHO_CMD} "@exec echo ${WX_PYTHON_DIR} >> ${PYTHON_SITELIBDIR}/wx.pth 2>/dev/null || true" >> ${TMPPLIST}
.endif
.include <bsd.port.mk>