[bug#34137] gnu: Add ghc-libmp.

Message ID 874la2v4et.fsf@gmail.com
State Accepted
Headers show
Series [bug#34137] gnu: Add ghc-libmp. | expand

Checks

Context Check Description
cbaines/applying patch success Successfully applied

Commit Message

Gabriel Hondet Jan. 21, 2019, 7:46 a.m. UTC
Hi Timothy,

On Sun 20 Jan 2019 at 17:26 Timothy Sample wrote:

> You should be able to remove the “ghc-mtl” input from the MPD package
> without any issue.

Indeed and it works even better, so here is the new patch:

* gnu/packages/mpd.scm (ghc-libmpd): New variable.
---
 gnu/packages/mpd.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

Comments

Ludovic Courtès Jan. 23, 2019, 10:12 p.m. UTC | #1
Hi Gabriel,

Gabriel Hondet <gabrielhondet@gmail.com> skribis:

> diff --git a/gnu/packages/mpd.scm b/gnu/packages/mpd.scm
> index 3fe5d06f4..df4f64470 100644
> --- a/gnu/packages/mpd.scm
> +++ b/gnu/packages/mpd.scm
> @@ -6,6 +6,7 @@
>  ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
>  ;;; Copyright © 2016, 2018 Leo Famulari <leo@famulari.name>
>  ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
> +;;; Copyright © 2019 Gabriel Hondet <gabrielhondet@gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -31,6 +32,7 @@
>    #:use-module (guix build-system gnu)
>    #:use-module (guix build-system meson)
>    #:use-module (guix build-system python)
> +  #:use-module (guix build-system haskell)
>    #:use-module (gnu packages avahi)
>    #:use-module (gnu packages boost)
>    #:use-module (gnu packages gcc)
> @@ -51,6 +53,8 @@
>    #:use-module (gnu packages pkg-config)
>    #:use-module (gnu packages python)
>    #:use-module (gnu packages python-xyz)
> +  #:use-module (gnu packages haskell)
> +  #:use-module (gnu packages haskell-check)

In an effort to avoid pulling in all the Haskell package collection from
mpd.scm, could you move ghc-libmpd to haskell.scm or a new
haskell-audio.scm file?

Thanks!

Ludo’.
Timothy Sample Jan. 24, 2019, 2:27 a.m. UTC | #2
Hi Gabriel,

Gabriel Hondet <gabrielhondet@gmail.com> writes:

> Hi Timothy,
>
> On Sun 20 Jan 2019 at 17:26 Timothy Sample wrote:
>
>> You should be able to remove the “ghc-mtl” input from the MPD package
>> without any issue.
>
> Indeed and it works even better, so here is the new patch:

Glad to hear it.  I checked the ghc-libmpd package, and have a few notes
(in addition to what Ludo said about moving it).

> * gnu/packages/mpd.scm (ghc-libmpd): New variable.
> ---
>  gnu/packages/mpd.scm | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
>
> diff --git a/gnu/packages/mpd.scm b/gnu/packages/mpd.scm
> index 3fe5d06f4..df4f64470 100644
> --- a/gnu/packages/mpd.scm
> +++ b/gnu/packages/mpd.scm
> @@ -6,6 +6,7 @@
>  ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
>  ;;; Copyright © 2016, 2018 Leo Famulari <leo@famulari.name>
>  ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
> +;;; Copyright © 2019 Gabriel Hondet <gabrielhondet@gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -31,6 +32,7 @@
>    #:use-module (guix build-system gnu)
>    #:use-module (guix build-system meson)
>    #:use-module (guix build-system python)
> +  #:use-module (guix build-system haskell)
>    #:use-module (gnu packages avahi)
>    #:use-module (gnu packages boost)
>    #:use-module (gnu packages gcc)
> @@ -51,6 +53,8 @@
>    #:use-module (gnu packages pkg-config)
>    #:use-module (gnu packages python)
>    #:use-module (gnu packages python-xyz)
> +  #:use-module (gnu packages haskell)
> +  #:use-module (gnu packages haskell-check)
>    #:use-module (gnu packages pulseaudio)
>    #:use-module (gnu packages sqlite)
>    #:use-module (gnu packages video)
> @@ -360,3 +364,34 @@ Daemon (MPD).  It supports playlists, multiple profiles (connecting to different
>  MPD servers, search and multimedia key support.")
>      (home-page "https://www.nongnu.org/sonata/")
>      (license license:gpl3+)))
> +
> +(define-public ghc-libmpd
> +  (package
> +    (name "ghc-libmpd")
> +    (version "0.9.0.9")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "https://hackage.haskell.org/package/libmpd/libmpd-"
> +             version
> +             ".tar.gz"))
> +       (sha256
> +        (base32
> +         "1931m23iqb4wddpdidm4ph746zpaw41kkjzmb074j7yyfpk7x1jv"))))
> +    (build-system haskell-build-system)
> +    (inputs
> +     `(("ghc-attoparsec" ,ghc-attoparsec)
> +       ("ghc-old-locale" ,ghc-old-locale)
> +       ("ghc-text" ,ghc-text)
> +       ("ghc-data-default-class" ,ghc-data-default-class)
> +       ("ghc-network" ,ghc-network)
> +       ("ghc-utf8-string" ,ghc-utf8-string)))
> +    (native-inputs
> +     `(("ghc-quickcheck" ,ghc-quickcheck)
> +       ("ghc-hspec" ,ghc-hspec)
> +       ("hspec-discover" ,hspec-discover)))
> +    (home-page "http://github.com/vimus/libmpd-haskell#readme")

