2021-07-11 10:43:13 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, alsa-lib
|
2023-02-08 10:41:49 +00:00
|
|
|
, libjack2
|
2021-07-11 10:43:13 +00:00
|
|
|
, pkg-config
|
2022-06-05 11:05:29 +00:00
|
|
|
, which
|
2024-11-03 11:02:51 +00:00
|
|
|
}:
|
2021-07-11 10:43:13 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "portaudio";
|
2021-07-07 12:01:49 +00:00
|
|
|
version = "190700_20210406";
|
2017-08-12 23:57:33 +00:00
|
|
|
|
2010-08-22 12:08:55 +00:00
|
|
|
src = fetchurl {
|
2023-10-30 20:41:44 +00:00
|
|
|
url = "https://files.portaudio.com/archives/pa_stable_v${version}.tgz";
|
2021-07-11 10:43:13 +00:00
|
|
|
sha256 = "1vrdrd42jsnffh6rq8ap2c6fr4g9fcld89z649fs06bwqx1bzvs7";
|
2010-08-22 12:08:55 +00:00
|
|
|
};
|
|
|
|
|
2022-06-07 02:52:11 +00:00
|
|
|
strictDeps = true;
|
2022-06-05 11:05:29 +00:00
|
|
|
nativeBuildInputs = [ pkg-config which ];
|
2024-11-03 11:02:51 +00:00
|
|
|
buildInputs =
|
|
|
|
[ libjack2 ]
|
|
|
|
++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform alsa-lib) [ alsa-lib ];
|
2013-07-06 07:56:54 +00:00
|
|
|
|
2019-11-20 09:17:54 +00:00
|
|
|
configureFlags = [ "--disable-mac-universal" "--enable-cxx" ];
|
2017-01-04 19:23:02 +00:00
|
|
|
|
2023-02-19 19:23:32 +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";
|
2019-05-12 03:00:56 +00:00
|
|
|
|
2021-10-20 16:30:14 +00:00
|
|
|
# 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)
|
|
|
|
'';
|
|
|
|
|
2013-07-06 07:56:54 +00: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 07:56:54 +00:00
|
|
|
make install
|
2024-09-11 17:57:05 +00:00
|
|
|
'' + lib.optionalString (lib.meta.availableOn stdenv.hostPlatform alsa-lib) ''
|
2014-07-22 13:29:38 +00:00
|
|
|
# fixup .pc file to find alsa library
|
2021-06-10 02:57:09 +00: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.hostPlatform.isDarwin ''
|
2017-01-04 19:23:02 +00:00
|
|
|
cp include/pa_mac_core.h $out/include/pa_mac_core.h
|
2013-07-06 07:56:54 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2010-08-22 12:08:55 +00:00
|
|
|
description = "Portable cross-platform Audio API";
|
2023-10-30 20:41:44 +00:00
|
|
|
homepage = "https://www.portaudio.com/";
|
2010-08-22 12:08:55 +00:00
|
|
|
# Not exactly a bsd license, but alike
|
2013-07-07 10:51:41 +00:00
|
|
|
license = licenses.mit;
|
2013-07-06 07:56:54 +00:00
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
platforms = platforms.unix;
|
2010-08-22 12:08:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
api_version = 19;
|
|
|
|
};
|
|
|
|
}
|