2021-07-11 11:43:13 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, alsa-lib
|
|
|
|
, pkg-config
|
|
|
|
, AudioUnit
|
|
|
|
, AudioToolbox
|
|
|
|
, CoreAudio
|
|
|
|
, CoreServices
|
|
|
|
, Carbon }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "portaudio";
|
|
|
|
version = "190700_20210406";
|
2017-08-13 00:57:33 +01:00
|
|
|
|
2010-08-22 13:08:55 +01:00
|
|
|
src = fetchurl {
|
2021-07-11 11:43:13 +01:00
|
|
|
url = "http://files.portaudio.com/archives/pa_stable_v${version}.tgz";
|
|
|
|
sha256 = "1vrdrd42jsnffh6rq8ap2c6fr4g9fcld89z649fs06bwqx1bzvs7";
|
2010-08-22 13:08:55 +01:00
|
|
|
};
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2021-07-11 11:43:13 +01:00
|
|
|
buildInputs = lib.optional (!stdenv.isDarwin) alsa-lib;
|
2013-07-06 08:56:54 +01:00
|
|
|
|
2019-11-20 09:17:54 +00:00
|
|
|
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" ""
|
|
|
|
'';
|
2019-05-12 04:00:56 +01:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
propagatedBuildInputs = lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ];
|
2013-07-06 08:56:54 +01:00
|
|
|
|
|
|
|
# not sure why, but all the headers seem to be installed by the make install
|
2017-01-04 19:23:02 +00:00
|
|
|
installPhase = ''
|
2013-07-06 08:56:54 +01:00
|
|
|
make install
|
2021-01-21 17:00:13 +00:00
|
|
|
'' + lib.optionalString (!stdenv.isDarwin) ''
|
2014-07-22 14:29:38 +01:00
|
|
|
# fixup .pc file to find alsa library
|
2021-06-10 03:57:09 +01:00
|
|
|
sed -i "s|-lasound|-L${alsa-lib.out}/lib -lasound|" "$out/lib/pkgconfig/"*.pc
|
2021-01-21 17:00:13 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2017-01-04 19:23:02 +00:00
|
|
|
cp include/pa_mac_core.h $out/include/pa_mac_core.h
|
2013-07-06 08:56:54 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2010-08-22 13:08:55 +01:00
|
|
|
description = "Portable cross-platform Audio API";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.portaudio.com/";
|
2010-08-22 13:08:55 +01:00
|
|
|
# Not exactly a bsd license, but alike
|
2013-07-07 11:51:41 +01:00
|
|
|
license = licenses.mit;
|
2013-07-06 08:56:54 +01:00
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
platforms = platforms.unix;
|
2010-08-22 13:08:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
api_version = 19;
|
|
|
|
};
|
|
|
|
}
|