freebsd-ports/devel/pydbus-common/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

80 lines
2.3 KiB
Makefile

# Created by: Gustau Perez i Querol <gustau.perez@gmail.com>
# $FreeBSD$
PORTNAME= dbus
PORTVERSION= 1.2.0
PORTREVISION?= 1
CATEGORIES= devel gnome python
MASTER_SITES= http://dbus.freedesktop.org/releases/dbus-python/
PKGNAMEPREFIX?= py
PKGNAMESUFFIX?= -common
DISTNAME= dbus-python-${PORTVERSION}
MAINTAINER= gnome@FreeBSD.org
COMMENT?= Common files for the Python bindings for the D-BUS messaging system
BUILD_DEPENDS= dbus-glib>=0:devel/dbus-glib
SLAVE_PORT?= no
USES= gettext gmake libtool pathfix pkgconfig
GNU_CONFIGURE= yes
CPPFLAGS+= -I${PYTHON_INCLUDEDIR}
CONFIGURE_ARGS= --docdir=${DOCSDIR} \
--disable-api-docs
INSTALL_TARGET= install-strip
.if ${SLAVE_PORT} == no
USES+= python:2,build
DOCSDIR= ${PREFIX}/share/doc/py-${PORTNAME}
EXAMPLESDIR= ${PREFIX}/share/examples/py-${PORTNAME}
OPTIONS_SUB= yes
OPTIONS_DEFINE= HTMLDOCS
HTMLDOCS_DESC= build html documentation
HTMLDOCS_CONFIGURE_OFF= --disable-html-docs
HTMLDOCS_BUILD_DEPENDS= rst2html:textproc/py-docutils
.include <bsd.port.options.mk>
post-patch:
.if ! ${PORT_OPTIONS:MDOCS}
@${REINPLACE_CMD} -e 's|HEADERS install-dist_docDATA|HEADERS|g ; \
s|PYTHON install-nodist_docDATA|PYTHON|g' \
${WRKSRC}/Makefile.in
.endif
do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/include/dbus-1.0/dbus/
${INSTALL_DATA} ${WRKSRC}/include/dbus-python.h \
${STAGEDIR}${PREFIX}/include/dbus-1.0/dbus/dbus-python.h
${INSTALL_DATA} ${WRKSRC}/dbus-python.pc \
${STAGEDIR}${PREFIX}/libdata/pkgconfig/dbus-python.pc
${MKDIR} ${STAGEDIR}${EXAMPLESDIR} && \
${INSTALL_DATA} ${WRKSRC}/examples/*.py ${STAGEDIR}${EXAMPLESDIR}
${MKDIR} ${STAGEDIR}${DOCSDIR} && \
${INSTALL_DATA} ${WRKSRC}/doc/*.txt ${STAGEDIR}${DOCSDIR} && \
${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR} && \
${INSTALL_DATA} ${WRKSRC}/NEWS ${STAGEDIR}${DOCSDIR}
.if ${PORT_OPTIONS:MHTMLDOCS}
${INSTALL_DATA} ${WRKSRC}/*.html ${STAGEDIR}${DOCSDIR} && \
${INSTALL_DATA} ${WRKSRC}/doc/*.html ${STAGEDIR}${DOCSDIR}
.endif
.else # slave is defined
LIB_DEPENDS+= libdbus-glib-1.so:devel/dbus-glib
RUN_DEPENDS+= pydbus-common>=0:devel/pydbus-common
USE_LDCONFIG= yes
USES+= python
USE_PYTHON= flavors
post-install:
@${RM} -r ${STAGEDIR}${PREFIX}/include/dbus-1.0 \
${STAGEDIR}${PREFIX}/libdata/pkgconfig/dbus-python.pc
@${RM} -r ${STAGEDIR}/${DOCSDIR}
.endif # end of slaving block
.include <bsd.port.mk>