1 |
commit: 96c5b51c3554d8bf6aa703eb70b8e919742dba43 |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 20 10:19:56 2018 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 20 10:20:08 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96c5b51c |
7 |
|
8 |
dev-python/pyxattr: Fixed compilation against >=sys-apps/attr-2.4.48 |
9 |
|
10 |
Permission kindly granted by robbat2 |
11 |
|
12 |
Bug: https://bugs.gentoo.org/644060 |
13 |
Package-Manager: Portage-2.3.24, Repoman-2.3.6 |
14 |
|
15 |
.../pyxattr/files/pyxattr-0.6.0-xattr_header.patch | 53 +++++++++++++++++++ |
16 |
dev-python/pyxattr/pyxattr-0.6.0-r1.ebuild | 59 ++++++++++++++++++++++ |
17 |
2 files changed, 112 insertions(+) |
18 |
|
19 |
diff --git a/dev-python/pyxattr/files/pyxattr-0.6.0-xattr_header.patch b/dev-python/pyxattr/files/pyxattr-0.6.0-xattr_header.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..89b18730c3d |
22 |
--- /dev/null |
23 |
+++ b/dev-python/pyxattr/files/pyxattr-0.6.0-xattr_header.patch |
24 |
@@ -0,0 +1,53 @@ |
25 |
+From cc0bc63b291ee1a831f07c81946149dbe8c8146d Mon Sep 17 00:00:00 2001 |
26 |
+From: Lars Wendler <polynomial-c@g.o> |
27 |
+Date: Wed, 10 Jan 2018 11:45:35 +0100 |
28 |
+Subject: [PATCH] xattr.c: There is no more attr/xattr.h with >=attr-2.4.48 |
29 |
+ |
30 |
+See also: |
31 |
+http://git.savannah.nongnu.org/cgit/attr.git/commit/?id=7921157890d07858d092f4003ca4c6bae9fd2c38 |
32 |
+--- |
33 |
+ xattr.c | 13 +++---------- |
34 |
+ 1 file changed, 3 insertions(+), 10 deletions(-) |
35 |
+ |
36 |
+diff --git a/xattr.c b/xattr.c |
37 |
+index 111cec1..c82ee32 100644 |
38 |
+--- a/xattr.c |
39 |
++++ b/xattr.c |
40 |
+@@ -23,10 +23,8 @@ |
41 |
+ |
42 |
+ #define PY_SSIZE_T_CLEAN |
43 |
+ #include <Python.h> |
44 |
+-#if defined(__APPLE__) |
45 |
++#if defined(__APPLE__) || defined(__linux__) |
46 |
+ #include <sys/xattr.h> |
47 |
+-#elif defined(__linux__) |
48 |
+-#include <attr/xattr.h> |
49 |
+ #endif |
50 |
+ #include <stdio.h> |
51 |
+ |
52 |
+@@ -642,11 +640,7 @@ get_all(PyObject *self, PyObject *args, PyObject *keywds) |
53 |
+ /* Now retrieve the attribute value */ |
54 |
+ nval = _generic_get(_get_obj, &tgt, s, &buf_val, &nalloc, &io_errno); |
55 |
+ if (nval == -1) { |
56 |
+- if ( |
57 |
+-#ifdef ENODATA |
58 |
+- io_errno == ENODATA || |
59 |
+-#endif |
60 |
+- io_errno == ENOATTR) { |
61 |
++ if (io_errno == ENODATA) { |
62 |
+ PyErr_Clear(); |
63 |
+ continue; |
64 |
+ } else { |
65 |
+@@ -1173,8 +1167,7 @@ static char __xattr_doc__[] = \ |
66 |
+ " a :exc:`EnvironmentError`; under\n" |
67 |
+ " Linux, the following ``errno`` values are used:\n" |
68 |
+ "\n" |
69 |
+- " - ``ENOATTR`` and ``ENODATA`` mean that the attribute name is\n" |
70 |
+- " invalid\n" |
71 |
++ " - ``ENODATA`` means that the attribute name is\n invalid\n" |
72 |
+ " - ``ENOTSUP`` and ``EOPNOTSUPP`` mean that the filesystem does not\n" |
73 |
+ " support extended attributes, or that the namespace is invalid\n" |
74 |
+ " - ``E2BIG`` mean that the attribute value is too big\n" |
75 |
+-- |
76 |
+2.16.0.rc1 |
77 |
+ |
78 |
|
79 |
diff --git a/dev-python/pyxattr/pyxattr-0.6.0-r1.ebuild b/dev-python/pyxattr/pyxattr-0.6.0-r1.ebuild |
80 |
new file mode 100644 |
81 |
index 00000000000..02c1ec7d781 |
82 |
--- /dev/null |
83 |
+++ b/dev-python/pyxattr/pyxattr-0.6.0-r1.ebuild |
84 |
@@ -0,0 +1,59 @@ |
85 |
+# Copyright 1999-2018 Gentoo Foundation |
86 |
+# Distributed under the terms of the GNU General Public License v2 |
87 |
+ |
88 |
+EAPI=6 |
89 |
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy ) |
90 |
+ |
91 |
+inherit distutils-r1 eutils |
92 |
+ |
93 |
+DESCRIPTION="Python interface to xattr" |
94 |
+HOMEPAGE="http://pyxattr.k1024.org/" |
95 |
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz |
96 |
+ http://pyxattr.k1024.org/downloads/${P}.tar.gz" |
97 |
+ |
98 |
+LICENSE="LGPL-2.1" |
99 |
+SLOT="0" |
100 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux" |
101 |
+IUSE="doc test" |
102 |
+ |
103 |
+RDEPEND="sys-apps/attr" |
104 |
+DEPEND="${RDEPEND} |
105 |
+ dev-python/setuptools[${PYTHON_USEDEP}] |
106 |
+ doc? ( >=dev-python/sphinx-1.3.1[${PYTHON_USEDEP}] ) |
107 |
+ test? ( dev-python/nose[${PYTHON_USEDEP}] )" |
108 |
+ |
109 |
+PATCHES=( |
110 |
+ "${FILESDIR}/${PN}-0.6.0-xattr_header.patch" |
111 |
+) |
112 |
+ |
113 |
+python_prepare_all() { |
114 |
+ sed -i -e 's:, "-Werror"::' setup.py || die |
115 |
+ # Bug 548486 |
116 |
+ sed -e "s:html_theme = 'default':html_theme = 'classic':" \ |
117 |
+ -i doc/conf.py || die |
118 |
+ |
119 |
+ distutils-r1_python_prepare_all |
120 |
+} |
121 |
+ |
122 |
+python_compile_all() { |
123 |
+ use doc && emake doc |
124 |
+} |
125 |
+ |
126 |
+src_test() { |
127 |
+ # Perform the tests in /var/tmp; that location is more likely |
128 |
+ # to have xattr support than /tmp which is often tmpfs. |
129 |
+ export TESTDIR=/var/tmp |
130 |
+ |
131 |
+ einfo 'Please note that the tests fail if xattrs are not supported' |
132 |
+ einfo 'by the filesystem used for /var/tmp.' |
133 |
+ distutils-r1_src_test |
134 |
+} |
135 |
+ |
136 |
+python_test() { |
137 |
+ nosetests || die "Tests fail with ${EPYTHON}" |
138 |
+} |
139 |
+ |
140 |
+python_install_all() { |
141 |
+ use doc && local HTML_DOCS=( doc/html/. ) |
142 |
+ distutils-r1_python_install_all |
143 |
+} |