git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #111621 from OPNA2608/refactor/rtaudio_rtmidi/21.03
commit7750e6a2c95dd157d4f75a6af00923910870dd5e authorSandro <sandro.jaeckel@gmail.com> dateWed 3 Feb 2021, 18:13 (6 years ago) parent5068ddf6c22ff0
4 files changed+102−30
pkgs/development/libraries/audio/rtaudio/default.nix+43−10 pkgs/development/libraries/audio/rtaudio/rtaudio-pkgconfig.patch−5 pkgs/development/libraries/audio/rtmidi/default.nix+51−13 pkgs/top-level/all-packages.nix+8−2
pkgs/development/libraries/audio/rtaudio/default.nix+43−10
@@ -1,4 +1,19 @@
1−{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, libjack2, alsaLib, pulseaudio, rtmidi }:
1+{ stdenv
2+, lib
3+, config
4+, fetchFromGitHub
5+, fetchpatch
6+, cmake
7+, pkg-config
8+, alsaSupport ? stdenv.hostPlatform.isLinux
9+, alsaLib
10+, pulseaudioSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux
11+, libpulseaudio
12+, jackSupport ? true
13+, jack
14+, coreaudioSupport ? stdenv.hostPlatform.isDarwin
15+, CoreAudio
16+}:
217
318stdenv.mkDerivation rec {
419 version = "5.1.0";
@@ -11,22 +26,40 @@ stdenv.mkDerivation rec {
1126 sha256 = "1pglnjz907ajlhnlnig3p0sx7hdkpggr8ss7b3wzf1lykzgv9l52";
1227 };
1328
14− patches = [ ./rtaudio-pkgconfig.patch ];
29+ patches = [
30+ # Fixes missing headers & install location
31+ # Drop with version > 5.1.0
32+ (fetchpatch {
33+ name = "RtAudio-Adjust-CMake-public-header-installs-to-match-autotools.patch";
34+ url = "https://github.com/thestk/rtaudio/commit/4273cf7572b8f51b5996cf6b42e3699cc6b165da.patch";
35+ sha256 = "1p0idll0xsfk3jwjg83jkxkaf20gk0wqa7l982ni389rn6i4n26p";
36+ })
37+ ];
1538
16− enableParallelBuilding = true;
39+ postPatch = ''
40+ substituteInPlace rtaudio.pc.in \
41+ --replace 'Requires:' 'Requires.private:'
42+ '';
1743
18− buildInputs = [ autoconf automake libtool libjack2 alsaLib pulseaudio rtmidi ];
44+ nativeBuildInputs = [ cmake pkg-config ];
1945
20− preConfigure = ''
21− ./autogen.sh --no-configure
22− ./configure
23− '';
46+ buildInputs = lib.optional alsaSupport alsaLib
47+ ++ lib.optional pulseaudioSupport libpulseaudio
48+ ++ lib.optional jackSupport jack
49+ ++ lib.optional coreaudioSupport CoreAudio;
50+
51+ cmakeFlags = [
52+ "-DRTAUDIO_API_ALSA=${if alsaSupport then "ON" else "OFF"}"
53+ "-DRTAUDIO_API_PULSE=${if pulseaudioSupport then "ON" else "OFF"}"
54+ "-DRTAUDIO_API_JACK=${if jackSupport then "ON" else "OFF"}"
55+ "-DRTAUDIO_API_CORE=${if coreaudioSupport then "ON" else "OFF"}"
56+ ];
2457
2558 meta = with lib; {
2659 description = "A set of C++ classes that provide a cross platform API for realtime audio input/output";
27− homepage = "http://www.music.mcgill.ca/~gary/rtaudio/";
60+ homepage = "https://www.music.mcgill.ca/~gary/rtaudio/";
2861 license = licenses.mit;
29− maintainers = [ maintainers.magnetophon ];
62+ maintainers = with maintainers; [ magnetophon ];
3063 platforms = platforms.unix;
3164 };
3265}
pkgs/development/libraries/audio/rtaudio/rtaudio-pkgconfig.patchdeleted−5
@@ -1,5 +0,0 @@
1−--- a/rtaudio.pc.in
2−+++ b/rtaudio.pc.in
3−@@ -9 +9 @@ Version: @PACKAGE_VERSION@
4−-Requires: @req@
5−+Requires.private: @req@
pkgs/development/libraries/audio/rtmidi/default.nix+51−13
@@ -1,4 +1,18 @@
1−{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, libjack2, alsaLib, pkg-config }:
1+{ stdenv
2+, lib
3+, fetchFromGitHub
4+, fetchpatch
5+, cmake
6+, pkg-config
7+, alsaSupport ? stdenv.hostPlatform.isLinux
8+, alsaLib
9+, jackSupport ? true
10+, jack
11+, coremidiSupport ? stdenv.hostPlatform.isDarwin
12+, CoreMIDI
13+, CoreAudio
14+, CoreServices
15+}:
216
317stdenv.mkDerivation rec {
418 version = "4.0.0";
@@ -11,21 +25,45 @@ stdenv.mkDerivation rec {
1125 sha256 = "1g31p6a96djlbk9jh5r4pjly3x76lhccva9hrw6xzdma8dsjzgyq";
1226 };
1327
14− enableParallelBuilding = true;
28+ patches = [
29+ # PR #230, fix CMake problems
30+ (fetchpatch {
31+ name = "RtMidi-Fix-JACK_HAS_PORT_RENAME-define.patch";
32+ url = "https://github.com/thestk/rtmidi/pull/230/commits/768a30a61b60240b66cc2d43bc27a544ff9f1622.patch";
33+ sha256 = "1sym4f7nb2qyyxfhi1l0xsm2hfh6gddn81y36qvfq4mcs33vvid0";
34+ })
35+ (fetchpatch {
36+ name = "RtMidi-Add-prefix-define-for-pkgconfig.patch";
37+ url = "https://github.com/thestk/rtmidi/pull/230/commits/7a32e23e3f6cb43c0d2d58443ce205d438e76f44.patch";
38+ sha256 = "06im8mb05wah6bnkadw2gpkhmilxb8p84pxqr50b205cchpq304w";
39+ })
40+ ];
1541
16− nativeBuildInputs = [ pkg-config ];
17− buildInputs = [ autoconf automake libtool libjack2 alsaLib ];
18−
19− preConfigure = ''
20− ./autogen.sh --no-configure
21− ./configure
42+ postPatch = ''
43+ substituteInPlace rtmidi.pc.in \
44+ --replace 'Requires:' 'Requires.private:'
45+ substituteInPlace CMakeLists.txt \
46+ --replace 'PUBLIC_HEADER RtMidi.h' 'PUBLIC_HEADER "RtMidi.h;rtmidi_c.h"' \
47+ --replace 'PUBLIC_HEADER DESTINATION $''\{CMAKE_INSTALL_INCLUDEDIR}' 'PUBLIC_HEADER DESTINATION $''\{CMAKE_INSTALL_INCLUDEDIR}/rtmidi'
2248 '';
2349
24− meta = {
50+ nativeBuildInputs = [ cmake pkg-config ];
51+
52+ buildInputs = lib.optional alsaSupport alsaLib
53+ ++ lib.optional jackSupport jack
54+ ++ lib.optionals coremidiSupport [ CoreMIDI CoreAudio CoreServices ];
55+
56+ cmakeFlags = [
57+ "-DRTMIDI_API_ALSA=${if alsaSupport then "ON" else "OFF"}"
58+ "-DRTMIDI_API_JACK=${if jackSupport then "ON" else "OFF"}"
59+ "-DRTMIDI_API_CORE=${if coremidiSupport then "ON" else "OFF"}"
60+ ];
61+
62+ meta = with lib; {
2563 description = "A set of C++ classes that provide a cross platform API for realtime MIDI input/output";
26− homepage = "http://www.music.mcgill.ca/~gary/rtmidi/";
27− license = lib.licenses.mit;
28− maintainers = [ lib.maintainers.magnetophon ];
29− platforms = with lib.platforms; linux ++ darwin;
64+ homepage = "https://www.music.mcgill.ca/~gary/rtmidi/";
65+ license = licenses.mit;
66+ maintainers = with maintainers; [ magnetophon ];
67+ platforms = platforms.unix;
3068 };
3169}
pkgs/top-level/all-packages.nix+8−2
@@ -7295,9 +7295,15 @@ in
72957295
72967296 rocket = libsForQt5.callPackage ../tools/graphics/rocket { };
72977297
7298− rtaudio = callPackage ../development/libraries/audio/rtaudio { };
7298+ rtaudio = callPackage ../development/libraries/audio/rtaudio {
7299+ jack = libjack2;
7300+ inherit (darwin.apple_sdk.frameworks) CoreAudio;
7301+ };
72997302
7300− rtmidi = callPackage ../development/libraries/audio/rtmidi { };
7303+ rtmidi = callPackage ../development/libraries/audio/rtmidi {
7304+ jack = libjack2;
7305+ inherit (darwin.apple_sdk.frameworks) CoreMIDI CoreAudio CoreServices;
7306+ };
73017307
73027308 openmpi = callPackage ../development/libraries/openmpi { };
73037309