Patchwork gnu: Add sonata

login
register
mail settings
Submitter Christopher Baines
Date Sept. 10, 2016, 11:31 a.m.
Message ID <20160910113133.29711-2-mail@cbaines.net>
Download mbox | patch
Permalink /patch/15489/
State New
Headers show

Comments

Christopher Baines - Sept. 10, 2016, 11:31 a.m.
* gnu/packages/mpd.scm (sonata): New variable.
---
 gnu/packages/mpd.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
Leo Famulari - Sept. 10, 2016, 6:08 p.m.
On Sat, Sep 10, 2016 at 12:31:33PM +0100, Christopher Baines wrote:
> * gnu/packages/mpd.scm (sonata): New variable.

Wow, I'm very happy to see this package fixed up :)

> +    (inputs
> +     `(("gettext" ,gnu-gettext)

All looks good to me except for the gettext issue discussed earlier.

$ guix gc --references $(./pre-inst-env guix build sonata)
substitute: warning: failed to install locale: Invalid argument
/gnu/store/62p7w5021dc0z8phyz4bilfgfjnxhzrq-sonata-1.7b1
/gnu/store/7dcbknnkd21k2wgc0irrn4w5r1kw1mw8-python-pygobject-3.20.0
/gnu/store/7l90h7hm54a92d6fiflwa14m8n5l6myk-at-spi2-core-2.20.1
/gnu/store/ac0zdn8jxn8dzn1pijwh2ab9psjq6fsq-shared-mime-info-1.6
/gnu/store/cmyllry2fvr7g2vjbcahgxn8nkpq228r-gsettings-desktop-schemas-3.20.0
/gnu/store/divvl90xbjma76lmhgfmwcp84lnz6ln6-gtk+-3.20.3
/gnu/store/dn2slclp4kf4mkk9pqamb9sdirac00sj-python-mpd2-0.5.5
/gnu/store/jfr7kjbhi8xirqx2sg4anh4ix61pg66z-adwaita-icon-theme-3.20
/gnu/store/l1s4cw9g58hmcpd2qgbckfl228143qzx-glib-2.48.0
/gnu/store/m473fzc84qsnqnqgb9l4hlardw4ymvbx-gdk-pixbuf+svg-2.34.0
/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3
/gnu/store/rwfyznqxyqxzy242nklybqg5zpw5pl4q-pango-1.40.1
/gnu/store/vq1fk3zi8lkjds25h44y819aa19x78i3-atk-2.20.0
/gnu/store/w39sqjn61hvijpk7jagk1dm5plqq512n-gobject-introspection-1.48.0
/gnu/store/wa1yc835mb7pmmrj45xfgviqr5fbasqq-python-wrapper-3.4.3
/gnu/store/xp330hq98mz8qsqfwpqw0274zwb606c1-harfbuzz-1.2.4
/gnu/store/ykzwykkvr2c80rw4l1qh3mvfdkl7jibi-bash-4.3.42

The built package does not refer to gettext. 

I altered the package to use gettext as a native-input, and then ran
sonata in a '--pure' environment, and it worked. Using strace, I
confirmed that sonata was not finding gettext on its own. I did not use
a container environment, since I couldn't figure out how to make the
graphical display work.

So, should we make gettext a native-input and add the package? :)
Christopher Baines - Sept. 11, 2016, 10 a.m.
Yep, obviously didn't re-read the previous feedback thoroughly enough. gettext
is indeed only used at build time. I've attached an updated patch (with just
that change).

Patch

diff --git a/gnu/packages/mpd.scm b/gnu/packages/mpd.scm
index 279ec68..cc9d583 100644
--- a/gnu/packages/mpd.scm
+++ b/gnu/packages/mpd.scm
@@ -27,10 +27,14 @@ 
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix utils)
+  #:use-module ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages gettext)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages compression)
@@ -263,3 +267,51 @@  interface for the Music Player Daemon.")
     (package (inherit mpd2)
       (native-inputs `(("python2-setuptools" ,python2-setuptools)
                        ,@(package-native-inputs mpd2))))))
+
+(define-public sonata
+  (package
+    (name "sonata")
+    (version "1.7b1")
+    (source (origin
+              (method url-fetch)
+              (uri
+               (string-append "https://github.com/multani/sonata/archive/v"
+                              version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "07gq2nxqwxs0qyxjbay7k5j25zd386bn7wdr2dl1gk53diwnn7s0"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:modules ((guix build gnu-build-system)
+                  (guix build python-build-system)
+                  ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
+                  (guix build utils))
+       #:imported-modules (,@%gnu-build-system-modules
+                           (guix build python-build-system)
+                           (guix build glib-or-gtk-build-system))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
+         (add-after 'install 'wrap-sonata
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out               (assoc-ref outputs "out"))
+                   (gi-typelib-path   (getenv "GI_TYPELIB_PATH")))
+               (wrap-program (string-append out "/bin/sonata")
+                 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
+             #t)))))
+    (inputs
+     `(("gettext" ,gnu-gettext)
+       ("python-mpd2" ,python-mpd2)
+       ("gtk+" ,gtk+)
+       ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
+       ("gobject-introspection" ,gobject-introspection)
+       ("adwaita-icon-theme" ,adwaita-icon-theme)
+       ("python-pygobject" ,python-pygobject)))
+    (synopsis "Elegant client for the Music Player Daemon")
+    (description "Sonata is an elegant graphical client for the Music Player
+Daemon (MPD).  It supports playlists, multiple profiles (connecting to different
+MPD servers, search and multimedia key support.")
+    (home-page "http://www.nongnu.org/sonata/")
+    (license license:gpl3+)))