diff options
author | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
---|---|---|
committer | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
commit | 415856bdd4f48ab4f2732996f0bae58595092bbe (patch) | |
tree | ede2018b591f6dfb477fe9341ba17b9bc000fab9 /extra/pyxml |
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'extra/pyxml')
-rw-r--r-- | extra/pyxml/PKGBUILD | 38 | ||||
-rw-r--r-- | extra/pyxml/fix-python2.6.patch | 28 | ||||
-rw-r--r-- | extra/pyxml/foreigncharsfix.patch | 11 |
3 files changed, 77 insertions, 0 deletions
diff --git a/extra/pyxml/PKGBUILD b/extra/pyxml/PKGBUILD new file mode 100644 index 000000000..eea70cc62 --- /dev/null +++ b/extra/pyxml/PKGBUILD @@ -0,0 +1,38 @@ +# $Id: PKGBUILD 98285 2010-11-06 14:25:36Z schiv $ +# Maintainer: +# Contributor: Jan de Groot <jgc@archlinux.org> + +pkgname=pyxml +pkgver=0.8.4 +pkgrel=8 +pkgdesc="Python XML parsing library" +arch=('i686' 'x86_64') +url="http://sourceforge.net/projects/pyxml/" +license=('custom') +depends=('python2') +source=(http://downloads.sourceforge.net/sourceforge/pyxml/PyXML-${pkgver}.tar.gz + fix-python2.6.patch + foreigncharsfix.patch) +md5sums=('1f7655050cebbb664db976405fdba209' + '4b652e0c866e3cca7e2386e8e383d5ba' + 'c9c54fdf0f7d1515a3b7aa34b01d1c46') + +package() { + cd "${srcdir}/PyXML-${pkgver}" + + patch -Np1 -i "${srcdir}/fix-python2.6.patch" + + # as warranted by eric (the python IDE) + patch -Np1 -i "${srcdir}/foreigncharsfix.patch" + + python2 setup.py build + python2 setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 + install -D -m644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + + sed -e 's|#! /usr/bin/env python|#!/usr/bin/env python2|' \ + -i ${pkgdir}/usr/lib/python2.7/site-packages/_xmlplus/dom/ext/c14n.py + sed -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' \ + -i ${pkgdir}/usr/lib/python2.7/site-packages/_xmlplus/dom/html/GenerateHtml.py +} + +# vim:set ts=2 sw=2 et: diff --git a/extra/pyxml/fix-python2.6.patch b/extra/pyxml/fix-python2.6.patch new file mode 100644 index 000000000..7bf1c46fc --- /dev/null +++ b/extra/pyxml/fix-python2.6.patch @@ -0,0 +1,28 @@ +diff -ur a/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py b/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py +--- a/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py 2003-03-11 15:01:34.000000000 +0100 ++++ b/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py 2009-05-25 16:32:26.000000000 +0200 +@@ -24,8 +24,8 @@ + self._rel = rel + nt = ParsedNodeTest.ParsedNodeTest('node', '') + ppl = ParsedPredicateList.ParsedPredicateList([]) +- as = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self') +- self._step = ParsedStep.ParsedStep(as, nt, ppl) ++ asp = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self') ++ self._step = ParsedStep.ParsedStep(asp, nt, ppl) + return + + def evaluate(self, context): +diff -ur a/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py b/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py +--- a/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py 2003-03-11 15:01:34.000000000 +0100 ++++ b/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py 2009-05-25 16:27:55.000000000 +0200 +@@ -28,8 +28,8 @@ + self._right = right + nt = ParsedNodeTest.ParsedNodeTest('node','') + ppl = ParsedPredicateList.ParsedPredicateList([]) +- as = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self') +- self._middle = ParsedStep.ParsedStep(as, nt, ppl) ++ asp = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self') ++ self._middle = ParsedStep.ParsedStep(asp, nt, ppl) + + def evaluate(self, context): + res = [] diff --git a/extra/pyxml/foreigncharsfix.patch b/extra/pyxml/foreigncharsfix.patch new file mode 100644 index 000000000..024d4472d --- /dev/null +++ b/extra/pyxml/foreigncharsfix.patch @@ -0,0 +1,11 @@ +diff -aur PyXML-0.8.4.orig//xml/parsers/xmlproc/xmlutils.py PyXML-0.8.4/xml/parsers/xmlproc/xmlutils.py +--- PyXML-0.8.4.orig//xml/parsers/xmlproc/xmlutils.py 2010-11-06 17:27:53.936666669 +0800 ++++ PyXML-0.8.4/xml/parsers/xmlproc/xmlutils.py 2010-11-06 17:30:39.230000003 +0800 +@@ -720,6 +720,7 @@ + # to the recoding. + try: + self.data = self.charset_converter(self.data) ++ self.datasize = len(self.data) + except UnicodeError, e: + self._handle_decoding_error(self.data, e) + self.input_encoding = enc1 |