diff mbox

gnu: Add python2-qrcode

Message ID 046cc7d49648b5b1977cbebffa29ac97@d4n1.org
State New
Headers show

Commit Message

Daniel Pimentel June 23, 2016, 4:41 p.m. UTC
In attach a full patch. Update URI with Pypi.

I tried:
./pre-inst-env guix environment --pure --ad-hoc python2-qrcode python@2
$ qr "Guix" > guix-qrcode.png

It's work.

But whent import by python shell using:
$ python
> import qrcode
> img = qrcode.make('Some data here')

Not work, probably problem with Pillow (PIL fork).

Comments

Ben Woodcroft June 23, 2016, 11:45 p.m. UTC | #1
On 24/06/16 02:41, Daniel Pimentel wrote:
> In attach a full patch. Update URI with Pypi.
>
> I tried:
> ./pre-inst-env guix environment --pure --ad-hoc python2-qrcode python@2
> $ qr "Guix" > guix-qrcode.png
>
> It's work.
>
> But whent import by python shell using:
> $ python
>> import qrcode
>> img = qrcode.make('Some data here')
>
> Not work, probably problem with Pillow (PIL fork).

In cases like this I tend to test outside Guix and see if it works 
there, and if it doesn't work, then report the bug upstream.

OTOH, if it does work, then that points to something amiss with the Guix 
package or its dependencies.

Would you be able to test please? Given that this seems on the face of 
it to be a central part of this package it would be good to know why the 
package isn't working.
Thanks,
ben
diff mbox

Patch

From c2a15eb90e42e2020d38161f51bca1c800d12139 Mon Sep 17 00:00:00 2001
From: Daniel Pimentel <d4n1@d4n1.org>
Date: Thu, 23 Jun 2016 13:34:54 -0300
Subject: [PATCH 2/2] gnu: add python2-qrcode * gnu/packages/python.scm: add
 new package.

---
 gnu/packages/python.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index cf4ef3c..529da2c 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -9315,3 +9315,30 @@  etc.")
      "A module that implements the password-based key derivation 
 function PBKDF2.")
     (license license:expat)))
+
+(define-public python2-qrcode
+  (package
+    (name "python2-qrcode")
+    (version "5.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "qrcode" version))
+       (sha256
+        (base32
+         "0kljfrfq0c2rmxf8am57333ia41kd0snbm2rnqbdy816hgpcq5a1"))))
+    (build-system python-build-system)
+    (inputs
+     `(("python2-pillow" ,python2-pillow)
+       ("python2-six" ,python2-six)))
+    (native-inputs
+     `(("python2-setuptools" ,python2-setuptools)))
+    (arguments
+     `(#:python ,python-2))
+    (home-page "https://pypi.python.org/pypi/qrcode")
+    (synopsis "Python library to generate QR Codes")
+    (description
+     "@code{qrcode} is a library which can be used to generate Quick
+Response (QR) images.  It is recommended that the pillow library be used to
+generate images, though the default Python imaging library can also be used.")
+    (license bsd-3)))
-- 
2.7.4