libcanberra.scm 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. (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 git-download)
  28. #:use-module (guix build-system gnu)
  29. #:use-module (guix build-system python)
  30. #:use-module (guix utils)
  31. #:use-module (gnu packages autotools)
  32. #:use-module (gnu packages gstreamer)
  33. #:use-module (gnu packages gtk)
  34. #:use-module (gnu packages glib)
  35. #:use-module (gnu packages linux)
  36. #:use-module (gnu packages pulseaudio)
  37. #:use-module (gnu packages pkg-config)
  38. #:use-module (gnu packages python)
  39. #:use-module (gnu packages xiph)
  40. #:use-module ((srfi srfi-1) #:select (alist-delete)))
  41. (define-public libcanberra
  42. (package
  43. (name "libcanberra")
  44. (version "0.30")
  45. (source
  46. (origin
  47. (method url-fetch)
  48. ;; This used to be at 0pointer.de but it vanished.
  49. (uri (string-append
  50. "http://pkgs.fedoraproject.org/repo/pkgs/libcanberra/libcanberra-"
  51. version ".tar.xz/34cb7e4430afaf6f447c4ebdb9b42072/libcanberra-"
  52. version ".tar.xz"))
  53. (sha256
  54. (base32
  55. "0wps39h8rx2b00vyvkia5j40fkak3dpipp1kzilqla0cgvk73dn2"))
  56. ;; "sound-theme-freedesktop" is the default and fall-back sound theme for
  57. ;; XDG desktops and should always be present.
  58. ;; http://www.freedesktop.org/wiki/Specifications/sound-theme-spec/
  59. ;; We make sure libcanberra will find it.
  60. ;;
  61. ;; We add the default sounds store directory to the code dealing with
  62. ;; XDG_DATA_DIRS and not XDG_DATA_HOME. This is because XDG_DATA_HOME
  63. ;; can only be a single directory and is inspected first. XDG_DATA_DIRS
  64. ;; can list an arbitrary number of directories and is only inspected
  65. ;; later. This is designed to allows the user to modify any theme at
  66. ;; his pleasure.
  67. (patch-flags '("-p0"))
  68. (patches
  69. (search-patches "libcanberra-sound-theme-freedesktop.patch"
  70. "libcanberra-wayland-crash.patch"))))
  71. (build-system gnu-build-system)
  72. (inputs
  73. `(("alsa-lib" ,alsa-lib)
  74. ("gstreamer" ,gstreamer)
  75. ("gtk+" ,gtk+)
  76. ("libltdl" ,libltdl)
  77. ("libvorbis" ,libvorbis)
  78. ("pulseaudio" ,pulseaudio)
  79. ("udev" ,eudev)
  80. ("sound-theme-freedesktop" ,sound-theme-freedesktop)))
  81. (native-inputs
  82. `(("pkg-config" ,pkg-config)))
  83. (arguments
  84. `(#:phases
  85. (modify-phases %standard-phases
  86. (add-before 'build 'patch-default-sounds-directory
  87. (lambda* (#:key inputs #:allow-other-keys)
  88. (substitute* "src/sound-theme-spec.c"
  89. (("@SOUND_THEME_DIRECTORY@")
  90. (string-append
  91. (assoc-ref inputs "sound-theme-freedesktop")
  92. "/share")))
  93. #t)))))
  94. (home-page "http://0pointer.de/lennart/projects/libcanberra/")
  95. (synopsis
  96. "Implementation of the XDG Sound Theme and Name Specifications")
  97. (description
  98. "Libcanberra is an implementation of the XDG Sound Theme and Name
  99. Specifications, for generating event sounds on free desktops, such as
  100. GNOME. It comes with several backends (ALSA, PulseAudio, OSS, GStreamer,
  101. null) and is designed to be portable.")
  102. (license lgpl2.1+)))
  103. (define-public libcanberra/gtk+-2
  104. (package/inherit libcanberra
  105. (name "libcanberra-gtk2")
  106. (inputs `(,@(alist-delete "gtk+" (package-inputs libcanberra))
  107. ("gtk+" ,gtk+-2)))))
  108. (define-public sound-theme-freedesktop
  109. (package
  110. (name "sound-theme-freedesktop")
  111. (version "0.8")
  112. (source (origin
  113. (method url-fetch)
  114. (uri (string-append "https://people.freedesktop.org/~mccann/dist/"
  115. name "-" version ".tar.bz2"))
  116. (sha256
  117. (base32
  118. "054abv4gmfk9maw93fis0bf605rc56dah7ys5plc4pphxqh8nlfb"))))
  119. (build-system gnu-build-system)
  120. (native-inputs `(("intltool" ,intltool)))
  121. (synopsis "Audio samples for use as a desktop sound theme")
  122. (description
  123. "This package provides audio samples that can be used by libcanberra as
  124. sounds for various system events.")
  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. (home-page "https://www.freedesktop.org/wiki/Specifications/sound-theme-spec/")))
  128. (define-public python-pycanberra
  129. (package
  130. (name "python-pycanberra")
  131. (version "0.1.1")
  132. (source
  133. (origin
  134. (method url-fetch)
  135. (uri (string-append "http://ftp.n0.is/pub/releases/"
  136. "pycanberra-" version ".tar.xz"))
  137. (sha256
  138. (base32
  139. "16jjf8fcgaprmz6jacsxrh17l1ad891fns38bxv49lg3s3mn1nj2"))))
  140. (build-system python-build-system)
  141. (arguments
  142. `(#:tests? #f)) ;No tests included.
  143. (propagated-inputs
  144. `(("libcanberra" ,libcanberra)))
  145. (synopsis "Ctypes wrapper for the libcanberra API")
  146. (description
  147. "Pycanberra is a basic Python wrapper for libcanberra.")
  148. (home-page "http://c.n0.is/ng0/pycanberra/")
  149. (license lgpl2.1+)))