Maybe drop the anchor here (the “#readme” part).  The linter complains
about it, and I don’t think it adds much.

> +    (synopsis "MPD client library")

This might be better if it mentions Haskell and spells out the
initialism: “Haskell client library for the Music Player Daemon (MPD)”.

> +    (description "A client library for MPD, the Music Player Daemon.")

We try to use complete sentences in the description.  Often, you just
need to add the words “this package provides” to the beginning.  For
this, I might write:

    This package provides a pure Haskell client library for the Music
    Player Daemon (MPD).

> +    (license license:expat)))

Other than that it looks good!


-- Tim

Patch

diff --git a/gnu/packages/mpd.scm b/gnu/packages/mpd.scm
index 3fe5d06f4..df4f64470 100644
--- a/gnu/packages/mpd.scm
+++ b/gnu/packages/mpd.scm
@@ -6,6 +6,7 @@ 
 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
 ;;; Copyright © 2016, 2018 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2019 Gabriel Hondet <gabrielhondet@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,6 +32,7 @@ 
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system haskell)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages gcc)
@@ -51,6 +53,8 @@ 
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages haskell)
+  #:use-module (gnu packages haskell-check)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages video)
@@ -360,3 +364,34 @@  Daemon (MPD).  It supports playlists, multiple profiles (connecting to different
 MPD servers, search and multimedia key support.")
     (home-page "https://www.nongnu.org/sonata/")
     (license license:gpl3+)))
+
+(define-public ghc-libmpd
+  (package
+    (name "ghc-libmpd")
+    (version "0.9.0.9")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://hackage.haskell.org/package/libmpd/libmpd-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "1931m23iqb4wddpdidm4ph746zpaw41kkjzmb074j7yyfpk7x1jv"))))
+    (build-system haskell-build-system)
+    (inputs
+     `(("ghc-attoparsec" ,ghc-attoparsec)
+       ("ghc-old-locale" ,ghc-old-locale)
+       ("ghc-text" ,ghc-text)
+       ("ghc-data-default-class" ,ghc-data-default-class)
+       ("ghc-network" ,ghc-network)
+       ("ghc-utf8-string" ,ghc-utf8-string)))
+    (native-inputs
+     `(("ghc-quickcheck" ,ghc-quickcheck)
+       ("ghc-hspec" ,ghc-hspec)
+       ("hspec-discover" ,hspec-discover)))
+    (home-page "http://github.com/vimus/libmpd-haskell#readme")
+    (synopsis "MPD client library")
+    (description "A client library for MPD, the Music Player Daemon.")
+    (license license:expat)))