From a1d7a5b9ed1392d8c5c1a8561357b72e48253ccf Mon Sep 17 00:00:00 2001 From: Federico Beffa
Date: Thu, 18 Dec 2014 21:32:34 +0100 Subject: [PATCH 3/4] gnu: libcanberra: Add default sounds support. * gnu/packages/libcanberra.scm (libcanberra): Add input 'sound-theme-freedesktop'. Add phase 'patch-default-sounds-directory to patch the default sounds directory. --- gnu/packages/libcanberra.scm | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/gnu/packages/libcanberra.scm b/gnu/packages/libcanberra.scm index 764c327..91760d8 100644 --- a/gnu/packages/libcanberra.scm +++ b/gnu/packages/libcanberra.scm @@ -55,9 +55,36 @@ ("libtool" ,libtool) ("libvorbis" ,libvorbis) ("pulseaudio" ,pulseaudio) - ("udev" ,eudev))) + ("udev" ,eudev) + ("sound-theme-freedesktop" ,sound-theme-freedesktop))) (native-inputs `(("pkg-config" ,pkg-config))) + ;; "sound-theme-freedesktop" is the default and fall-back sound theme for + ;; XDG desktops and should always be present. + ;; http://www.freedesktop.org/wiki/Specifications/sound-theme-spec/ + ;; We make sure libcanberra will find it. + (arguments + `(#:phases + (alist-cons-before + 'build 'patch-default-sounds-directory + (lambda* (#:key inputs #:allow-other-keys) + (let ((sounds (string-append + (assoc-ref inputs "sound-theme-freedesktop") + "/share"))) + (substitute* "src/sound-theme-spec.c" + (("return \"/usr/local/share:/usr/share\";") + (string-append "return \"" sounds "\";\n" + " else {\n" + " const char *stp = \":" + sounds "\";\n" + " size_t len = strlen(stp) + " + "strlen(g) + 1;\n" + " " + "char *g2 = (char*) malloc(len);\n" + " return " + "strcat(strcpy(g2, g), stp);\n" + " }"))))) + %standard-phases))) (home-page "http://0pointer.de/lennart/projects/libcanberra/") (synopsis "Implementation of the XDG Sound Theme and Name Specifications") -- 1.8.4