3
0
Fork 0
forked from mirrors/nixpkgs

libcanberra: supports darwin

This commit is contained in:
Matthew Bauer 2018-06-10 21:16:44 -04:00
parent b0cb40ed4b
commit eca521aea7
2 changed files with 22 additions and 7 deletions

View file

@ -1,5 +1,7 @@
{ stdenv, fetchurl, pkgconfig, libtool, gtk ? null, libcap { stdenv, lib, fetchurl, fetchpatch, pkgconfig, libtool
, alsaLib, libpulseaudio, gst_all_1, libvorbis }: , gtk ? null
, libpulseaudio, gst_all_1, libvorbis, libcap
, withAlsa ? stdenv.isLinux, alsaLib }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libcanberra-0.30"; name = "libcanberra-0.30";
@ -11,11 +13,20 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig libtool ]; nativeBuildInputs = [ pkgconfig libtool ];
buildInputs = [ buildInputs = [
alsaLib libpulseaudio libvorbis gtk libcap libpulseaudio libvorbis gtk
] ++ (with gst_all_1; [ gstreamer gst-plugins-base ]); ] ++ (with gst_all_1; [ gstreamer gst-plugins-base ])
++ lib.optional stdenv.isLinux libcap
++ lib.optional withAlsa alsaLib;
configureFlags = "--disable-oss"; configureFlags = "--disable-oss";
patchFlags = "-p0";
patches = stdenv.lib.optional stdenv.isDarwin
(fetchpatch {
url = "https://raw.githubusercontent.com/macports/macports-ports/master/audio/libcanberra/files/patch-configure.diff";
sha256 = "1f7h7ifpqvbfhqygn1b7klvwi80zmpv3538vbmq7ql7bkf1q8h31";
});
postInstall = '' postInstall = ''
for f in $out/lib/*.la; do for f in $out/lib/*.la; do
sed 's|-lltdl|-L${libtool.lib}/lib -lltdl|' -i $f sed 's|-lltdl|-L${libtool.lib}/lib -lltdl|' -i $f
@ -42,6 +53,6 @@ stdenv.mkDerivation rec {
license = stdenv.lib.licenses.lgpl2Plus; license = stdenv.lib.licenses.lgpl2Plus;
maintainers = [ ]; maintainers = [ ];
platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux; # arbitrary choice platforms = stdenv.lib.platforms.unix;
}; };
} }

View file

@ -9809,8 +9809,12 @@ with pkgs;
}; };
libcanberra = callPackage ../development/libraries/libcanberra { }; libcanberra = callPackage ../development/libraries/libcanberra { };
libcanberra-gtk3 = pkgs.libcanberra.override { gtk = pkgs.gtk3; }; libcanberra-gtk3 = pkgs.libcanberra.override {
libcanberra-gtk2 = pkgs.libcanberra-gtk3.override { gtk = pkgs.gtk2; }; gtk = gtk3;
};
libcanberra-gtk2 = pkgs.libcanberra-gtk3.override {
gtk = gtk2.override { gdktarget = "x11"; };
};
libcanberra_kde = if (config.kde_runtime.libcanberraWithoutGTK or true) libcanberra_kde = if (config.kde_runtime.libcanberraWithoutGTK or true)
then pkgs.libcanberra then pkgs.libcanberra