2021-02-02 21:39:38 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, config
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, alsaSupport ? stdenv.hostPlatform.isLinux
|
|
|
|
, alsaLib
|
|
|
|
, pulseaudioSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux
|
|
|
|
, libpulseaudio
|
|
|
|
, jackSupport ? true
|
|
|
|
, jack
|
|
|
|
, coreaudioSupport ? stdenv.hostPlatform.isDarwin
|
|
|
|
, CoreAudio
|
|
|
|
}:
|
2016-05-01 16:57:16 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-05-02 15:49:04 +01:00
|
|
|
version = "5.1.0";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "rtaudio";
|
2016-05-01 16:57:16 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "thestk";
|
|
|
|
repo = "rtaudio";
|
2019-09-09 00:38:31 +01:00
|
|
|
rev = version;
|
2019-05-02 15:49:04 +01:00
|
|
|
sha256 = "1pglnjz907ajlhnlnig3p0sx7hdkpggr8ss7b3wzf1lykzgv9l52";
|
2016-05-01 16:57:16 +01:00
|
|
|
};
|
|
|
|
|
2021-02-02 21:39:38 +00:00
|
|
|
patches = [
|
|
|
|
# Fixes missing headers & install location
|
|
|
|
# Drop with version > 5.1.0
|
|
|
|
(fetchpatch {
|
|
|
|
name = "RtAudio-Adjust-CMake-public-header-installs-to-match-autotools.patch";
|
|
|
|
url = "https://github.com/thestk/rtaudio/commit/4273cf7572b8f51b5996cf6b42e3699cc6b165da.patch";
|
|
|
|
sha256 = "1p0idll0xsfk3jwjg83jkxkaf20gk0wqa7l982ni389rn6i4n26p";
|
|
|
|
})
|
|
|
|
];
|
2020-03-23 02:08:54 +00:00
|
|
|
|
2021-02-02 21:39:38 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace rtaudio.pc.in \
|
|
|
|
--replace 'Requires:' 'Requires.private:'
|
|
|
|
'';
|
2018-06-27 22:53:55 +01:00
|
|
|
|
2021-02-02 21:39:38 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2016-05-01 16:57:16 +01:00
|
|
|
|
2021-02-02 21:39:38 +00:00
|
|
|
buildInputs = lib.optional alsaSupport alsaLib
|
|
|
|
++ lib.optional pulseaudioSupport libpulseaudio
|
|
|
|
++ lib.optional jackSupport jack
|
|
|
|
++ lib.optional coreaudioSupport CoreAudio;
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DRTAUDIO_API_ALSA=${if alsaSupport then "ON" else "OFF"}"
|
|
|
|
"-DRTAUDIO_API_PULSE=${if pulseaudioSupport then "ON" else "OFF"}"
|
|
|
|
"-DRTAUDIO_API_JACK=${if jackSupport then "ON" else "OFF"}"
|
|
|
|
"-DRTAUDIO_API_CORE=${if coreaudioSupport then "ON" else "OFF"}"
|
|
|
|
];
|
2016-05-01 16:57:16 +01:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2016-05-01 16:57:16 +01:00
|
|
|
description = "A set of C++ classes that provide a cross platform API for realtime audio input/output";
|
2021-02-02 21:39:38 +00:00
|
|
|
homepage = "https://www.music.mcgill.ca/~gary/rtaudio/";
|
2019-09-12 12:03:49 +01:00
|
|
|
license = licenses.mit;
|
2021-02-02 21:39:38 +00:00
|
|
|
maintainers = with maintainers; [ magnetophon ];
|
2019-09-12 12:03:49 +01:00
|
|
|
platforms = platforms.unix;
|
2016-05-01 16:57:16 +01:00
|
|
|
};
|
|
|
|
}
|