summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard PALO2019-10-11 19:33:56 +0200
committerRichard PALO2019-10-11 19:33:56 +0200
commit8a7a45e7ca7454591f3738d9188263241b714ec5 (patch)
tree39b1738ac024de6e2cf7069a881d83e940c21de4
parentb2017f98729a029953702718325d960432e76fb6 (diff)
downloadaur-8a7a45e7ca7454591f3738d9188263241b714ec5.tar.gz
Support arch version of python-magic as well as python-magic-ahupp
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD10
-rw-r--r--ebec469f4baa.diff36
3 files changed, 46 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a3a41c99975..436ac468add 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,16 @@
pkgbase = python-relatorio
pkgdesc = A templating library able to output odt and pdf files
pkgver = 0.9.0
- pkgrel = 1
+ pkgrel = 2
url = http://relatorio.tryton.org/
arch = any
license = GPL
makedepends = python-setuptools
makedepends = python2-setuptools
source = https://pypi.io/packages/source/r/relatorio/relatorio-0.9.0.tar.gz
+ source = ebec469f4baa.diff
sha512sums = d8f5c2a6c6fd207de4f651a8abe8802de0a0a30b35c659136e52868c5721f719e53bc771019a8a4448615432696c149298b2306fcacadcc0737fa6b08a53b345
+ sha512sums = 3c3292bcc9995f1a06c3112eccaa359090baa8182d0ba282a1c2455374144b5e921830788d28161404265637d6450267bee3dcaa906640d8fa06d16c9bc75b9d
pkgname = python-relatorio
depends = python-genshi>=0.5
diff --git a/PKGBUILD b/PKGBUILD
index 45df8a42bcd..bdc7a2d89b0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,14 +3,16 @@
# Maintainer: Robin Baumgartner <robin@baumgartners.ch>
pkgname=('python-relatorio' 'python2-relatorio')
pkgver=0.9.0
-pkgrel=1
+pkgrel=2
pkgdesc="A templating library able to output odt and pdf files"
arch=('any')
url="http://relatorio.tryton.org/"
license=('GPL')
makedepends=('python-setuptools' 'python2-setuptools')
-source=("https://pypi.io/packages/source/r/relatorio/relatorio-$pkgver.tar.gz")
-sha512sums=('d8f5c2a6c6fd207de4f651a8abe8802de0a0a30b35c659136e52868c5721f719e53bc771019a8a4448615432696c149298b2306fcacadcc0737fa6b08a53b345')
+source=("https://pypi.io/packages/source/r/relatorio/relatorio-$pkgver.tar.gz"
+ 'ebec469f4baa.diff')
+sha512sums=('d8f5c2a6c6fd207de4f651a8abe8802de0a0a30b35c659136e52868c5721f719e53bc771019a8a4448615432696c149298b2306fcacadcc0737fa6b08a53b345'
+ '3c3292bcc9995f1a06c3112eccaa359090baa8182d0ba282a1c2455374144b5e921830788d28161404265637d6450267bee3dcaa906640d8fa06d16c9bc75b9d')
prepare() {
cp -a relatorio-$pkgver{,-py2}
@@ -18,9 +20,11 @@ prepare() {
build() {
cd "$srcdir/relatorio-$pkgver"
+ patch -p1 < ../ebec469f4baa.diff
python setup.py build
cd "$srcdir/relatorio-$pkgver-py2"
+ patch -p1 < ../ebec469f4baa.diff
python2 setup.py build
}
diff --git a/ebec469f4baa.diff b/ebec469f4baa.diff
new file mode 100644
index 00000000000..1e228d5ac64
--- /dev/null
+++ b/ebec469f4baa.diff
@@ -0,0 +1,36 @@
+
+# HG changeset patch
+# User C├ędric Krier <ced@b2ck.com>
+# Date 1570791867 -7200
+# Node ID ebec469f4baa9523522bb5a81113bf9a381bfc87
+# Parent e1b70835bc9eaa1af25f390ead9dee50c8fbf8fe
+Support file-magic as fallback to python-magic
+
+bug53
+
+diff -r e1b70835bc9e -r ebec469f4baa CHANGES
+--- a/CHANGES Mon Jul 29 16:12:32 2019 +0200
++++ b/CHANGES Fri Oct 11 13:04:27 2019 +0200
+@@ -1,3 +1,5 @@
++* Support file-magic as fallback to python-magic
++
+ 0.9.0 - 20190729
+ * Support out parameter of render
+ * Write opendocument stream directly to the ZipFile
+diff -r e1b70835bc9e -r ebec469f4baa relatorio/templates/opendocument.py
+--- a/relatorio/templates/opendocument.py Mon Jul 29 16:12:32 2019 +0200
++++ b/relatorio/templates/opendocument.py Fri Oct 11 13:04:27 2019 +0200
+@@ -950,7 +950,11 @@
+ binary_data, = image.xpath(
+ './office:binary-data', namespaces=namespaces)
+ data = base64.b64decode(binary_data.text)
+- mime_type = magic.from_buffer(data, mime=True)
++ if hasattr(magic, 'from_buffer'):
++ mime_type = magic.from_buffer(data, mime=True)
++ else:
++ # Not python-magic but file-magic
++ mime_type = magic.detect_from_content(data).mime_type
+ name = 'Pictures/image%s%s' % (
+ i, mimetypes.guess_extension(mime_type))
+ image.remove(binary_data)
+