Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev-python/lxml/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST lxml-5.3.2.tar.gz 3679948 BLAKE2B 82ba5564f8b53bb8acc84562b43b65e797b021377fc1df8c4eaa70d5746ab6003a9fde34bac4bc5a1891d0fba5687783b28e709472e097837f01801970568e5f SHA512 ff09abd870868a912e3c950bd14cdf30a4c8685296ceb37699fc8fa34fdeb1a1fb0daa98f84808af61f9b97cdfe56d3e4d8b5b3ff0ec7b1a24c7110ad1ec8cbc
DIST lxml-5.4.0.tar.gz 3679479 BLAKE2B 130da36673a87b3bbbb7dd9aba63fb45f7c47118b5677d6c8974e570f95ad7fa914f18d820a96abc4bbc3bfa5875017c593ad489cd2f4a78da6ce9a30d21e078 SHA512 3d0bf222d5f213366a8b17d48702d3a5b430355d71b9ac88b4b1980e1a53fe34ba1d02c62053550f60f0320778647635d1af92c682b7f57ebf266521e9ee0d92
75 changes: 75 additions & 0 deletions dev-python/lxml/lxml-5.4.0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3+ pypy3 )

inherit distutils-r1 eutils 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://files.pythonhosted.org/packages/76/3d/14e82fc7c8fb1b7761f7e748fd47e2ec8276d137b6acfe5a4bb73853e08f/lxml-5.4.0.tar.gz -> lxml-5.4.0.tar.gz"

LICENSE="BSD ElementTree GPL-2 PSF-2"
SLOT="0"
KEYWORDS="*"
IUSE="doc examples +threads test"
RESTRICT="!test? ( test )"

# Note: lib{xml2,xslt} are used as C libraries, not Python modules.
RDEPEND="
>=dev-libs/libxml2-2.9.5
>=dev-libs/libxslt-1.1.28"
DEPEND="${RDEPEND}"
BDEPEND="
virtual/pkgconfig
dev-python/cython[${PYTHON_USEDEP}]
dev-python/setuptools[${PYTHON_USEDEP}]
test? ( dev-python/cssselect[${PYTHON_USEDEP}] )
"

DISTUTILS_IN_SOURCE_BUILD=1

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() {
if ! python_is_python3; then
local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
fi
tc-export PKG_CONFIG
distutils-r1_python_compile
}

python_test() {
cp -r -l src/lxml/tests "${BUILD_DIR}"/lib/lxml/ || die
cp -r -l src/lxml/html/tests "${BUILD_DIR}"/lib/lxml/html/ || die
ln -s "${S}"/doc "${BUILD_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/beautifulsoup
optfeature "Translates CSS selectors to XPath 1.0 expressions" dev-python/cssselect
}
Loading