rtaudio_6: Modernise

Some (but not all) changes:

- finalAttrs
- strictDeps
- SRI hash
- lib.cmakeBool flags
- meta changelog & pkgConfigModules
- pkg-config test
This commit is contained in:
OPNA2608 2024-04-29 15:58:35 +02:00
parent ae98702f42
commit 15392f7b82
2 changed files with 40 additions and 26 deletions

View file

@ -2,6 +2,7 @@
, lib
, config
, fetchFromGitHub
, testers
, cmake
, pkg-config
, alsaSupport ? stdenv.hostPlatform.isLinux
@ -9,41 +10,59 @@
, pulseaudioSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux
, libpulseaudio
, jackSupport ? true
, jack
, libjack2
, coreaudioSupport ? stdenv.hostPlatform.isDarwin
, CoreAudio
, darwin
, validatePkgConfig
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "rtaudio";
version = "6.0.1";
src = fetchFromGitHub {
owner = "thestk";
repo = "rtaudio";
rev = version;
sha256 = "11llxdg62gs6l2zc473s9zfb8jczflyq1dd0k0wfcmvyg5p33jq1";
rev = "refs/tags/${finalAttrs.version}";
hash = "sha256-Acsxbnl+V+Y4mKC1gD11n0m03E96HMK+oEY/YV7rlIY=";
};
nativeBuildInputs = [ cmake pkg-config ];
strictDeps = true;
buildInputs = lib.optional alsaSupport alsa-lib
++ 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"}"
nativeBuildInputs = [
cmake
pkg-config
validatePkgConfig
];
meta = with lib; {
buildInputs = lib.optionals alsaSupport [
alsa-lib
] ++ lib.optionals pulseaudioSupport [
libpulseaudio
] ++ lib.optionals jackSupport [
libjack2
] ++ lib.optionals coreaudioSupport [
darwin.apple_sdk.frameworks.CoreAudio
];
cmakeFlags = [
(lib.cmakeBool "RTAUDIO_API_ALSA" alsaSupport)
(lib.cmakeBool "RTAUDIO_API_PULSE" pulseaudioSupport)
(lib.cmakeBool "RTAUDIO_API_JACK" jackSupport)
(lib.cmakeBool "RTAUDIO_API_CORE" coreaudioSupport)
];
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = {
description = "A set of C++ classes that provide a cross platform API for realtime audio input/output";
homepage = "https://www.music.mcgill.ca/~gary/rtaudio/";
license = licenses.mit;
maintainers = with maintainers; [ magnetophon ];
platforms = platforms.unix;
changelog = "https://github.com/thestk/rtaudio/releases/tag/${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ magnetophon ];
platforms = lib.platforms.unix;
pkgConfigModules = [
"rtaudio"
];
};
}
})

View file

@ -12289,11 +12289,6 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) CoreAudio;
};
rtaudio_6 = callPackage ../by-name/rt/rtaudio_6/package.nix {
jack = libjack2;
inherit (darwin.apple_sdk.frameworks) CoreAudio;
};
rtmidi = callPackage ../development/libraries/audio/rtmidi {
jack = libjack2;
inherit (darwin.apple_sdk.frameworks) CoreMIDI CoreAudio CoreServices;