libcanberra.scm 5.0 KB

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