anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / development / libraries / audio / rtaudio / default.nix
blob8c1bc7356db13e980b23ecf8a91ef254afb0887d
1 { stdenv
2 , lib
3 , config
4 , fetchFromGitHub
5 , cmake
6 , pkg-config
7 , alsaSupport ? stdenv.hostPlatform.isLinux
8 , alsa-lib
9 , pulseaudioSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux
10 , libpulseaudio
11 , jackSupport ? true
12 , jack
13 , coreaudioSupport ? stdenv.hostPlatform.isDarwin
14 , CoreAudio
17 stdenv.mkDerivation rec {
18   pname = "rtaudio";
19   version = "5.2.0";
21   # nixpkgs-update: no auto update
22   src = fetchFromGitHub {
23     owner = "thestk";
24     repo = "rtaudio";
25     rev = version;
26     sha256 = "0xvahlfj3ysgsjsp53q81hayzw7f99n1g214gh7dwdr52kv2l987";
27   };
29   nativeBuildInputs = [ cmake pkg-config ];
31   buildInputs = lib.optional alsaSupport alsa-lib
32     ++ lib.optional pulseaudioSupport libpulseaudio
33     ++ lib.optional jackSupport jack
34     ++ lib.optional coreaudioSupport CoreAudio;
36   cmakeFlags = [
37     "-DRTAUDIO_API_ALSA=${if alsaSupport then "ON" else "OFF"}"
38     "-DRTAUDIO_API_PULSE=${if pulseaudioSupport then "ON" else "OFF"}"
39     "-DRTAUDIO_API_JACK=${if jackSupport then "ON" else "OFF"}"
40     "-DRTAUDIO_API_CORE=${if coreaudioSupport then "ON" else "OFF"}"
41   ];
43   meta = with lib; {
44     description = "Set of C++ classes that provide a cross platform API for realtime audio input/output";
45     homepage = "https://www.music.mcgill.ca/~gary/rtaudio/";
46     license = licenses.mit;
47     maintainers = with maintainers; [ magnetophon ];
48     platforms = platforms.unix;
49   };