1 |
commit: 26581ccc941f3b0d48abd79751a63d761065ea0c |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 31 04:34:32 2017 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 31 04:43:59 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26581ccc |
7 |
|
8 |
dev-python/pyparsing: force distutils to avoid circular dep with setuptools |
9 |
|
10 |
Bug: https://bugs.gentoo.org/607770 |
11 |
Package-Manager: Portage-2.3.3_p42_p432967, Repoman-2.3.1_p35_p432968 |
12 |
|
13 |
dev-python/pyparsing/files/distutils.patch | 11 +++++++++++ |
14 |
dev-python/pyparsing/pyparsing-2.1.10.ebuild | 21 ++++++++++++++++++--- |
15 |
2 files changed, 29 insertions(+), 3 deletions(-) |
16 |
|
17 |
diff --git a/dev-python/pyparsing/files/distutils.patch b/dev-python/pyparsing/files/distutils.patch |
18 |
new file mode 100644 |
19 |
index 00000000..af6a673 |
20 |
--- /dev/null |
21 |
+++ b/dev-python/pyparsing/files/distutils.patch |
22 |
@@ -0,0 +1,11 @@ |
23 |
+--- a/setup.py |
24 |
++++ b/setup.py |
25 |
+@@ -1,7 +1,7 @@ |
26 |
+ #!/usr/bin/env python |
27 |
+ |
28 |
+ """Setup script for the pyparsing module distribution.""" |
29 |
+-from setuptools import setup |
30 |
++from distutils.core import setup |
31 |
+ |
32 |
+ import sys |
33 |
+ import os |
34 |
|
35 |
diff --git a/dev-python/pyparsing/pyparsing-2.1.10.ebuild b/dev-python/pyparsing/pyparsing-2.1.10.ebuild |
36 |
index af9278e..c1a1247 100644 |
37 |
--- a/dev-python/pyparsing/pyparsing-2.1.10.ebuild |
38 |
+++ b/dev-python/pyparsing/pyparsing-2.1.10.ebuild |
39 |
@@ -1,4 +1,4 @@ |
40 |
-# Copyright 1999-2016 Gentoo Foundation |
41 |
+# Copyright 1999-2017 Gentoo Foundation |
42 |
# Distributed under the terms of the GNU General Public License v2 |
43 |
# $Id$ |
44 |
|
45 |
@@ -16,11 +16,14 @@ SLOT="0" |
46 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
47 |
IUSE="doc examples" |
48 |
|
49 |
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]" |
50 |
- |
51 |
# not contained in the tarball |
52 |
RESTRICT=test |
53 |
|
54 |
+PATCHES=( |
55 |
+ # Avoid circular dep with setuptools |
56 |
+ "${FILESDIR}/distutils.patch" |
57 |
+) |
58 |
+ |
59 |
python_install_all() { |
60 |
local HTML_DOCS=( HowToUsePyparsing.html ) |
61 |
if use doc; then |
62 |
@@ -34,3 +37,15 @@ python_install_all() { |
63 |
python_test() { |
64 |
${PYTHON} unitTests.py || die |
65 |
} |
66 |
+ |
67 |
+pkg_preinst() { |
68 |
+ _remove_egg_info() { |
69 |
+ local pyver="$("${PYTHON}" -c 'import sys; print(sys.version[:3])')" |
70 |
+ local egginfo="${ROOT%/}$(python_get_sitedir)/${P}-py${pyver}.egg-info" |
71 |
+ if [[ -d ${egginfo} ]]; then |
72 |
+ einfo "Removing ${egginfo}" |
73 |
+ rm -r "${egginfo}" || die |
74 |
+ fi |
75 |
+ } |
76 |
+ python_foreach_impl _remove_egg_info |
77 |
+} |