gnu: Use 'modify-phases' syntax.
[jackhill/guix/guix.git] / gnu / packages / libcanberra.scm
CommitLineData
90ed6291
AE
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3246cc91 3;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
6366cef3 4;;; Copyright © 2016 Fabian Harfert <fhmgufs@web.de>
90ed6291
AE
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)
386b0052
LC
22 #:use-module ((guix licenses)
23 #:select (lgpl2.1+ gpl2 gpl2+ cc-by-sa4.0 cc-by3.0))
beb8dc00 24 #:use-module (gnu packages)
90ed6291
AE
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
6366cef3 28 #:use-module (guix build utils)
90ed6291
AE
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages gstreamer)
31 #:use-module (gnu packages gtk)
573a3554 32 #:use-module (gnu packages glib)
90ed6291 33 #:use-module (gnu packages linux)
571a0310 34 #:use-module (gnu packages pulseaudio)
54ff0b7d
AE
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages xiph))
90ed6291
AE
37
38(define-public libcanberra
39 (package
40 (name "libcanberra")
41 (version "0.30")
42 (source
43 (origin
44 (method url-fetch)
c8bf8b2f
LC
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"))
90ed6291
AE
51 (sha256
52 (base32
beb8dc00
FB
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
fc1adab1 67 (search-patches "libcanberra-sound-theme-freedesktop.patch"))))
90ed6291
AE
68 (build-system gnu-build-system)
69 (inputs
90ed6291
AE
70 `(("alsa-lib" ,alsa-lib)
71 ("gstreamer" ,gstreamer)
72 ("gtk+" ,gtk+)
3246cc91 73 ("libltdl" ,libltdl)
571a0310
LC
74 ("libvorbis" ,libvorbis)
75 ("pulseaudio" ,pulseaudio)
beb8dc00
FB
76 ("udev" ,eudev)
77 ("sound-theme-freedesktop" ,sound-theme-freedesktop)))
c4c4cc05
JD
78 (native-inputs
79 `(("pkg-config" ,pkg-config)))
beb8dc00
FB
80 (arguments
81 `(#:phases
dc1d3cde
KK
82 (modify-phases %standard-phases
83 (add-before '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 #t)))))
90ed6291
AE
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
96Specifications, for generating event sounds on free desktops, such as
97GNOME. It comes with several backends (ALSA, PulseAudio, OSS, GStreamer,
98null) and is designed to be portable.")
99 (license lgpl2.1+)))
573a3554 100
6366cef3
FH
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
573a3554
LC
107(define-public sound-theme-freedesktop
108 (package
109 (name "sound-theme-freedesktop")
110 (version "0.8")
111 (source (origin
112 (method url-fetch)
5cc3096c 113 (uri (string-append "https://people.freedesktop.org/~mccann/dist/"
573a3554
LC
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
123sounds for various system events.")
386b0052
LC
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
573a3554 128 (home-page "http://www.freedesktop.org/wiki/Specifications/sound-theme-spec/")))