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 ng0 <ng0@n0.is>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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)))
43 (define-public libcanberra
51 ;; This used to be at 0pointer.de but it vanished.
53 "http://pkgs.fedoraproject.org/repo/pkgs/libcanberra/libcanberra-"
54 version ".tar.xz/34cb7e4430afaf6f447c4ebdb9b42072/libcanberra-"
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.
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
70 (patch-flags '("-p0"))
72 (search-patches "libcanberra-sound-theme-freedesktop.patch"))))
73 (build-system gnu-build-system)
75 `(("alsa-lib" ,alsa-lib)
76 ("gstreamer" ,gstreamer)
79 ("libvorbis" ,libvorbis)
80 ("pulseaudio" ,pulseaudio)
82 ("sound-theme-freedesktop" ,sound-theme-freedesktop)))
84 `(("pkg-config" ,pkg-config)))
87 (modify-phases %standard-phases
88 (add-before 'build 'patch-default-sounds-directory
89 (lambda* (#:key inputs #:allow-other-keys)
90 (substitute* "src/sound-theme-spec.c"
91 (("@SOUND_THEME_DIRECTORY@")
93 (assoc-ref inputs "sound-theme-freedesktop")
96 (home-page "http://0pointer.de/lennart/projects/libcanberra/")
98 "Implementation of the XDG Sound Theme and Name Specifications")
100 "Libcanberra is an implementation of the XDG Sound Theme and Name
101 Specifications, for generating event sounds on free desktops, such as
102 GNOME. It comes with several backends (ALSA, PulseAudio, OSS, GStreamer,
103 null) and is designed to be portable.")
106 (define-public libcanberra/gtk+-2
107 (package (inherit libcanberra)
108 (name "libcanberra-gtk2")
109 (inputs `(,@(alist-delete "gtk+" (package-inputs libcanberra))
112 (define-public sound-theme-freedesktop
114 (name "sound-theme-freedesktop")
118 (uri (string-append "https://people.freedesktop.org/~mccann/dist/"
119 name "-" version ".tar.bz2"))
122 "054abv4gmfk9maw93fis0bf605rc56dah7ys5plc4pphxqh8nlfb"))))
123 (build-system gnu-build-system)
124 (native-inputs `(("intltool" ,intltool)))
125 (synopsis "Audio samples for use as a desktop sound theme")
127 "This package provides audio samples that can be used by libcanberra as
128 sounds for various system events.")
130 ;; The license of the various sounds is given in the 'CREDITS' file.
131 (license (list cc-by-sa4.0 cc-by3.0 gpl2 gpl2+))
133 (home-page "https://www.freedesktop.org/wiki/Specifications/sound-theme-spec/")))
135 (define-public python-pycanberra
137 (name "python-pycanberra")
142 (uri (string-append "http://ftp.n0.is/pub/releases/"
143 "pycanberra-" version ".tar.xz"))
146 "16jjf8fcgaprmz6jacsxrh17l1ad891fns38bxv49lg3s3mn1nj2"))))
147 (build-system python-build-system)
149 `(#:tests? #f)) ;No tests included.
151 `(("libcanberra" ,libcanberra)))
152 (synopsis "Ctypes wrapper for the libcanberra API")
154 "Pycanberra is a basic Python wrapper for libcanberra.")
155 (home-page "http://c.n0.is/ng0/pycanberra/")