1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
7 PYTHON_REQ_USE='sqlite?,threads(+)'
9 inherit bash-completion-r1 distutils-r1 eutils versionator webapp
13 DESCRIPTION="High-level Python web framework"
14 HOMEPAGE="https://www.djangoproject.com/ https://pypi.python.org/pypi/Django"
15 SRC_URI="https://www.djangoproject.com/m/releases/$(get_version_component_range 1-2)/${MY_P}.tar.gz"
24 dev-python/setuptools[${PYTHON_USEDEP}]
26 $(python_gen_impl_dep sqlite)
27 dev-python/docutils[${PYTHON_USEDEP}]
28 <dev-python/numpy-1.9[$(python_gen_usedep 'python*')]
29 dev-python/pillow[${PYTHON_USEDEP}]
30 dev-python/pytz[${PYTHON_USEDEP}]
31 dev-python/pyyaml[${PYTHON_USEDEP}]
32 dev-python/pillow[${PYTHON_USEDEP}]
35 # app-text/pytextile[${PYTHON_USEDEP}]
36 # dev-python/markdown[${PYTHON_USEDEP}]
37 # dev-python/selenium[${PYTHON_USEDEP}]
38 # dev-python/py-bcrypt[${PYTHON_USEDEP}]
40 S="${WORKDIR}/${MY_P}"
42 WEBAPP_MANUAL_SLOT="yes"
45 "${FILESDIR}"/${PN}-1.4.19-bashcomp.patch
48 python_prepare_all() {
49 # Disable tests requiring network connection.
51 -e "s/test_correct_url_value_passes/_&/" \
52 -e "s/test_correct_url_with_redirect/_&/" \
53 -i tests/modeltests/validation/tests.py || die
55 -e "s/test_urlfield_3/_&/" \
56 -e "s/test_urlfield_4/_&/" \
57 -e "s/test_urlfield_10/_&/" \
58 -i tests/regressiontests/forms/tests/fields.py || die
60 distutils-r1_python_prepare_all
64 # Tests have non-standard assumptions about PYTHONPATH,
65 # and don't work with ${BUILD_DIR}/lib.
66 PYTHONPATH=. "${PYTHON}" tests/runtests.py --settings=test_sqlite -v2 \
67 || die "Tests fail with ${EPYTHON}"
71 distutils-r1_src_install
74 elog "Additional Backend support can be enabled via"
75 optfeature "MySQL backend support in python 2.7 only" dev-python/mysql-python
76 optfeature "MySQL backend support in python 2.7 - 3.4" dev-python/mysql-connector-python
77 optfeature "PostgreSQL backend support" dev-python/psycopg:2
78 optfeature "Memcached support" dev-python/pylibmc dev-python/python-memcached
79 optfeature "ImageField Support" dev-python/pillow
83 python_install_all() {
84 newbashcomp extras/django_bash_completion ${PN}-admin
85 bashcomp_alias ${PN}-admin django-admin.py
87 insinto "${MY_HTDOCSDIR#${EPREFIX}}"
88 doins -r django/contrib/admin/static/admin/.
89 distutils-r1_python_install_all
93 elog "A copy of the admin media is available to"
94 elog "webapp-config for installation in a webroot,"
95 elog "as well as the traditional location in python's"
96 elog "site-packages dir for easy development"
98 ewarn "If you build Django ${PV} without USE=\"vhosts\""
100 # XXX: call webapp_pkg_postinst? the old ebuild didn't do that...
101 ewarn "webapp-config will automatically install the"
102 ewarn "admin media into the localhost webroot."