Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/lxml/
Date: Tue, 31 May 2022 07:19:53
Message-Id: 1653981583.55eb93f3394b908c89e76fe69c0f5c92405f0eb9.sam@gentoo
1 commit: 55eb93f3394b908c89e76fe69c0f5c92405f0eb9
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 31 07:19:21 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue May 31 07:19:43 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55eb93f3
7
8 dev-python/lxml: add 4.9.0
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 dev-python/lxml/Manifest | 1 +
13 dev-python/lxml/lxml-4.9.0.ebuild | 108 ++++++++++++++++++++++++++++++++++++++
14 2 files changed, 109 insertions(+)
15
16 diff --git a/dev-python/lxml/Manifest b/dev-python/lxml/Manifest
17 index 1bbee16e748c..fd65bdf74d3c 100644
18 --- a/dev-python/lxml/Manifest
19 +++ b/dev-python/lxml/Manifest
20 @@ -1 +1,2 @@
21 DIST lxml-4.8.0.tar.gz 959376 BLAKE2B a40be5e058153e1dc3f8501b645b0211f4498928ed71b161df54a67501356e9968064401b6d17e17dc8d62223b29e794eaa2bee7ff78ffee203d9f9a22f3e1c2 SHA512 bbcd8ea001cfa2820dcac4e00de6ded81700b2f0bd4a58bcdd4da05a19a107f57cd56280c4838fe19ee7ecd6be105878bf8c2f1c0e5111899c4ad1a2ba03537f
22 +DIST lxml-4.9.0.gh.tar.gz 960503 BLAKE2B 5b4c6c3c7c5f14167fa209700207a4d0bc7fbe67214060258e0474c11885f1bb0a6b57cc02d0df40f035670d14552ebc66acda3c184e77840377cb3f47187b18 SHA512 e85036a96a78da092d7d77dfb482ca00094811d085076bd2a1fe6f5cb31ac9ba8273a1193b5de8af7b4551b4deb41add83db450de8186c0567fcb4522a8da803
23
24 diff --git a/dev-python/lxml/lxml-4.9.0.ebuild b/dev-python/lxml/lxml-4.9.0.ebuild
25 new file mode 100644
26 index 000000000000..cc4c7423d460
27 --- /dev/null
28 +++ b/dev-python/lxml/lxml-4.9.0.ebuild
29 @@ -0,0 +1,108 @@
30 +# Copyright 1999-2022 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=8
34 +
35 +DISTUTILS_USE_PEP517=setuptools
36 +PYTHON_COMPAT=( python3_{8..11} pypy3 )
37 +
38 +inherit distutils-r1 optfeature toolchain-funcs
39 +
40 +DESCRIPTION="A Pythonic binding for the libxml2 and libxslt libraries"
41 +HOMEPAGE="
42 + https://lxml.de/
43 + https://pypi.org/project/lxml/
44 + https://github.com/lxml/lxml
45 +"
46 +SRC_URI="https://github.com/lxml/lxml/archive/${P}.tar.gz -> ${P}.gh.tar.gz"
47 +S="${WORKDIR}"/lxml-${P}
48 +
49 +LICENSE="BSD ElementTree GPL-2 PSF-2"
50 +SLOT="0"
51 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
52 +IUSE="doc examples +threads test"
53 +RESTRICT="!test? ( test )"
54 +
55 +# Note: lib{xml2,xslt} are used as C libraries, not Python modules.
56 +DEPEND="
57 + >=dev-libs/libxml2-2.9.12-r2
58 + >=dev-libs/libxslt-1.1.28"
59 +RDEPEND="
60 + ${DEPEND}
61 +"
62 +BDEPEND="
63 + virtual/pkgconfig
64 + dev-python/cython[${PYTHON_USEDEP}]
65 + doc? (
66 + $(python_gen_any_dep '
67 + dev-python/docutils[${PYTHON_USEDEP}]
68 + dev-python/pygments[${PYTHON_USEDEP}]
69 + dev-python/sphinx[${PYTHON_USEDEP}]
70 + dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
71 + ')
72 + )
73 + test? (
74 + dev-python/cssselect[${PYTHON_USEDEP}]
75 + )
76 +"
77 +
78 +PATCHES=(
79 + "${FILESDIR}"/${PN}-4.6.0-tests-pypy.patch
80 +)
81 +
82 +python_check_deps() {
83 + use doc || return 0
84 + has_version -b "dev-python/docutils[${PYTHON_USEDEP}]" &&
85 + has_version -b "dev-python/pygments[${PYTHON_USEDEP}]" &&
86 + has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" &&
87 + has_version -b "dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]"
88 +}
89 +
90 +python_prepare_all() {
91 + # avoid replacing PYTHONPATH in tests.
92 + sed -i -e '/sys\.path/d' test.py || die
93 +
94 + # don't use some random SDK on Darwin
95 + sed -i -e '/_ldflags =/s/=.*isysroot.*darwin.*None/= None/' \
96 + setupinfo.py || die
97 +
98 + distutils-r1_python_prepare_all
99 +}
100 +
101 +python_compile() {
102 + tc-export PKG_CONFIG
103 + distutils-r1_python_compile
104 +}
105 +
106 +python_compile_all() {
107 + use doc && emake html
108 +}
109 +
110 +python_test() {
111 + local dir=${BUILD_DIR}/test$(python_get_sitedir)/lxml
112 + local -x PATH=${BUILD_DIR}/test/usr/bin:${PATH}
113 +
114 + cp -al "${BUILD_DIR}"/{install,test} || die
115 + cp -al src/lxml/tests "${dir}/" || die
116 + cp -al src/lxml/html/tests "${dir}/html/" || die
117 + ln -rs "${S}"/doc "${dir}"/../../ || die
118 +
119 + "${EPYTHON}" test.py -vv --all-levels -p || die "Test ${test} fails with ${EPYTHON}"
120 +}
121 +
122 +python_install_all() {
123 + if use doc; then
124 + local DOCS=( README.rst *.txt doc/*.txt )
125 + local HTML_DOCS=( doc/html/. )
126 + fi
127 + if use examples; then
128 + dodoc -r samples
129 + fi
130 +
131 + distutils-r1_python_install_all
132 +}
133 +
134 +pkg_postinst() {
135 + optfeature "Support for BeautifulSoup as a parser backend" dev-python/beautifulsoup4
136 + optfeature "Translates CSS selectors to XPath 1.0 expressions" dev-python/cssselect
137 +}