1 { stdenv, lib, fetchurl, fetchpatch, pkg-config, libtool
3 , libpulseaudio, gst_all_1, libvorbis, libcap
5 , withAlsa ? stdenv.isLinux, alsaLib }:
7 stdenv.mkDerivation rec {
8 name = "libcanberra-0.30";
11 url = "http://0pointer.de/lennart/projects/libcanberra/${name}.tar.xz";
12 sha256 = "0wps39h8rx2b00vyvkia5j40fkak3dpipp1kzilqla0cgvk73dn2";
15 nativeBuildInputs = [ pkg-config libtool ];
17 libpulseaudio libvorbis gtk
18 ] ++ (with gst_all_1; [ gstreamer gst-plugins-base ])
19 ++ lib.optional stdenv.isDarwin CoreServices
20 ++ lib.optional stdenv.isLinux libcap
21 ++ lib.optional withAlsa alsaLib;
23 configureFlags = [ "--disable-oss" ];
27 name = "0001-gtk-Don-t-assume-all-GdkDisplays-are-GdkX11Displays-.patch";
28 url = "http://git.0pointer.net/libcanberra.git/patch/?id=c0620e432650e81062c1967cc669829dbd29b310";
29 sha256 = "0rc7zwn39yxzxp37qh329g7375r5ywcqcaak8ryd0dgvg8m5hcx9";
33 postPatch = (lib.optional stdenv.isDarwin) ''
34 patch -p0 < ${fetchpatch {
35 url = "https://raw.githubusercontent.com/macports/macports-ports/master/audio/libcanberra/files/patch-configure.diff";
36 sha256 = "1f7h7ifpqvbfhqygn1b7klvwi80zmpv3538vbmq7ql7bkf1q8h31";
41 for f in $out/lib/*.la; do
42 sed 's|-lltdl|-L${libtool.lib}/lib -lltdl|' -i $f
47 gtkModule = "/lib/gtk-2.0/";
51 description = "An implementation of the XDG Sound Theme and Name Specifications";
53 libcanberra is an implementation of the XDG Sound Theme and Name
54 Specifications, for generating event sounds on free desktops
55 such as GNOME. It comes with several backends (ALSA,
56 PulseAudio, OSS, GStreamer, null) and is designed to be
59 homepage = "http://0pointer.de/lennart/projects/libcanberra/";
60 license = licenses.lgpl2Plus;
62 platforms = platforms.unix;
63 # canberra-gtk-module.c:28:10: fatal error: 'gdk/gdkx.h' file not found
64 # #include <gdk/gdkx.h>
65 broken = stdenv.isDarwin;