On Thu, Feb 18, 2016 at 09:26:53PM +0000, Christopher Baines wrote:
> * gnu/packages/python.scm (python-mpd2): New variable
> * gnu/packages/python.scm Import lgpl3.

I actually have a patch for this in a WIP tree (attached). Based on the
differences, and the fact that I have already made the changes requested
below, I think my version of the patch should be used. My patch also
adds a python-2 version; when possible, it's preferred to add both
versions.

What do you think?

[...]

> +(define-public python-mpd2
> +  (package
> +    (name "python-mpd2")
> +    (version "0.5.5")
> +    (source
> +      (origin
> +        (method url-fetch)
> +        (uri (pypi-uri "python-mpd2" version))
> +        (sha256
> +          (base32
> +            "0laypd7h1j14b4vrmiayqlzdsh2j5hc3zv4l0fqvbrbw9y6763ii"))))

I'm glad to see we concur on this.

> +    (build-system python-build-system)
> +    (arguments
> +     `(#:phases
> +       (alist-replace
> +        'check
> +        (lambda _ (zero? (system* "python" "mpd_test.py")))
> +        %standard-phases)))
> +    (inputs
> +      `(("python-setuptools" ,python-setuptools)
> +        ("python-mock" ,python-mock)
> +        ("python-unittest2" ,python-unittest2)))

I don't believe that unittest2 is needed. I can build both
python-variants without it.

Setuptools is only needed for the python2-variant.

And, I think mock is only needed at build-time, so it would be a
native-input.

> +    (home-page
> +      "https://github.com/Mic92/python-mpd2";)
> +    (synopsis "Python MPD client library")
> +    (description "A Python MPD client library")

Generally descriptions should be more descriptive than the synopsis.

> +    (license lgpl3)))

I believe the license is lgpl3+, based on the "or later version" in
mpd.py.

> +
> +
>  (define-public python-setuptools
>    (package
>      (name "python-setuptools")
> -- 
> 2.7.0
> 
> 
>From 03d428d2452a9a8b14e95e948939634cddcfd825 Mon Sep 17 00:00:00 2001
From: Leo Famulari <l...@famulari.name>
Date: Mon, 15 Feb 2016 04:33:49 -0500
Subject: [PATCH] gnu: Add python-mpd2.

* gnu/packages/python.scm (python-mpd2, python2-mpd2): New
* variables.
* gnu/packages/patches/python-mpd2-tests.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu/packages/python.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 8a44de9..7acb766 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -7821,3 +7821,34 @@ comparing Windows paths ignores casing.
 
 (define-public python2-pathlib
   (package-with-python2 python-pathlib))
+
+(define-public python-mpd2
+  (package
+    (name "python-mpd2")
+    (version "0.5.5")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "python-mpd2" version))
+              (sha256
+               (base32
+                "0laypd7h1j14b4vrmiayqlzdsh2j5hc3zv4l0fqvbrbw9y6763ii"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _ (zero? (system* "python" "mpd_test.py")))))))
+    (native-inputs `(("python-mock" ,python-mock)))
+    (home-page "https://github.com/Mic92/python-mpd2";)
+    (synopsis "A Python MPD client library")
+    (description "Python-mpd2 is a Python library which provides a client
+interface for the Music Player Daemon.")
+    (license lgpl3+)
+    (properties `((python2-variant . ,(delay python2-mpd2))))))
+
+(define-public python2-mpd2
+  (let ((mpd2 (package-with-python2
+               (strip-python2-variant python-mpd2))))
+    (package (inherit mpd2)
+      (native-inputs `(("python2-setuptools" ,python2-setuptools)
+                       ,@(package-native-inputs mpd2))))))
-- 
2.6.3

Reply via email to