From 996d1cba721b044876526a7f3c1d2ef1fcc90bb4 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 6 Jun 2023 09:39:06 +0100 Subject: gentoo auto-resync : 06:06:2023 - 09:39:05 --- dev-python/lxml/Manifest | 2 + .../lxml-4.9.2-py3.12-backport-unicode-fix.patch | 33 ++++++ dev-python/lxml/lxml-4.9.2-r1.ebuild | 116 +++++++++++++++++++++ 3 files changed, 151 insertions(+) create mode 100644 dev-python/lxml/files/lxml-4.9.2-py3.12-backport-unicode-fix.patch create mode 100644 dev-python/lxml/lxml-4.9.2-r1.ebuild (limited to 'dev-python/lxml') diff --git a/dev-python/lxml/Manifest b/dev-python/lxml/Manifest index 35f5f1d0e998..e1778aa97b1f 100644 --- a/dev-python/lxml/Manifest +++ b/dev-python/lxml/Manifest @@ -1,5 +1,7 @@ AUX lxml-4.6.0-tests-pypy.patch 18051 BLAKE2B 99d97fa2e874c9bec4a866c3303b54ea2ab1e6abddf148d142cb66ee035b1eab1e05eed924d34451c5db38dc37f77104539cbfc2fe45815c17445b6359dcb857 SHA512 f6c6c2b00a49e6ca19d8b9123c364003a682c2e8df0c42d8600085d1cb094ba5cedd162bfc794e7d9acfff93aac771953dca5a879c3b957af1e2e8bd1db05515 +AUX lxml-4.9.2-py3.12-backport-unicode-fix.patch 1178 BLAKE2B c1a09df02a77c0b0b7fbd2b72b54a0b6103f1426ce0ebb531c58f6a4342eb1801a1394e296d71843e031308107d026c506f90141c87f19a39da877aef69c2fd6 SHA512 0b26031eac3158a87f7ab822d480d58fbfba9f70f983caa7c2fce3000bfc994218ad0ae3fb5737afbb17aeb90b02b841ccb91ca53dd722072dd8ad6a4317fe94 AUX lxml-4.9.2-py3.12-drop-deprecated-imp.patch 1985 BLAKE2B af705cb2092d6468ae556d79c14ca96d8491cf7a96dc1699d0f3e70113637f724876adaa051545c6a434ee9f54a1784ab5e24eefcf7eef61edfdca88980c0f62 SHA512 088428b9a9e103b4476f8bb45f318032126571f518cbeeb2e04e78289f5bd69ce59b7b058abe3957b59b5077160ef4e67cbb5005da92572437f1c27a6e497d83 DIST lxml-4.9.2.gh.tar.gz 957365 BLAKE2B 201b3977da90386e413f1b89a4b7ee1e44d6bbea05e622e92feb1d67c637ce46ebf746f0648f034ed3bccd609233ccf7d8a7ee456f13b8d9ca8587ddf1ebd32a SHA512 816b2fe2eef2a97a0df66cbc39850c6dc3d6470e4033cc73edb40c80c0afbbe6c084d042d7c98b29497926e76f648caa42e1ebe5d83060af08af6972316077b0 +EBUILD lxml-4.9.2-r1.ebuild 2986 BLAKE2B b81bf7d96bb990acedfbfddf8556ccbe7d07bd7f38d6043eedb8add00ed196ab4f7d9494b958cc280ee64483fcae9423c4130a13026b63528f8bfbd9aea3d43d SHA512 80559e7b85c8180f337c5ac8fa2012096f7a60afd3dbb801047eb0ff99edf6179d84b20873137b508fc9485ab709060329afca021650623686f0bba94aac4732 EBUILD lxml-4.9.2.ebuild 2924 BLAKE2B 9ce8ec0fd2fc1f58b0175d44d4e955bf26a2dd16b0282f7e7b5912f82ba57fa09d3e8c2befef52a9594504e32249cab9299441b76f04c6b87c47b412c755139f SHA512 db8b7cf3e8968ec2108b4dba41c1a0b5f72e5493d2e1b17434264d1b9d14a0361faac3440cb515e06178319b43fcbce76b939227786d161d70d6de1ade8e032a MISC metadata.xml 463 BLAKE2B 9bcd092b61568f5d467230617b101f36245c41078e6a66c7ff63b22a6b4095de2ba3a59e48ce8b7842ce58d1255fa293995652daa3fab4c3af988498eaa30e97 SHA512 2ba5e340b59e0de4e472380e9c19b1f6f573e86e5c3c2e075f6151d369e94eea70e3ce36bfb5ece4da3fa69459e3ff83368f1df8302aa5754ae52f13c8f2312e diff --git a/dev-python/lxml/files/lxml-4.9.2-py3.12-backport-unicode-fix.patch b/dev-python/lxml/files/lxml-4.9.2-py3.12-backport-unicode-fix.patch new file mode 100644 index 000000000000..d1ca31d1b909 --- /dev/null +++ b/dev-python/lxml/files/lxml-4.9.2-py3.12-backport-unicode-fix.patch @@ -0,0 +1,33 @@ +Upstream: https://github.com/lxml/lxml/commit/a1f2231dfdd31a37f2c55bc9ae4ac33e92221227 + +From a1f2231dfdd31a37f2c55bc9ae4ac33e92221227 Mon Sep 17 00:00:00 2001 +From: Stefan Behnel +Date: Fri, 12 May 2023 09:49:34 +0200 +Subject: [PATCH] Adapt unicode parsing to Py3.12. + +--- + src/lxml/includes/etree_defs.h | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/src/lxml/includes/etree_defs.h b/src/lxml/includes/etree_defs.h +index e671fa85d..d42f2158c 100644 +--- a/src/lxml/includes/etree_defs.h ++++ b/src/lxml/includes/etree_defs.h +@@ -120,6 +120,16 @@ static PyObject* PyBytes_FromFormat(const char* format, ...) { + # define _lx_PySlice_GetIndicesEx(o, l, b, e, s, sl) PySlice_GetIndicesEx(((PySliceObject*)o), l, b, e, s, sl) + #endif + ++#if PY_VERSION_HEX >= 0x030B00A1 ++/* Python 3.12 doesn't have wstr Unicode strings any more. */ ++#undef PyUnicode_GET_DATA_SIZE ++#define PyUnicode_GET_DATA_SIZE(ustr) (0) ++#undef PyUnicode_AS_DATA ++#define PyUnicode_AS_DATA(ustr) (NULL) ++#undef PyUnicode_IS_READY ++#define PyUnicode_IS_READY(ustr) (1) ++#endif ++ + #ifdef WITHOUT_THREADING + # undef PyEval_SaveThread + # define PyEval_SaveThread() (NULL) + diff --git a/dev-python/lxml/lxml-4.9.2-r1.ebuild b/dev-python/lxml/lxml-4.9.2-r1.ebuild new file mode 100644 index 000000000000..9b26e534fcf8 --- /dev/null +++ b/dev-python/lxml/lxml-4.9.2-r1.ebuild @@ -0,0 +1,116 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..12} pypy3 ) + +inherit distutils-r1 optfeature toolchain-funcs + +DESCRIPTION="A Pythonic binding for the libxml2 and libxslt libraries" +HOMEPAGE=" + https://lxml.de/ + https://pypi.org/project/lxml/ + https://github.com/lxml/lxml/ +" +SRC_URI=" + https://github.com/lxml/lxml/archive/${P}.tar.gz + -> ${P}.gh.tar.gz +" +S=${WORKDIR}/lxml-${P} + +LICENSE="BSD ElementTree GPL-2 PSF-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="doc examples +threads test" +RESTRICT="!test? ( test )" + +# Note: lib{xml2,xslt} are used as C libraries, not Python modules. +DEPEND=" + >=dev-libs/libxml2-2.9.12-r2 + >=dev-libs/libxslt-1.1.28 +" +RDEPEND=" + ${DEPEND} +" +BDEPEND=" + virtual/pkgconfig + =dev-python/cython-0.29.29[${PYTHON_USEDEP}] + doc? ( + $(python_gen_any_dep ' + dev-python/docutils[${PYTHON_USEDEP}] + dev-python/pygments[${PYTHON_USEDEP}] + dev-python/sphinx[${PYTHON_USEDEP}] + dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}] + ') + ) + test? ( + dev-python/cssselect[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-4.6.0-tests-pypy.patch + "${FILESDIR}"/${P}-py3.12-drop-deprecated-imp.patch + "${FILESDIR}"/${P}-py3.12-backport-unicode-fix.patch +) + +python_check_deps() { + use doc || return 0 + python_has_version -b "dev-python/docutils[${PYTHON_USEDEP}]" && + python_has_version -b "dev-python/pygments[${PYTHON_USEDEP}]" && + python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" && + python_has_version -b "dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]" +} + +python_prepare_all() { + # avoid replacing PYTHONPATH in tests. + sed -i -e '/sys\.path/d' test.py || die + + # don't use some random SDK on Darwin + sed -i -e '/_ldflags =/s/=.*isysroot.*darwin.*None/= None/' \ + setupinfo.py || die + + distutils-r1_python_prepare_all +} + +python_compile() { + tc-export PKG_CONFIG + distutils-r1_python_compile +} + +python_compile_all() { + use doc && emake html +} + +python_test() { + local dir=${BUILD_DIR}/test$(python_get_sitedir)/lxml + local -x PATH=${BUILD_DIR}/test/usr/bin:${PATH} + + cp -al "${BUILD_DIR}"/{install,test} || die + cp -al src/lxml/tests "${dir}/" || die + cp -al src/lxml/html/tests "${dir}/html/" || die + ln -rs "${S}"/doc "${dir}"/../../ || die + + "${EPYTHON}" test.py -vv --all-levels -p || die "Test ${test} fails with ${EPYTHON}" +} + +python_install_all() { + if use doc; then + local DOCS=( README.rst *.txt doc/*.txt ) + local HTML_DOCS=( doc/html/. ) + fi + if use examples; then + dodoc -r samples + fi + + distutils-r1_python_install_all +} + +pkg_postinst() { + optfeature "Support for BeautifulSoup as a parser backend" dev-python/beautifulsoup4 + optfeature "Translates CSS selectors to XPath 1.0 expressions" dev-python/cssselect +} -- cgit v1.2.3