blob: 80e82f6ec05ad8603cba3fb1c3a18bf71d245ad2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
# Created by: Dryice Dong Liu <dryice@dryice.name>
# $FreeBSD$
PORTNAME= sqlalchemy
PORTVERSION= 0.8.2
CATEGORIES= databases python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
DISTNAME= SQLAlchemy-${DISTVERSION}
MAINTAINER= nivit@FreeBSD.org
COMMENT= Python SQL toolkit and Object Relational Mapper
LICENSE= MIT
LATEST_LINK= ${PKGNAMEPREFIX}${PORTNAME}-devel
TEST_DEPENDS:= ${RUN_DEPENDS} \
${PYTHON_PKGNAMEPREFIX}nose>0:${PORTSDIR}/devel/py-nose
# Python3 ready
USE_PYTHON= yes
USE_PYDISTUTILS= easy_install
PY2TO3_CMD= ${LOCALBASE}/bin/2to3-${PYTHON_VER}
PY2TO3_ARGS= --no-diffs --nobackups --verbose --write
PYDISTUTILS_INSTALLARGS= --always-unzip \
--install-dir ${PYEASYINSTALL_SITELIBDIR} \
--no-deps \
--optimize 2 \
--quiet \
--script-dir ${PYEASYINSTALL_BINDIR} \
--site-dir ${PYEASYINSTALL_SITELIBDIR} \
${WRKSRC}/dist/${PYEASYINSTALL_EGG}
PYDISTUTILS_PKGNAME= SQLAlchemy
PYDISTUTILS_PKGVERSION= ${DISTVERSION}
PYDISTUTILS_NOEGGINFO= yes
PYEASYINSTALL_ARCHDEP= yes
OPTIONS_DEFINE= DOCS EXAMPLES TESTS
OPTIONS_MULTI= BACKEND
OPTIONS_MULTI_BACKEND= FIREBIRD MSSQL MYSQL PGSQL SQLITE SYBASE
OPTIONS_DEFAULT= SQLITE
FIREBIRD_DESC= Firebird backend
MSSQL_DESC= MS SQL Server backend
SYBASE_DESC= Sybase backend
TESTS_DESC= Include nose for unit tests
# bypass infrastructure bug
OPTIONSFILE= ${PORT_DBDIR}/py-${PORTNAME}/options
NO_STAGE= yes
.include <bsd.port.options.mk>
DOCSDIR= ${PREFIX}/share/doc/${PKGNAMEPREFIX}${PORTNAME}
EXAMPLESDIR= ${PREFIX}/share/examples/${PKGNAMEPREFIX}${PORTNAME}
.include <bsd.port.pre.mk>
.if ${PORT_OPTIONS:MDOCS}
AL_PORTDOCS= *.html *.js
AL_PORTDOCS_SUBDIR= core dialects orm
.endif
.if ${PORT_OPTIONS:MFIREBIRD}
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/kinterbasdb/__init__.py:${PORTSDIR}/databases/kinterbasdb
.endif
.if ${PORT_OPTIONS:MMSSQL}
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/pymssql.py:${PORTSDIR}/databases/py-mssql
.endif
.if ${PORT_OPTIONS:MMYSQL}
.if ${PYTHON_VER} < 3.0
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}MySQLdb>=1.2.2:${PORTSDIR}/databases/py-MySQLdb
#.else
# At the moment databases/py-pymysql does not build with Python3
# See https://github.com/petehunt/PyMySQL#python-3-0-support
#RUN_DEPENDS+= pymysql>=0.5:${PORTSDIR}/databases/py-pymysql
.endif
.endif
.if ${PORT_OPTIONS:MPGSQL}
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}psycopg2>=2.0.8:${PORTSDIR}/databases/py-psycopg2
.endif
.if ${PORT_OPTIONS:MSQLITE}
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3
.endif
.if ${PORT_OPTIONS:MSYBASE}
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/Sybase.py:${PORTSDIR}/databases/py-sybase
.endif
.if ${PORT_OPTIONS:MTESTS}
BUILD_DEPENDS:= ${TEST_DEPENDS}
.endif
.if ${PYTHON_REL} < 330
TEST_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}mock>=1.0.1:${PORTSDIR}/devel/py-mock
.endif
.if ${PYTHON_REL} >= 300
pre-build:
@${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/lib
.endif
post-install:
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${DOCSDIR}
.if ${PYTHON_REL} >= 300
@${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/doc
.endif
.for i in ${AL_PORTDOCS}
${INSTALL_DATA} ${WRKSRC}/doc/${i} ${DOCSDIR}
.endfor
.for i in ${AL_PORTDOCS_SUBDIR}
@${MKDIR} ${DOCSDIR}/${i}
cd ${WRKSRC}/doc/${i} && ${COPYTREE_SHARE} . ${DOCSDIR}/${i}
.endfor
.endif
.if ${PORT_OPTIONS:MEXAMPLES}
@${MKDIR} ${EXAMPLESDIR}
.if ${PYTHON_REL} >= 300
@${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/examples
.endif
cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} . ${EXAMPLESDIR}
.endif
.if ${PYTHON_REL} < 300
PLIST_SUB+= SPEEDUPS=""
.else
# C extensions are not supported in py3k
PLIST_SUB+= SPEEDUPS="@comment "
PYEASYINSTALL_OSARCH=
easyinstall-setopt:
${DO_NADA}
.endif
.if ${PYTHON_REL} >= 320
.include "${PORTSDIR}/devel/py-virtualenv/files/py3k-fix-pkg-plist.inc"
.endif
regression-test: build
.if ${PYTHON_REL} >= 300
${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/test
.endif
@cd ${WRKSRC} && ${PYTHON_CMD} sqla_nose.py
.include <bsd.port.post.mk>
|