blackhole: 0.6.1 -> 0.7.1

Add kNumber_Of_Channels preprocessor definition so the driver
uses the correct number of audio channels matching the channel
parameter, instead of always defaulting to 2.

Changelog: https://github.com/ExistentialAudio/BlackHole/releases/tag/v0.7.1
Assisted-by: opencode/deepseek-v4-pro
This commit is contained in:
Tommy Chiang
2026-07-14 04:23:21 +08:00
parent 8a46348954
commit 8ebf5dad52

View File

@@ -7,15 +7,18 @@
nix-update-script,
channel ? "256ch",
}:
let
numChannels = lib.toIntBase10 (lib.removeSuffix "ch" channel);
in
stdenv.mkDerivation (finalAttrs: {
pname = "blackhole";
version = "0.6.1";
version = "0.7.1";
src = fetchFromGitHub {
owner = "existentialaudio";
repo = "BlackHole";
tag = "v${finalAttrs.version}";
hash = "sha256-jFKi5LJdTOMFa1mErH6WsjgCtLCKzwpgn2+T3Fp9MtQ=";
hash = "sha256-kuIaoXA0K7SFPXKFHqcilTbf1zn9Ol3JYVpnkFuQEZg=";
};
nativeBuildInputs = [
@@ -31,14 +34,14 @@ stdenv.mkDerivation (finalAttrs: {
"-configuration"
"Release"
"PRODUCT_BUNDLE_IDENTIFIER=${finalAttrs.bundleId}"
"GCC_PREPROCESSOR_DEFINITIONS=$GCC_PREPROCESSOR_DEFINITIONS kDriver_Name=\\\"blackhole${channel}\\\" kPlugIn_BundleID=\\\"${finalAttrs.bundleId}\\\" kPlugIn_Icon=\\\"BlackHole.icns\\\""
"GCC_PREPROCESSOR_DEFINITIONS=$GCC_PREPROCESSOR_DEFINITIONS kNumber_Of_Channels=${toString numChannels} kDriver_Name=\\\"BlackHole\\\" kPlugIn_BundleID=\\\"${finalAttrs.bundleId}\\\" kPlugIn_Icon=\\\"BlackHole.icns\\\""
];
installPhase = ''
runHook preInstall
mkdir -p $out/Library/Audio/Plug-Ins/HAL
mv Products/Release/BlackHole.driver $out/Library/Audio/Plug-Ins/HAL/Blackhole${channel}.driver
mv Products/Release/BlackHole.driver $out/Library/Audio/Plug-Ins/HAL/BlackHole${channel}.driver
runHook postInstall
'';