mirror of
https://git.freebsd.org/ports.git
synced 2025-06-02 19:36:28 -04:00
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
81 lines
2.4 KiB
Makefile
81 lines
2.4 KiB
Makefile
# Created by: Dryice Dong Liu <dryice@dryice.name>
|
|
# $FreeBSD$
|
|
|
|
PORTNAME= sqlalchemy
|
|
PORTVERSION= 1.0.14
|
|
CATEGORIES= databases python
|
|
MASTER_SITES= CHEESESHOP
|
|
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
|
PKGNAMESUFFIX= 10
|
|
DISTNAME= SQLAlchemy-${DISTVERSION}
|
|
|
|
MAINTAINER= m.tsatsenko@gmail.com
|
|
COMMENT= Python SQL toolkit and Object Relational Mapper 1.0.x
|
|
|
|
LICENSE= MIT
|
|
|
|
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${FLAVOR} \
|
|
${PYTHON_PKGNAMEPREFIX}mock>0:devel/py-mock@${FLAVOR}
|
|
|
|
USES= python
|
|
USE_PYTHON= distutils autoplist
|
|
|
|
PY2TO3_CMD= ${LOCALBASE}/bin/2to3-${PYTHON_VER}
|
|
PY2TO3_ARGS= --no-diffs --nobackups --verbose --write
|
|
TEST_TARGET= do-test
|
|
|
|
CONFLICTS_INSTALL= ${PYTHON_PKGNAMEPREFIX}sqlalchemy0[6789]*
|
|
|
|
OPTIONS_DEFINE= DOCS EXAMPLES
|
|
OPTIONS_MULTI= BACKEND
|
|
OPTIONS_MULTI_BACKEND= MSSQL MYSQL PGSQL SQLITE SYBASE
|
|
OPTIONS_DEFAULT= SQLITE
|
|
|
|
MSSQL_DESC= MS SQL Server backend
|
|
SYBASE_DESC= Sybase backend
|
|
|
|
MSSQL_RUN_DEPENDS= ${PYTHON_SITELIBDIR}/pymssql.py:databases/py-pymssql@${FLAVOR}
|
|
PGSQL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}psycopg2>=2.0.8:databases/py-psycopg2@${FLAVOR}
|
|
SQLITE_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${FLAVOR}
|
|
SYBASE_RUN_DEPENDS= ${PYTHON_SITELIBDIR}/Sybase.py:databases/py-sybase@${FLAVOR}
|
|
|
|
PORTDOCS= *
|
|
PORTEXAMPLES= *
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
.if ${PYTHON_REL} < 3000
|
|
MYSQL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}MySQLdb>=1.2.2:databases/py-MySQLdb@${FLAVOR}
|
|
#.else
|
|
# At the moment databases/py-pymysql does not build with Python3
|
|
# See https://github.com/petehunt/PyMySQL#python-3-0-support
|
|
#MYSQL_RUN_DEPENDS+= pymysql>=0.5:databases/py-pymysql@${FLAVOR}
|
|
.endif
|
|
|
|
pre-build:
|
|
.if ${PYTHON_REL} >= 3000
|
|
@${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/lib
|
|
@${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/doc
|
|
@${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/examples
|
|
.endif
|
|
|
|
# C extensions are not supported with all versions of Python, so ignore
|
|
# errors here if there are no .so files to strip.
|
|
post-install:
|
|
-@${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/sqlalchemy/*.so
|
|
|
|
post-install-DOCS-on:
|
|
@${MKDIR} ${STAGEDIR}${DOCSDIR}
|
|
cd ${WRKSRC}/doc/ && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}
|
|
|
|
post-install-EXAMPLES-on:
|
|
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
|
|
cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}
|
|
|
|
do-test:
|
|
.if ${PYTHON_REL} >= 3000
|
|
${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/test
|
|
.endif
|
|
@(cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest)
|
|
|
|
.include <bsd.port.post.mk>
|