From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Allan Webber Subject: [PATCH 01/04] gnu: Add python-pygpgme Date: Fri, 05 Feb 2016 19:47:26 -0800 Message-ID: <87fux6fqlj.fsf@dustycloud.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRtqO-0002TD-PP for guix-devel@gnu.org; Fri, 05 Feb 2016 22:47:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRtqL-00023J-5b for guix-devel@gnu.org; Fri, 05 Feb 2016 22:47:32 -0500 Received: from dustycloud.org ([50.116.34.160]:51258) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRtqL-00022l-0M for guix-devel@gnu.org; Fri, 05 Feb 2016 22:47:29 -0500 Received: from oolong (localhost [127.0.0.1]) by dustycloud.org (Postfix) with ESMTPS id 7209C266DD for ; Fri, 5 Feb 2016 22:47:26 -0500 (EST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= Content-Type: text/plain First of several patches on the path to assword! --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-python-pygpgme.patch Content-Transfer-Encoding: quoted-printable >From 2137270785d39d2592e4ffc2b3c3253fd0daf540 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 5 Feb 2016 11:06:54 -0800 Subject: [PATCH 1/4] gnu: Add python-pygpgme * gnu/packages/gnupg.scm (python-pygpgme, python2-pygpgme): New variables= . * gnu/packages/patches/pygpgme-disable-problematic-tests.patch: New file. --- gnu/packages/gnupg.scm | 42 ++++++++++++++++= ++++++ .../pygpgme-disable-problematic-tests.patch | 37 ++++++++++++++++= +++ 2 files changed, 79 insertions(+) create mode 100644 gnu/packages/patches/pygpgme-disable-problematic-test= s.patch diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm index 501cf55..bdc5e4a 100644 --- a/gnu/packages/gnupg.scm +++ b/gnu/packages/gnupg.scm @@ -5,6 +5,7 @@ ;;; Copyright =C2=A9 2014, 2015 Mark H Weaver ;;; Copyright =C2=A9 2015 Paul van der Walt ;;; Copyright =C2=A9 2015, 2016 Efraim Flashner +;;; Copyright =C2=A9 2016 Christopher Allan Webber ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,6 +24,7 @@ =20 (define-module (gnu packages gnupg) #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) #:use-module (gnu packages adns) #:use-module (gnu packages curl) #:use-module (gnu packages openldap) @@ -332,6 +334,46 @@ instead. This way bug fixes or improvements can be = done at a central place and every application benefits from this.") (license license:lgpl2.1+))) =20 +(define-public python-pygpgme + (package + (name "python-pygpgme") + (version "0.3") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pygpgme" version)) + (sha256 + (base32 + "1q82p3gs6lwq8j8dxk4pvrwk3jpww1zqcjrzznl9clh10z28gn2z")) + ;; Unfortunately, we have to disable some tests due to some gpg-a= gent + ;; goofiness... see: + ;; https://bugs.launchpad.net/pygpgme/+bug/999949 + (patches (list (search-patch "pygpgme-disable-problematic-tests.p= atch"))))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'build 'make-build + (lambda (. args) + (zero? (system* "make" "build")))) + (replace 'check + (lambda _ + (zero? (system* "make" "check"))))))) + (build-system python-build-system) + (inputs + `(("python-setuptools" ,python-setuptools) + ("gnupg" ,gnupg-2.0) + ("gpgme" ,gpgme))) + (home-page "https://launchpad.net/pygpgme") + (synopsis + "A Python module for working with OpenPGP messages") + (description + "PyGPGME is a Python module that lets you sign, verify, encrypt and +decrypt messages using the OpenPGP format.") + (license license:lgpl2.1+))) + +(define-public python2-pygpgme + (package-with-python2 python-pygpgme)) + (define-public python-gnupg (package (name "python-gnupg") diff --git a/gnu/packages/patches/pygpgme-disable-problematic-tests.patch= b/gnu/packages/patches/pygpgme-disable-problematic-tests.patch new file mode 100644 index 0000000..2129d2f --- /dev/null +++ b/gnu/packages/patches/pygpgme-disable-problematic-tests.patch @@ -0,0 +1,37 @@ +These tests require a gpg agent to run, and are difficult to get to work= right +in Guix's environment. For more details, see: + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D713074 + https://bugs.launchpad.net/pygpgme/+bug/999949 + +--- pygpgme-0.3/tests/test_encrypt_decrypt.py 2012-02-28 19:10:28.000000= 000 -0800 ++++ pygpgme-0.3/tests/test_encrypt_decrypt.py 2016-02-05 10:21:58.966685= 384 -0800 +@@ -125,7 +125,7 @@ + ctx.decrypt(ciphertext, plaintext) + self.assertEqual(plaintext.getvalue(), b'Hello World\n') +=20 +- def test_encrypt_symmetric(self): ++ def skip_test_encrypt_symmetric(self): + plaintext =3D BytesIO(b'Hello World\n') + ciphertext =3D BytesIO() + def passphrase(uid_hint, passphrase_info, prev_was_bad, fd): + +--- pygpgme-0.3/tests/test_passphrase.py 2012-02-28 19:04:17.000000000 -= 0800 ++++ pygpgme-0.3/tests/test_passphrase.py 2016-02-05 10:21:47.990630956 -= 0800 +@@ -30,7 +30,7 @@ +=20 + import_keys =3D ['passphrase.pub', 'passphrase.sec'] +=20 +- def test_sign_without_passphrase_cb(self): ++ def skip_test_sign_without_passphrase_cb(self): + ctx =3D gpgme.Context() + key =3D ctx.get_key('EFB052B4230BBBC51914BCBB54DCBBC8DBFB9EB3') + ctx.signers =3D [key] +@@ -51,7 +51,7 @@ + self.prev_was_bad =3D prev_was_bad + os.write(fd, b'test\n') +=20 +- def test_sign_with_passphrase_cb(self): ++ def skip_test_sign_with_passphrase_cb(self): + ctx =3D gpgme.Context() + key =3D ctx.get_key('EFB052B4230BBBC51914BCBB54DCBBC8DBFB9EB3') + ctx.signers =3D [key] --=20 2.6.3 --=-=-=--