1 |
commit: 63207c8570eafab4e274685d9c62c0f19dd21a23 |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 31 04:39:38 2017 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 31 04:44:00 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=63207c85 |
7 |
|
8 |
dev-python/packaging: force distutils |
9 |
|
10 |
Package-Manager: Portage-2.3.3_p42_p433273, Repoman-2.3.1_p35_p433273 |
11 |
|
12 |
.../packaging/files/packaging-16.8-distutils.patch | 14 ++++++++++ |
13 |
dev-python/packaging/packaging-16.8.ebuild | 30 +++++++++++++++++----- |
14 |
2 files changed, 38 insertions(+), 6 deletions(-) |
15 |
|
16 |
diff --git a/dev-python/packaging/files/packaging-16.8-distutils.patch b/dev-python/packaging/files/packaging-16.8-distutils.patch |
17 |
new file mode 100644 |
18 |
index 00000000..84bbb61 |
19 |
--- /dev/null |
20 |
+++ b/dev-python/packaging/files/packaging-16.8-distutils.patch |
21 |
@@ -0,0 +1,14 @@ |
22 |
+--- a/setup.py |
23 |
++++ b/setup.py |
24 |
+@@ -13,10 +13,7 @@ import re |
25 |
+ # dependency when projects attempt to unbundle stuff from setuptools and pip. |
26 |
+ # Though we don't really support that, it makes things easier if we do this and |
27 |
+ # should hopefully cause less issues for end users. |
28 |
+-try: |
29 |
+- from setuptools import setup |
30 |
+-except ImportError: |
31 |
+- from distutils.core import setup |
32 |
++from distutils.core import setup |
33 |
+ |
34 |
+ |
35 |
+ base_dir = os.path.dirname(__file__) |
36 |
|
37 |
diff --git a/dev-python/packaging/packaging-16.8.ebuild b/dev-python/packaging/packaging-16.8.ebuild |
38 |
index 993971d..0a55423 100644 |
39 |
--- a/dev-python/packaging/packaging-16.8.ebuild |
40 |
+++ b/dev-python/packaging/packaging-16.8.ebuild |
41 |
@@ -17,18 +17,36 @@ LICENSE="|| ( Apache-2.0 BSD-2 )" |
42 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
43 |
IUSE="test" |
44 |
|
45 |
-RDEPEND="" |
46 |
-DEPEND="${RDEPEND} |
47 |
+RDEPEND=" |
48 |
+ >=dev-python/pyparsing-2.1.10[${PYTHON_USEDEP}] |
49 |
+ dev-python/six[${PYTHON_USEDEP}] |
50 |
+" |
51 |
+DEPEND=" |
52 |
test? ( |
53 |
dev-python/pretend[${PYTHON_USEDEP}] |
54 |
dev-python/pytest[${PYTHON_USEDEP}] |
55 |
) |
56 |
" |
57 |
-PDEPEND=" |
58 |
- dev-python/pyparsing[${PYTHON_USEDEP}] |
59 |
- dev-python/six[${PYTHON_USEDEP}] |
60 |
-" |
61 |
+ |
62 |
+PATCHES=( |
63 |
+ "${FILESDIR}/${PN}-16.8-distutils.patch" |
64 |
+) |
65 |
|
66 |
python_test() { |
67 |
py.test --capture=no --strict -v || die |
68 |
} |
69 |
+ |
70 |
+pkg_preinst() { |
71 |
+ # https://bugs.gentoo.org/585146 |
72 |
+ cd "${HOME}" || die |
73 |
+ |
74 |
+ _cleanup() { |
75 |
+ local pyver=$("${PYTHON}" -c "from distutils.sysconfig import get_python_version; print(get_python_version())") |
76 |
+ local egginfo="${ROOT%/}$(python_get_sitedir)/${P}-py${pyver}.egg-info" |
77 |
+ if [[ -d ${egginfo} ]]; then |
78 |
+ echo rm -r "${egginfo}" |
79 |
+ rm -r "${egginfo}" || die "Failed to remove egg-info directory" |
80 |
+ fi |
81 |
+ } |
82 |
+ python_foreach_impl _cleanup |
83 |
+} |