summaryrefslogtreecommitdiff
path: root/dev-python/lxml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dev-python/lxml/Manifest4
-rw-r--r--dev-python/lxml/files/gtk-threading-filename-guessing.patch35
-rw-r--r--dev-python/lxml/files/parse-gtk-problem.patch45
-rw-r--r--dev-python/lxml/lxml-2.0.2-r1.ebuild57
4 files changed, 141 insertions, 0 deletions
diff --git a/dev-python/lxml/Manifest b/dev-python/lxml/Manifest
new file mode 100644
index 0000000..e4217f6
--- /dev/null
+++ b/dev-python/lxml/Manifest
@@ -0,0 +1,4 @@
+AUX gtk-threading-filename-guessing.patch 1054 RMD160 81d9090a447539beb6644249d5366f4d36ea6009 SHA1 1bc29d5737c6fe03fee3566b507695abec638834 SHA256 8b7d6c847c27948455ec3bb74f998ddc807aa293c1083608880716e555a693a0
+AUX parse-gtk-problem.patch 1698 RMD160 179c0807ec7335e63853fd65981cf6b21884f9e3 SHA1 56918ec6f47ef7da5118d76acb21414615091eef SHA256 d42eac9ed08e0c36fa010b4b9f37904b428a2fe4d5376b44aba38aa95ba76331
+DIST lxml-2.0.2.tgz 2002234 RMD160 c3ed569aee8112dfaca2c7be7309ca51cf23317d SHA1 97fc60896e34b48b6179ecc5ebb68ca96cbf2a4a SHA256 0f1a1f9ad32fbd6a60f985a71b9266996b2b4bb4831ff5945106f8fc7fa11a56
+EBUILD lxml-2.0.2-r1.ebuild 1530 RMD160 aaeec83741ead12ad0be063b1e518640666a74d3 SHA1 192c1599e86a6106d69a163689a42c5e9b370b73 SHA256 f813996fe966e4d01ef24b6486d99a2ac0f32ab1777700d9d7792b4b671154ba
diff --git a/dev-python/lxml/files/gtk-threading-filename-guessing.patch b/dev-python/lxml/files/gtk-threading-filename-guessing.patch
new file mode 100644
index 0000000..a48f258
--- /dev/null
+++ b/dev-python/lxml/files/gtk-threading-filename-guessing.patch
@@ -0,0 +1,35 @@
+=== src/lxml/apihelpers.pxi
+==================================================================
+--- src/lxml/apihelpers.pxi (revision 3804)
++++ src/lxml/apihelpers.pxi (revision 3805)
+@@ -1107,20 +1107,16 @@
+ Returns None if not a file object.
+ """
+ # file instances have a name attribute
+- try:
+- return source.name
+- except AttributeError:
+- pass
++ filename = getattr3(source, 'name', None)
++ if filename is not None:
++ return filename
+ # gzip file instances have a filename attribute
+- try:
+- return source.filename
+- except AttributeError:
+- pass
++ filename = getattr3(source, 'filename', None)
++ if filename is not None:
++ return filename
+ # urllib2 provides a geturl() method
+- try:
+- geturl = source.geturl
+- except AttributeError:
+- # can't determine filename
+- return None
+- else:
++ geturl = getattr3(source, 'geturl', None)
++ if geturl is not None:
+ return geturl()
++ # can't determine filename
++ return None
diff --git a/dev-python/lxml/files/parse-gtk-problem.patch b/dev-python/lxml/files/parse-gtk-problem.patch
new file mode 100644
index 0000000..e8aafdf
--- /dev/null
+++ b/dev-python/lxml/files/parse-gtk-problem.patch
@@ -0,0 +1,45 @@
+=== src/lxml/parser.pxi
+==================================================================
+--- src/lxml/parser.pxi (revision 3798)
++++ src/lxml/parser.pxi (revision 3799)
+@@ -1294,10 +1294,22 @@
+
+ cdef _Document _parseDocument(source, _BaseParser parser, base_url):
+ cdef _Document doc
++ if _isString(source):
++ # parse the file directly from the filesystem
++ doc = _parseDocumentFromURL(_encodeFilename(source), parser)
++ # fix base URL if requested
++ if base_url is not None:
++ base_url = _encodeFilenameUTF8(base_url)
++ if doc._c_doc.URL is not NULL:
++ tree.xmlFree(doc._c_doc.URL)
++ doc._c_doc.URL = tree.xmlStrdup(_cstr(base_url))
++ return doc
++
+ if base_url is not None:
+ url = base_url
+ else:
+ url = _getFilenameForFile(source)
++
+ if hasattr(source, 'getvalue') and hasattr(source, 'tell'):
+ # StringIO - reading from start?
+ if source.tell() == 0:
+@@ -1309,16 +1321,7 @@
+ return _parseFilelikeDocument(
+ source, _encodeFilenameUTF8(url), parser)
+
+- # Otherwise parse the file directly from the filesystem
+- filename = _encodeFilename(source)
+- doc = _parseDocumentFromURL(filename, parser)
+- # fix base URL if requested
+- if base_url is not None:
+- base_url = _encodeFilenameUTF8(base_url)
+- if doc._c_doc.URL is not NULL:
+- tree.xmlFree(doc._c_doc.URL)
+- doc._c_doc.URL = tree.xmlStrdup(_cstr(base_url))
+- return doc
++ raise TypeError("cannot parse from '%s'" % python._fqtypename(source))
+
+ cdef _Document _parseDocumentFromURL(url, _BaseParser parser):
+ cdef xmlDoc* c_doc
diff --git a/dev-python/lxml/lxml-2.0.2-r1.ebuild b/dev-python/lxml/lxml-2.0.2-r1.ebuild
new file mode 100644
index 0000000..6dc7329
--- /dev/null
+++ b/dev-python/lxml/lxml-2.0.2-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/lxml/lxml-2.0.2.ebuild,v 1.2 2008/03/16 23:09:33 jer Exp $
+
+NEED_PYTHON="2.3"
+
+inherit distutils eutils multilib
+
+DESCRIPTION="A Pythonic binding for the libxml2 and libxslt libraries"
+HOMEPAGE="http://codespeak.net/lxml/"
+SRC_URI="http://codespeak.net/lxml/${P}.tgz"
+LICENSE="BSD ElementTree GPL-2 PSF-2.4"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ia64 ~ppc ~x86"
+IUSE="doc examples"
+
+# Note: This version comes with it's own bundled svn version of pyrex
+RDEPEND=">=dev-libs/libxml2-2.6.20
+ >=dev-libs/libxslt-1.1.15"
+DEPEND="${RDEPEND}
+ >=dev-python/setuptools-0.6_rc5
+ >=dev-python/cython-0.9.6.12"
+
+src_compile () {
+ rm ${S}/src/lxml/lxml.*.c
+ #epatch "${FILESDIR}/parse-gtk-problem.patch"
+ epatch "${FILESDIR}/gtk-threading-filename-guessing.patch"
+ distutils_src_compile
+}
+
+src_install() {
+ distutils_src_install
+
+ if use doc; then
+ dohtml doc/html/*
+ dodoc *.txt
+ docinto doc
+ dodoc doc/*.txt
+ fi
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r samples/*
+ fi
+}
+
+src_test() {
+ distutils_python_version
+ python setup.py build_ext -i || die "building extensions for test use failed"
+ einfo "Running test"
+ "${python}" test.py || die "tests failed"
+ export PYTHONPATH="${PYTHONPATH}:${S}/src"
+ einfo "Running selftest"
+ "${python}" selftest.py || die "selftest failed"
+ einfo "Running selftest2"
+ "${python}" selftest2.py || die "selftest2 failed"
+}