1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 fetchpatch,
6 cmake,
7 pkg-config,
8 alsaSupport ? stdenv.hostPlatform.isLinux,
9 alsa-lib,
10 jackSupport ? true,
11 jack,
12 coremidiSupport ? stdenv.hostPlatform.isDarwin,
13}:
14
15stdenv.mkDerivation rec {
16 pname = "rtmidi";
17 version = "6.0.0";
18
19 src = fetchFromGitHub {
20 owner = "thestk";
21 repo = "rtmidi";
22 tag = version;
23 hash = "sha256-QuUeFx8rPpe0+exB3chT6dUceDa/7ygVy+cQYykq7e0=";
24 };
25
26 nativeBuildInputs = [
27 cmake
28 pkg-config
29 ];
30
31 buildInputs = lib.optional alsaSupport alsa-lib ++ lib.optional jackSupport jack;
32
33 cmakeFlags = [
34 "-DRTMIDI_API_ALSA=${if alsaSupport then "ON" else "OFF"}"
35 "-DRTMIDI_API_JACK=${if jackSupport then "ON" else "OFF"}"
36 "-DRTMIDI_API_CORE=${if coremidiSupport then "ON" else "OFF"}"
37 ];
38
39 meta = {
40 description = "Set of C++ classes that provide a cross platform API for realtime MIDI input/output";
41 homepage = "https://www.music.mcgill.ca/~gary/rtmidi/";
42 license = lib.licenses.mit;
43 maintainers = with lib.maintainers; [ magnetophon ];
44 platforms = lib.platforms.unix;
45 };
46}