3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/portaudio/default.nix

55 lines
1.4 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchurl
, alsa-lib
, pkg-config
, AudioUnit
, AudioToolbox
, CoreAudio
, CoreServices
, Carbon }:
stdenv.mkDerivation rec {
pname = "portaudio";
version = "190700_20210406";
src = fetchurl {
url = "http://files.portaudio.com/archives/pa_stable_v${version}.tgz";
sha256 = "1vrdrd42jsnffh6rq8ap2c6fr4g9fcld89z649fs06bwqx1bzvs7";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = lib.optional (!stdenv.isDarwin) alsa-lib;
configureFlags = [ "--disable-mac-universal" "--enable-cxx" ];
2017-01-04 19:23:02 +00:00
2021-08-30 09:12:52 +01:00
postConfigure = ''
substituteInPlace Makefile --replace "-Werror" ""
'';
propagatedBuildInputs = lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ];
# not sure why, but all the headers seem to be installed by the make install
2017-01-04 19:23:02 +00:00
installPhase = ''
make install
'' + lib.optionalString (!stdenv.isDarwin) ''
# fixup .pc file to find alsa library
sed -i "s|-lasound|-L${alsa-lib.out}/lib -lasound|" "$out/lib/pkgconfig/"*.pc
'' + lib.optionalString stdenv.isDarwin ''
2017-01-04 19:23:02 +00:00
cp include/pa_mac_core.h $out/include/pa_mac_core.h
'';
meta = with lib; {
description = "Portable cross-platform Audio API";
homepage = "http://www.portaudio.com/";
# Not exactly a bsd license, but alike
2013-07-07 11:51:41 +01:00
license = licenses.mit;
maintainers = with maintainers; [ lovek323 ];
platforms = platforms.unix;
};
passthru = {
api_version = 19;
};
}