nixpkgs/pkgs/development/libraries/portaudio/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
2.1 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchurl
, alsa-lib
2023-02-08 10:41:49 +00:00
, libjack2
, pkg-config
2022-06-05 11:05:29 +00:00
, which
, 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";
};
2022-06-07 02:52:11 +00:00
strictDeps = true;
2022-06-05 11:05:29 +00:00
nativeBuildInputs = [ pkg-config which ];
2023-02-08 10:41:49 +00:00
buildInputs = [ libjack2 ] ++ lib.optionals (!stdenv.isDarwin) [ alsa-lib ];
configureFlags = [ "--disable-mac-universal" "--enable-cxx" ];
2017-01-04 19:23:02 +00:00
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=nullability-inferred-on-nested-type -Wno-error=nullability-completeness-on-arrays -Wno-error=implicit-const-int-float-conversion";
propagatedBuildInputs = lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ];
# Disable parallel build as it fails as:
# make: *** No rule to make target '../../../lib/libportaudio.la',
# needed by 'libportaudiocpp.la'. Stop.
# Next release should address it with
# https://github.com/PortAudio/portaudio/commit/28d2781d9216115543aa3f0a0ffb7b4ee0fac551.patch
enableParallelBuilding = false;
2022-06-05 11:05:29 +00:00
postPatch = ''
# workaround for the configure script which expects an absolute path
export AR=$(which $AR)
'';
# 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 10:51:41 +00:00
license = licenses.mit;
maintainers = with maintainers; [ lovek323 ];
platforms = platforms.unix;
};
passthru = {
api_version = 19;
};
}