tkabber: EAPI bump
[booboo.git] / dev-python / pycparser / pycparser-9999.ebuild
blob9c1ef24b27eb6dd84c7771715cd6c9fa6348dd9a
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=6
6 PYTHON_COMPAT=( python3_{4,5,6,7} pypy pypy3 )
8 inherit distutils-r1
10 DESCRIPTION="C parser and AST generator written in Python"
11 HOMEPAGE="https://github.com/eliben/pycparser"
12 if [[ ${PV} == *9999* ]]; then
13 inherit git-r3
14 EGIT_REPO_URI="https://github.com/eliben/pycparser"
15 else
16 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
17 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris"
20 LICENSE="BSD"
21 SLOT="0"
22 IUSE="test"
24 RDEPEND="dev-python/ply:=[${PYTHON_USEDEP}]"
25 DEPEND="${RDEPEND}
26 dev-python/setuptools[${PYTHON_USEDEP}]
27 test? ( dev-python/nose[${PYTHON_USEDEP}] )"
29 python_prepare_all() {
30 if [[ ${PV} != *9999* ]]; then
31 # remove the original files to guarantee their regen
32 rm pycparser/{c_ast,lextab,yacctab}.py || die
35 # kill sys.path manipulations to force the tests to use built files
36 sed -i -e '/sys\.path/d' tests/*.py || die
38 distutils-r1_python_prepare_all
41 python_compile() {
42 distutils-r1_python_compile
44 # note: tables built by py3.5+ are incompatible with older versions
45 # because of 100 group limit of 're' module -- just generate them
46 # separately optimized for each target instead
47 pushd "${BUILD_DIR}"/lib/pycparser > /dev/null || die
48 "${PYTHON}" _build_tables.py || die
49 popd > /dev/null || die
52 python_test() {
53 # change workdir to avoid '.' import
54 nosetests -v -w tests || die