From 65df2f480b8d7d5609a4d9b75eed9fe671e5451d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Sun, 26 Apr 2020 12:21:31 +0300 Subject: [PATCH] =?UTF-8?q?dev-python/pyxattr:=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=D0=BE=D1=81=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=BE=D0=B4?= =?UTF-8?q?=D0=B4=D0=B5=D1=80=D0=B6=D0=BA=D0=B8=20python2.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev-python/pyxattr/Manifest | 1 + .../files/pyxattr-0.6.0-xattr_header.patch | 53 ++++++++++++++ dev-python/pyxattr/pyxattr-0.6.0-r2.ebuild | 70 +++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 dev-python/pyxattr/Manifest create mode 100644 dev-python/pyxattr/files/pyxattr-0.6.0-xattr_header.patch create mode 100644 dev-python/pyxattr/pyxattr-0.6.0-r2.ebuild diff --git a/dev-python/pyxattr/Manifest b/dev-python/pyxattr/Manifest new file mode 100644 index 000000000..a7a3423b7 --- /dev/null +++ b/dev-python/pyxattr/Manifest @@ -0,0 +1 @@ +DIST pyxattr-0.6.0.tar.gz 31057 BLAKE2B cf6e99c499dbcc74305970413803e5cf59508e7ee1bf247afe42e576c2dfaf118a374ad6f8721b9d9c482f8be0c222d26b82997dc1ccc79248d5f52b2064ed8d SHA512 c56bf57729b5f8c8e3e19e29fd903b7365c6644abe3dcebf57ffc2f97a1e92d0e22cdc0a967c5abee3a74ba61a2a379e31a1734f45449095bdb7895b8357a9bb 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 new file mode 100644 index 000000000..89b18730c --- /dev/null +++ b/dev-python/pyxattr/files/pyxattr-0.6.0-xattr_header.patch @@ -0,0 +1,53 @@ +From cc0bc63b291ee1a831f07c81946149dbe8c8146d Mon Sep 17 00:00:00 2001 +From: Lars Wendler +Date: Wed, 10 Jan 2018 11:45:35 +0100 +Subject: [PATCH] xattr.c: There is no more attr/xattr.h with >=attr-2.4.48 + +See also: +http://git.savannah.nongnu.org/cgit/attr.git/commit/?id=7921157890d07858d092f4003ca4c6bae9fd2c38 +--- + xattr.c | 13 +++---------- + 1 file changed, 3 insertions(+), 10 deletions(-) + +diff --git a/xattr.c b/xattr.c +index 111cec1..c82ee32 100644 +--- a/xattr.c ++++ b/xattr.c +@@ -23,10 +23,8 @@ + + #define PY_SSIZE_T_CLEAN + #include +-#if defined(__APPLE__) ++#if defined(__APPLE__) || defined(__linux__) + #include +-#elif defined(__linux__) +-#include + #endif + #include + +@@ -642,11 +640,7 @@ get_all(PyObject *self, PyObject *args, PyObject *keywds) + /* Now retrieve the attribute value */ + nval = _generic_get(_get_obj, &tgt, s, &buf_val, &nalloc, &io_errno); + if (nval == -1) { +- if ( +-#ifdef ENODATA +- io_errno == ENODATA || +-#endif +- io_errno == ENOATTR) { ++ if (io_errno == ENODATA) { + PyErr_Clear(); + continue; + } else { +@@ -1173,8 +1167,7 @@ static char __xattr_doc__[] = \ + " a :exc:`EnvironmentError`; under\n" + " Linux, the following ``errno`` values are used:\n" + "\n" +- " - ``ENOATTR`` and ``ENODATA`` mean that the attribute name is\n" +- " invalid\n" ++ " - ``ENODATA`` means that the attribute name is\n invalid\n" + " - ``ENOTSUP`` and ``EOPNOTSUPP`` mean that the filesystem does not\n" + " support extended attributes, or that the namespace is invalid\n" + " - ``E2BIG`` mean that the attribute value is too big\n" +-- +2.16.0.rc1 + diff --git a/dev-python/pyxattr/pyxattr-0.6.0-r2.ebuild b/dev-python/pyxattr/pyxattr-0.6.0-r2.ebuild new file mode 100644 index 000000000..8b690a7ca --- /dev/null +++ b/dev-python/pyxattr/pyxattr-0.6.0-r2.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +PYTHON_COMPAT=( python2_7 python3_{6,7} ) + +inherit distutils-r1 eutils + +DESCRIPTION="Python interface to xattr" +HOMEPAGE="https://pyxattr.k1024.org/" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz + https://pyxattr.k1024.org/downloads/${P}.tar.gz" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux" +IUSE="doc test" +RESTRICT="!test? ( test )" + +RDEPEND="sys-apps/attr" +DEPEND="${RDEPEND} + dev-python/setuptools[${PYTHON_USEDEP}] + doc? ( >=dev-python/sphinx-1.3.1[${PYTHON_USEDEP}] ) + test? ( dev-python/nose[${PYTHON_USEDEP}] )" + +PATCHES=( + "${FILESDIR}/${PN}-0.6.0-xattr_header.patch" +) + +python_prepare_all() { + sed -i -e 's:, "-Werror"::' setup.py || die + # Bug 548486 + sed -e "s:html_theme = 'default':html_theme = 'classic':" \ + -i doc/conf.py || die + + distutils-r1_python_prepare_all +} + +python_compile_all() { + use doc && emake doc +} + +src_test() { + # Perform the tests in /var/tmp; that location is more likely + # to have xattr support than /tmp which is often tmpfs. + local -x TEST_DIR="${TEST_DIR:-/var/tmp}" + # Ignore selinux attributes by default, bug #503946. + local -x TEST_IGNORE_XATTRS="${TEST_IGNORE_XATTRS:-security.selinux}" + + einfo "Please note that the tests fail if xattrs are not supported" + einfo "by the filesystem used for ${TEST_DIR}." + einfo + einfo "The location for tests can be overriden using TEST_DIR variable:" + einfo " $ export TEST_DIR=/my/test/place" + einfo + einfo "Additionally, TEST_IGNORE_XATTRS can be set to control which" + einfo "external attributes are ignored by the tests." + einfo "See https://bugs.gentoo.org/503946 for details." + einfo + distutils-r1_src_test +} + +python_test() { + nosetests -v || die "Tests fail with ${EPYTHON}" +} + +python_install_all() { + use doc && local HTML_DOCS=( doc/html/. ) + distutils-r1_python_install_all +}