diff options
Diffstat (limited to 'dev-python/lxml')
| -rw-r--r-- | dev-python/lxml/Manifest | 1 | ||||
| -rw-r--r-- | dev-python/lxml/lxml-6.1.0.ebuild | 120 |
2 files changed, 121 insertions, 0 deletions
diff --git a/dev-python/lxml/Manifest b/dev-python/lxml/Manifest index 6ec86195369d..31dd4863e73a 100644 --- a/dev-python/lxml/Manifest +++ b/dev-python/lxml/Manifest @@ -1,2 +1,3 @@ DIST lxml-6.0.2.gh.tar.gz 990107 BLAKE2B c01a94fef56754599100b65927b40c2d786d631f02bbfe6cff3865a00531ab26fc6a0fe5cf9b02bdcf01beb45ef94fd4436ed4c06f5c8fd9e707bcae80c0f2f4 SHA512 164dc5e38e394f4396faf0b06729039f6807a227e1a2755a6991e6dce569cc64244d5edfd2cf2af0d4e845d7155a76f6e391e32f3d5aac21dff3c07cbbe06460 DIST lxml-6.0.4.gh.tar.gz 992033 BLAKE2B fefffe0c0bdf79a2527c53ce54a079e01f40ce3fc6624ba13b199c88c49c6d4c2d9e59760f6a0646d3f2fa21d9e50a42d3319eb74ad91a044dd5f3d37385914c SHA512 8738d0912ee293f478da87affe07b9ca85542732023bab6ac32dfe97ced9695fcc1bf31e4ddc6d5a2d1d3f87be818344d9414b314e94853b0e82bc0fbe0e51f9 +DIST lxml-6.1.0.gh.tar.gz 992616 BLAKE2B bf0269bb5d757fb91e586b73436a2502b86ba23a4f09143d1af5131ba4d8fbec57cd5ce0804113a8d258c6312f17404b0d67992722f19b9544610bf26f7caf7b SHA512 c738958839f9fb627ede8c4758b849d60be5210617fb2f4d9d2072f9f724a54d63648964b8716b0e23eaba044d77d02e621579c7aaee53fa2e30bc206a4a8534 diff --git a/dev-python/lxml/lxml-6.1.0.ebuild b/dev-python/lxml/lxml-6.1.0.ebuild new file mode 100644 index 000000000000..895e0ad703e1 --- /dev/null +++ b/dev-python/lxml/lxml-6.1.0.ebuild @@ -0,0 +1,120 @@ +# Copyright 1999-2026 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..14} ) + +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 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-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.10.3:= + >=dev-libs/libxslt-1.1.38 +" +RDEPEND=" + ${DEPEND} +" +BDEPEND=" + virtual/pkgconfig + >=dev-python/cython-3.1.4[${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}-6.0.4-pypy.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() { + # 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() { + local DISTUTILS_ARGS=( + # by default it adds -w to CFLAGS + --warnings + ) + tc-export PKG_CONFIG + distutils-r1_python_compile +} + +python_compile_all() { + # disable automagic dep on coverage + use doc && emake CYTHON_WITH_COVERAGE= 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 + mkdir "${dir}"/../../doc || die + # this one needs to be copied, because upstream uses doc/../../../doc + cp -r "${S}"/doc "${dir}"/../../ || die + ln -s "${S}"/doc "${dir}"/../../../../ || die + + "${EPYTHON}" test.py --no-src -vv --all-levels -p || + die "Tests fail on ${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 + optfeature "Support for lxml.html.clean sanitizer" dev-python/lxml-html-clean +} |
