ports/textproc/translate-toolkit/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

65 lines
2.2 KiB
Makefile

# Created by: Andrew Pantyukhin <infofarmer@FreeBSD.org>
# $FreeBSD$
PORTNAME= translate-toolkit
PORTVERSION= 2.2.4
CATEGORIES= textproc
MASTER_SITES= CHEESESHOP
MAINTAINER= jpaetzel@FreeBSD.org
COMMENT= Converts between many translation formats
LICENSE= GPLv2
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlite3>=0:databases/py-sqlite3@${FLAVOR} \
${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${FLAVOR} \
${PYTHON_PKGNAMEPREFIX}vobject>=0:deskutils/py-vobject@${FLAVOR} \
msghack:devel/gettext-msghack \
${PYTHON_PKGNAMEPREFIX}iniparse>=0:devel/py-iniparse@${FLAVOR} \
${PYTHON_PKGNAMEPREFIX}levenshtein>=0:devel/py-levenshtein@${FLAVOR} \
${PYTHON_PKGNAMEPREFIX}lxml>=0:devel/py-lxml@${FLAVOR} \
iso-codes>=1.3:misc/iso-codes \
bash:shells/bash \
${PYTHON_PKGNAMEPREFIX}utidylib>=0:www/py-utidylib@${FLAVOR}
RUN_DEPENDS:= ${BUILD_DEPENDS}
# Can use psyco (on i386)
NO_ARCH= yes
USES= gettext python:2.7
USE_PYTHON= autoplist distutils
# list of manual pages to generate
GEN_MAN= csv2po.1 csv2tbx.1 dtd2po.1 html2po.1 ical2po.1 idml2po.1 \
ini2po.1 json2po.1 moz2po.1 mozlang2po.1 odf2xliff.1 oo2po.1 \
oo2xliff.1 php2po.1 po2csv.1 po2dtd.1 po2html.1 po2ical.1 \
po2idml.1 po2ini.1 po2json.1 po2moz.1 po2mozlang.1 po2oo.1 \
po2php.1 po2prop.1 po2rc.1 po2resx.1 po2sub.1 po2symb.1 \
po2tiki.1 po2tmx.1 po2ts.1 po2txt.1 po2web2py.1 po2wordfast.1 \
po2xliff.1 pot2po.1 prop2po.1 rc2po.1 resx2po.1 sub2po.1 \
symb2po.1 tbx2po.1 tiki2po.1 web2py2po.1 xliff2odf.1 xliff2oo.1
post-patch:
@${FIND} ${WRKSRC}/tools -type f -print0 | ${XARGS} -0 \
${REINPLACE_CMD} -e \
's|^#!/bin/bash|#!${LOCALBASE}/bin/bash| ; \
s|mktemp|mktemp -t /tmp|'
post-build:
@${MKDIR} ${WRKDIR}/manpages
.for i in ${GEN_MAN:S|.1||}
cd ${WRKSRC}/build/lib/translate/convert && \
${SETENV} PYTHONPATH=${WRKSRC}/build/lib ${PYTHON_CMD} \
${i}.py --man > ${WRKDIR}/manpages/${i}.1
.endfor
post-install:
.for i in ${GEN_MAN}
cd ${WRKDIR}/manpages && ${INSTALL_MAN} ${i} ${STAGEDIR}${PREFIX}/man/man1
.endfor
list-man1: build
@cd ${WRKSRC}/build/scripts-* && ${GREP} -l "${PYTHON_CMD}" * | \
${EGREP} -v '(build_tmdb|pocount|poterminology|tmserver)' | \
${TR} "\n" " "
.include <bsd.port.mk>