6bac0bcd5bdb731670de5df070d32933d19fbc76
[jackhill/guix/guix.git] / gnu / packages / libcanberra.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2016 Fabian Harfert <fhmgufs@web.de>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages libcanberra)
22 #:use-module ((guix licenses)
23 #:select (lgpl2.1+ gpl2 gpl2+ cc-by-sa4.0 cc-by3.0))
24 #:use-module (gnu packages)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build utils)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages gstreamer)
31 #:use-module (gnu packages gtk)
32 #:use-module (gnu packages glib)
33 #:use-module (gnu packages linux)
34 #:use-module (gnu packages pulseaudio)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages xiph))
37
38 (define-public libcanberra
39 (package
40 (name "libcanberra")
41 (version "0.30")
42 (source
43 (origin
44 (method url-fetch)
45
46 ;; This used to be at 0pointer.de but it vanished.
47 (uri (string-append
48 "http://pkgs.fedoraproject.org/repo/pkgs/libcanberra/libcanberra-"
49 version ".tar.xz/34cb7e4430afaf6f447c4ebdb9b42072/libcanberra-"
50 version ".tar.xz"))
51 (sha256
52 (base32
53 "0wps39h8rx2b00vyvkia5j40fkak3dpipp1kzilqla0cgvk73dn2"))
54 ;; "sound-theme-freedesktop" is the default and fall-back sound theme for
55 ;; XDG desktops and should always be present.
56 ;; http://www.freedesktop.org/wiki/Specifications/sound-theme-spec/
57 ;; We make sure libcanberra will find it.
58 ;;
59 ;; We add the default sounds store directory to the code dealing with
60 ;; XDG_DATA_DIRS and not XDG_DATA_HOME. This is because XDG_DATA_HOME
61 ;; can only be a single directory and is inspected first. XDG_DATA_DIRS
62 ;; can list an arbitrary number of directories and is only inspected
63 ;; later. This is designed to allows the user to modify any theme at
64 ;; his pleasure.
65 (patch-flags '("-p0"))
66 (patches
67 (search-patches "libcanberra-sound-theme-freedesktop.patch"))))
68 (build-system gnu-build-system)
69 (inputs
70 `(("alsa-lib" ,alsa-lib)
71 ("gstreamer" ,gstreamer)
72 ("gtk+" ,gtk+)
73 ("libltdl" ,libltdl)
74 ("libvorbis" ,libvorbis)
75 ("pulseaudio" ,pulseaudio)
76 ("udev" ,eudev)
77 ("sound-theme-freedesktop" ,sound-theme-freedesktop)))
78 (native-inputs
79 `(("pkg-config" ,pkg-config)))
80 (arguments
81 `(#:phases
82 (alist-cons-before
83 'build 'patch-default-sounds-directory
84 (lambda* (#:key inputs #:allow-other-keys)
85 (substitute* "src/sound-theme-spec.c"
86 (("@SOUND_THEME_DIRECTORY@")
87 (string-append
88 (assoc-ref inputs "sound-theme-freedesktop")
89 "/share"))))
90 %standard-phases)))
91 (home-page "http://0pointer.de/lennart/projects/libcanberra/")
92 (synopsis
93 "Implementation of the XDG Sound Theme and Name Specifications")
94 (description
95 "Libcanberra is an implementation of the XDG Sound Theme and Name
96 Specifications, for generating event sounds on free desktops, such as
97 GNOME. It comes with several backends (ALSA, PulseAudio, OSS, GStreamer,
98 null) and is designed to be portable.")
99 (license lgpl2.1+)))
100
101 (define-public libcanberra/gtk+-2
102 (package (inherit libcanberra)
103 (name "libcanberra-gtk2")
104 (inputs `(,@(alist-delete "gtk+" (package-inputs libcanberra))
105 ("gtk+" ,gtk+-2)))))
106
107 (define-public sound-theme-freedesktop
108 (package
109 (name "sound-theme-freedesktop")
110 (version "0.8")
111 (source (origin
112 (method url-fetch)
113 (uri (string-append "https://people.freedesktop.org/~mccann/dist/"
114 name "-" version ".tar.bz2"))
115 (sha256
116 (base32
117 "054abv4gmfk9maw93fis0bf605rc56dah7ys5plc4pphxqh8nlfb"))))
118 (build-system gnu-build-system)
119 (native-inputs `(("intltool" ,intltool)))
120 (synopsis "Audio samples for use as a desktop sound theme")
121 (description
122 "This package provides audio samples that can be used by libcanberra as
123 sounds for various system events.")
124
125 ;; The license of the various sounds is given in the 'CREDITS' file.
126 (license (list cc-by-sa4.0 cc-by3.0 gpl2 gpl2+))
127
128 (home-page "http://www.freedesktop.org/wiki/Specifications/sound-theme-spec/")))