diff options
author | OPNA2608 <christoph.neidahl@gmail.com> | 2021-02-01 22:32:20 +0100 |
---|---|---|
committer | OPNA2608 <christoph.neidahl@gmail.com> | 2021-02-03 14:40:07 +0100 |
commit | d8262fc7fb3f46222e5a3e481ddff78bf2b62bbb (patch) | |
tree | 8368d852b8e213dcbeee6427138170b4b2202b86 /pkgs/development/libraries/audio | |
parent | bbc0f1cbb31ae4c60996063d0db8a9bd1f86e602 (diff) | |
download | nixpkgs-d8262fc7fb3f46222e5a3e481ddff78bf2b62bbb.tar nixpkgs-d8262fc7fb3f46222e5a3e481ddff78bf2b62bbb.tar.gz nixpkgs-d8262fc7fb3f46222e5a3e481ddff78bf2b62bbb.tar.bz2 nixpkgs-d8262fc7fb3f46222e5a3e481ddff78bf2b62bbb.tar.lz nixpkgs-d8262fc7fb3f46222e5a3e481ddff78bf2b62bbb.tar.xz nixpkgs-d8262fc7fb3f46222e5a3e481ddff78bf2b62bbb.tar.zst nixpkgs-d8262fc7fb3f46222e5a3e481ddff78bf2b62bbb.zip |
rtmidi: refactor
Diffstat (limited to 'pkgs/development/libraries/audio')
-rw-r--r-- | pkgs/development/libraries/audio/rtmidi/default.nix | 64 |
1 files changed, 51 insertions, 13 deletions
diff --git a/pkgs/development/libraries/audio/rtmidi/default.nix b/pkgs/development/libraries/audio/rtmidi/default.nix index f6208bab6c6..540e152655f 100644 --- a/pkgs/development/libraries/audio/rtmidi/default.nix +++ b/pkgs/development/libraries/audio/rtmidi/default.nix @@ -1,4 +1,18 @@ -{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, libjack2, alsaLib, pkg-config }: +{ stdenv +, lib +, fetchFromGitHub +, fetchpatch +, cmake +, pkg-config +, alsaSupport ? stdenv.hostPlatform.isLinux +, alsaLib +, jackSupport ? true +, jack +, coremidiSupport ? stdenv.hostPlatform.isDarwin +, CoreMIDI +, CoreAudio +, CoreServices +}: stdenv.mkDerivation rec { version = "4.0.0"; @@ -11,21 +25,45 @@ stdenv.mkDerivation rec { sha256 = "1g31p6a96djlbk9jh5r4pjly3x76lhccva9hrw6xzdma8dsjzgyq"; }; - enableParallelBuilding = true; + patches = [ + # PR #230, fix CMake problems + (fetchpatch { + name = "RtMidi-Fix-JACK_HAS_PORT_RENAME-define.patch"; + url = "https://github.com/thestk/rtmidi/pull/230/commits/768a30a61b60240b66cc2d43bc27a544ff9f1622.patch"; + sha256 = "1sym4f7nb2qyyxfhi1l0xsm2hfh6gddn81y36qvfq4mcs33vvid0"; + }) + (fetchpatch { + name = "RtMidi-Add-prefix-define-for-pkgconfig.patch"; + url = "https://github.com/thestk/rtmidi/pull/230/commits/7a32e23e3f6cb43c0d2d58443ce205d438e76f44.patch"; + sha256 = "06im8mb05wah6bnkadw2gpkhmilxb8p84pxqr50b205cchpq304w"; + }) + ]; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ autoconf automake libtool libjack2 alsaLib ]; - - preConfigure = '' - ./autogen.sh --no-configure - ./configure + postPatch = '' + substituteInPlace rtmidi.pc.in \ + --replace 'Requires:' 'Requires.private:' + substituteInPlace CMakeLists.txt \ + --replace 'PUBLIC_HEADER RtMidi.h' 'PUBLIC_HEADER "RtMidi.h;rtmidi_c.h"' \ + --replace 'PUBLIC_HEADER DESTINATION $''\{CMAKE_INSTALL_INCLUDEDIR}' 'PUBLIC_HEADER DESTINATION $''\{CMAKE_INSTALL_INCLUDEDIR}/rtmidi' ''; - meta = { + nativeBuildInputs = [ cmake pkg-config ]; + + buildInputs = lib.optional alsaSupport alsaLib + ++ lib.optional jackSupport jack + ++ lib.optionals coremidiSupport [ CoreMIDI CoreAudio CoreServices ]; + + cmakeFlags = [ + "-DRTMIDI_API_ALSA=${if alsaSupport then "ON" else "OFF"}" + "-DRTMIDI_API_JACK=${if jackSupport then "ON" else "OFF"}" + "-DRTMIDI_API_CORE=${if coremidiSupport then "ON" else "OFF"}" + ]; + + meta = with lib; { description = "A set of C++ classes that provide a cross platform API for realtime MIDI input/output"; - homepage = "http://www.music.mcgill.ca/~gary/rtmidi/"; - license = lib.licenses.mit; - maintainers = [ lib.maintainers.magnetophon ]; - platforms = with lib.platforms; linux ++ darwin; + homepage = "https://www.music.mcgill.ca/~gary/rtmidi/"; + license = licenses.mit; + maintainers = with maintainers; [ magnetophon ]; + platforms = platforms.unix; }; } |