diff options
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | PKGBUILD | 40 | ||||
-rw-r--r-- | xrange.patch | 26 |
3 files changed, 70 insertions, 24 deletions
@@ -1,15 +1,25 @@ -pkgbase = python2-svglib - pkgdesc = An experimental library for reading and converting SVG. - pkgver = 0.6.3 - pkgrel = 4 - url = http://pypi.python.org/pypi/svglib/0.6.3 +pkgbase = python-svglib + pkgdesc = A pure-Python library for reading and converting SVG files. + pkgver = 0.8.1 + pkgrel = 1 + url = http://pypi.python.org/pypi/svglib/0.8.1 arch = any license = LGPL - depends = python2 - depends = python2-reportlab + makedepends = python-setuptools + makedepends = python2-setuptools options = !emptydirs - source = http://pypi.python.org/packages/source/s/svglib/svglib-0.6.3.tar.gz - md5sums = 454edcfef70d52f62e0e434f2efad853 + source = https://files.pythonhosted.org/packages/source/s/svglib/svglib-0.8.1.tar.gz + source = xrange.patch + sha256sums = 1f8cb633f154b83987e3a906a55cf69c8739c0df5ea4eee024677c3e8fb62f55 + sha256sums = 21d9f9634ba0c92ee6b21c720978a3825ff92974177cab17e72015c62ec10a47 pkgname = python2-svglib + depends = python2 + depends = python2-reportlab + depends = python2-lxml + +pkgname = python-svglib + depends = python + depends = python-reportlab + depends = python-lxml @@ -1,26 +1,36 @@ # Contributor: Vladimir Gorbunov <truedaemon@gmail.com> -pkgname=python2-svglib -pkgver=0.6.3 -pkgrel=4 -pkgdesc="An experimental library for reading and converting SVG." +pkgbase=python-svglib +pkgname=('python2-svglib' 'python-svglib') +_name=svglib +pkgver=0.8.1 +pkgrel=1 +pkgdesc="A pure-Python library for reading and converting SVG files." arch=('any') url="http://pypi.python.org/pypi/svglib/$pkgver" license=('LGPL') -depends=('python2' 'python2-reportlab') options=(!emptydirs) -install= -source=(http://pypi.python.org/packages/source/s/svglib/svglib-$pkgver.tar.gz) -md5sums=('454edcfef70d52f62e0e434f2efad853') +makedepends=('python-setuptools' 'python2-setuptools') +source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz" + "xrange.patch") +sha256sums=('1f8cb633f154b83987e3a906a55cf69c8739c0df5ea4eee024677c3e8fb62f55' + '21d9f9634ba0c92ee6b21c720978a3825ff92974177cab17e72015c62ec10a47') prepare() { - cd "$srcdir/svglib-$pkgver" - sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \ - -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \ - $(find "$srcdir" -name '*.py') + cd "$srcdir/svglib-$pkgver" + # Fix python 3 compatibility + patch -Np1 -i "${srcdir}/xrange.patch" } -package() { - cd "$srcdir/svglib-$pkgver" - python2 setup.py install --root="$pkgdir/" --optimize=1 +package_python2-svglib() { + cd "$srcdir/svglib-$pkgver" + depends=('python2' 'python2-reportlab' 'python2-lxml') + python2 setup.py install --root="$pkgdir/" --optimize=1 + mv "${pkgdir}/usr/bin/svg2pdf" "${pkgdir}/usr/bin/svg2pdf-py2" +} + +package_python-svglib() { + cd "$srcdir/svglib-$pkgver" + depends=('python' 'python-reportlab' 'python-lxml') + python setup.py install --root="$pkgdir/" --optimize=1 } diff --git a/xrange.patch b/xrange.patch new file mode 100644 index 000000000000..0cdfa49e0952 --- /dev/null +++ b/xrange.patch @@ -0,0 +1,26 @@ +diff -ura package.old/svglib/svglib.py package.new/svglib/svglib.py +--- package.old/svglib/svglib.py 2018-08-05 13:06:04.914558175 +0300 ++++ package.new/svglib/svglib.py 2018-08-05 13:06:38.733596856 +0300 +@@ -744,7 +744,7 @@ + subpath_start = [] + lastop = '' + +- for i in xrange(0, len(normPath), 2): ++ for i in range(0, len(normPath), 2): + op, nums = normPath[i:i+2] + + if op in ('m', 'M') and i > 0 and path.operators[-1] != _CLOSEPATH: +Только в package.new/svglib: svglib.py~ +diff -ura package.old/svglib/utils.py package.new/svglib/utils.py +--- package.old/svglib/utils.py 2018-08-05 13:06:04.914558175 +0300 ++++ package.new/svglib/utils.py 2018-08-05 13:06:49.629953774 +0300 +@@ -196,7 +196,7 @@ + + c1 = cos(theta1) + s1 = sin(theta1) +- for i in xrange(nfrag): ++ for i in range(nfrag): + c0 = c1 + s0 = s1 + theta1 = start_rad + i * frag_rad +Только в package.new/svglib: utils.py~ |