Date: Friday, October 30, 2015 @ 09:06:24 Author: fyan Revision: 145290
archrelease: copy trunk to community-any Added: python-pygal/repos/community-any/ python-pygal/repos/community-any/PKGBUILD (from rev 145289, python-pygal/trunk/PKGBUILD) python-pygal/repos/community-any/python-3.5.patch (from rev 145289, python-pygal/trunk/python-3.5.patch) ------------------+ PKGBUILD | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++ python-3.5.patch | 37 +++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) Copied: python-pygal/repos/community-any/PKGBUILD (from rev 145289, python-pygal/trunk/PKGBUILD) =================================================================== --- community-any/PKGBUILD (rev 0) +++ community-any/PKGBUILD 2015-10-30 08:06:24 UTC (rev 145290) @@ -0,0 +1,66 @@ +# $Id$ +# Maintainer: Felix Yan <felixonm...@archlinux.org> +# Contributor: Chris Warrick <a...@chriswarrick.com> + +pkgbase=python-pygal +pkgname=('python-pygal' 'python2-pygal') +epoch=1 +pkgver=2.0.8 +pkgrel=1 +pkgdesc='A Python SVG graph plotting library' +arch=('any') +url='http://pygal.org/' +license=('LGPL3') +makedepends=('python-setuptools' 'python2-setuptools' 'git') +checkdepends=('python-pytest' 'python2-pytest' 'python-lxml' 'python2-lxml' + 'python-pyquery' 'python2-pyquery' 'python-cairosvg' 'python2-cairosvg' + 'python-flask' 'python2-flask') +source=("git+https://github.com/Kozea/pygal.git#tag=$pkgver" + python-3.5.patch) +md5sums=('SKIP' + '184addfb9698e8e8d67cfdc50c898866') + +prepare() { + # https://github.com/Kozea/pygal/pull/278 + (cd pygal; patch -p1 -i ../python-3.5.patch) + + cp -a "${srcdir}/pygal"{,-py2} +} + +build() { + cd "$srcdir/pygal" + python setup.py build + + cd "$srcdir/pygal-py2" + python2 setup.py build +} + +check() { + cd "$srcdir/pygal" + LC_CTYPE=en_US.UTF-8 py.test pygal/ + + cd "$srcdir/pygal-py2" + py.test2 pygal/ +} + +package_python-pygal() { + depends=('python-setuptools') + optdepends=('python-lxml: for XML output through lxml instead of xml.etree' + 'python-cairosvg: for PNG output') + + cd "${srcdir}/pygal" + python3 setup.py install --root="${pkgdir}/" --optimize=1 +} + +package_python2-pygal() { + depends=('python2-setuptools') + optdepends=('python2-lxml: for XML output through lxml instead of xml.etree' + 'python2-cairosvg: for PNG output') + + cd "${srcdir}/pygal-py2" + python2 setup.py install --root="${pkgdir}/" --optimize=1 + + mv "${pkgdir}"/usr/bin/pygal_gen{,2}.py +} + +# vim:set ts=2 sw=2 et: Copied: python-pygal/repos/community-any/python-3.5.patch (from rev 145289, python-pygal/trunk/python-3.5.patch) =================================================================== --- community-any/python-3.5.patch (rev 0) +++ community-any/python-3.5.patch 2015-10-30 08:06:24 UTC (rev 145290) @@ -0,0 +1,37 @@ +From 3f44ab8e181ce12c9e55f361b1131699d1c97d05 Mon Sep 17 00:00:00 2001 +From: Felix Yan <felixonm...@archlinux.org> +Date: Fri, 30 Oct 2015 15:50:28 +0800 +Subject: [PATCH] Fix unparse_color for python 3.5+ compatibility + +--- + pygal/colors.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/pygal/colors.py b/pygal/colors.py +index bc8ea55..7997b38 100644 +--- a/pygal/colors.py ++++ b/pygal/colors.py +@@ -126,19 +126,20 @@ def unparse_color(r, g, b, a, type): + if type == '#rgb': + # Don't lose precision on rgb shortcut + if r % 17 == 0 and g % 17 == 0 and b % 17 == 0: +- return '#%x%x%x' % (r / 17, g / 17, b / 17) ++ return '#%x%x%x' % (int(r / 17), int(g / 17), int(b / 17)) + type = '#rrggbb' + + if type == '#rgba': + if r % 17 == 0 and g % 17 == 0 and b % 17 == 0: +- return '#%x%x%x%x' % (r / 17, g / 17, b / 17, a * 15) ++ return '#%x%x%x%x' % (int(r / 17), int(g / 17), int(b / 17), ++ int(a * 15)) + type = '#rrggbbaa' + + if type == '#rrggbb': + return '#%02x%02x%02x' % (r, g, b) + + if type == '#rrggbbaa': +- return '#%02x%02x%02x%02x' % (r, g, b, a * 255) ++ return '#%02x%02x%02x%02x' % (r, g, b, int(a * 255)) + + if type == 'rgb': + return 'rgb(%d, %d, %d)' % (r, g, b)