libcanberra: fix build on darwin

This commit is contained in:
Weijia Wang 2022-08-02 18:39:38 +02:00
parent fd031c0299
commit 60514b555d
2 changed files with 14 additions and 10 deletions

View File

@ -1,7 +1,7 @@
{ stdenv, lib, fetchurl, fetchpatch, pkg-config, libtool
, gtk2-x11, gtk3-x11 , gtkSupport ? null
, libpulseaudio, gst_all_1, libvorbis, libcap
, Carbon, CoreServices
, Carbon, CoreServices, AppKit
, withAlsa ? stdenv.isLinux, alsa-lib }:
stdenv.mkDerivation rec {
@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
] ++ (with gst_all_1; [ gstreamer gst-plugins-base ])
++ lib.optional (gtkSupport == "gtk2") gtk2-x11
++ lib.optional (gtkSupport == "gtk3") gtk3-x11
++ lib.optionals stdenv.isDarwin [Carbon CoreServices]
++ lib.optionals stdenv.isDarwin [ Carbon CoreServices AppKit ]
++ lib.optional stdenv.isLinux libcap
++ lib.optional withAlsa alsa-lib;
@ -33,15 +33,19 @@ stdenv.mkDerivation rec {
url = "http://git.0pointer.net/libcanberra.git/patch/?id=c0620e432650e81062c1967cc669829dbd29b310";
sha256 = "0rc7zwn39yxzxp37qh329g7375r5ywcqcaak8ryd0dgvg8m5hcx9";
})
] ++ lib.optionals stdenv.isDarwin [
(fetchpatch {
url = "https://github.com/macports/macports-ports/raw/5a7965dfea7727d1ceedee46c7b0ccee9cb23468/audio/libcanberra/files/patch-configure.diff";
sha256 = "sha256-pEJy1krciUEg5BFIS8FJ4BubjfS/nt9aqi6BLnS1+4M=";
extraPrefix = "";
})
(fetchpatch {
url = "https://github.com/macports/macports-ports/raw/5a7965dfea7727d1ceedee46c7b0ccee9cb23468/audio/libcanberra/files/dynamic_lookup-11.patch";
sha256 = "sha256-nUjha2pKh5VZl0ZZzcr9NTo1TVuMqF4OcLiztxW+ofQ=";
extraPrefix = "";
})
];
postPatch = lib.optionalString stdenv.isDarwin ''
patch -p0 < ${fetchpatch {
url = "https://raw.githubusercontent.com/macports/macports-ports/master/audio/libcanberra/files/patch-configure.diff";
sha256 = "1f7h7ifpqvbfhqygn1b7klvwi80zmpv3538vbmq7ql7bkf1q8h31";
}}
'';
postInstall = ''
for f in $out/lib/*.la; do
sed 's|-lltdl|-L${libtool.lib}/lib -lltdl|' -i $f

View File

@ -18729,7 +18729,7 @@ with pkgs;
libcamera = callPackage ../development/libraries/libcamera { };
libcanberra = callPackage ../development/libraries/libcanberra {
inherit (darwin.apple_sdk.frameworks) Carbon CoreServices;
inherit (darwin.apple_sdk.frameworks) Carbon CoreServices AppKit;
};
libcanberra-gtk2 = pkgs.libcanberra.override {
gtkSupport = "gtk2";