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