1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 pypy )
6 PYTHON_REQ_USE='sqlite?,threads(+)'
7 WEBAPP_NO_AUTO_INSTALL="yes"
9 inherit bash-completion-r1 distutils-r1 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"
20 IUSE="doc mysql postgres sqlite test"
22 PY2_USEDEP=$(python_gen_usedep 'python*')
23 RDEPEND="dev-python/pillow[${PYTHON_USEDEP}]
24 postgres? ( dev-python/psycopg:2[${PY2_USEDEP}] )
25 mysql? ( >=dev-python/mysql-python-1.2.3[${PY2_USEDEP}] )"
27 doc? ( >=dev-python/sphinx-1.0.7[${PYTHON_USEDEP}] )
28 test? ( $(python_gen_impl_dep sqlite) )"
30 REQUIRED_USE="mysql? ( $(python_gen_useflags 'python2*') )
31 postgres? ( || ( $(python_gen_useflags 'python2*') ) )"
33 S="${WORKDIR}/${MY_P}"
35 WEBAPP_MANUAL_SLOT="yes"
37 PATCHES=( "${FILESDIR}"/${PN}-1.5.4-objects.patch \
38 "${FILESDIR}"/${PN}-1.5-py3tests.patch )
40 python_compile_all() {
47 # Tests have non-standard assumptions about PYTHONPATH,
48 # and don't work with ${BUILD_DIR}/lib.
49 # https://code.djangoproject.com/ticket/20514
50 PYTHONPATH=. "${PYTHON}" tests/runtests.py --settings=test_sqlite -v1 \
51 || die "Tests fail with ${EPYTHON}"
55 distutils-r1_src_install
59 python_install_all() {
60 newbashcomp extras/django_bash_completion ${PN}
63 rm -fr docs/_build/html/_sources
64 local HTML_DOCS=( docs/_build/html/. )
67 insinto "${MY_HTDOCSDIR#${EPREFIX}}"
68 doins -r django/contrib/admin/static/admin/.
69 distutils-r1_python_install_all
73 elog "A copy of the admin media is available to webapp-config for installation in a"
74 elog "webroot, as well as the traditional location in python's site-packages dir"
75 elog "for easy development."