tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
switchaudio-osx: init at 1.2.2
Sergei Volkov
1 year ago
1af4af87
3a9f2af3
+72
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
sw
switchaudio-osx
001-macos-legacy-support.patch
package.nix
+25
pkgs/by-name/sw/switchaudio-osx/001-macos-legacy-support.patch
···
1
1
+
From 02803f510bae37eac88b0168ff887bdf7d71a7f0 Mon Sep 17 00:00:00 2001
2
2
+
From: James Woglom <j@wogloms.net>
3
3
+
Date: Wed, 1 May 2024 00:36:14 -0400
4
4
+
Subject: [PATCH] Fix build when run on pre-macOS Monterey
5
5
+
6
6
+
---
7
7
+
audio_switch.c | 4 ++++
8
8
+
1 file changed, 4 insertions(+)
9
9
+
10
10
+
diff --git a/audio_switch.c b/audio_switch.c
11
11
+
index 814edce..a064c3e 100644
12
12
+
--- a/audio_switch.c
13
13
+
+++ b/audio_switch.c
14
14
+
@@ -715,7 +715,11 @@ OSStatus setMute(ASDeviceType typeRequested, ASMuteType muteRequested) {
15
15
+
AudioObjectPropertyAddress propertyAddress = {
16
16
+
.mSelector = kAudioDevicePropertyMute,
17
17
+
.mScope = scope,
18
18
+
+ #ifndef MAC_OS_VERSION_12_0
19
19
+
+ .mElement = kAudioObjectPropertyElementMaster,
20
20
+
+ #else
21
21
+
.mElement = kAudioObjectPropertyElementMain,
22
22
+
+ #endif
23
23
+
};
24
24
+
25
25
+
UInt32 muted = (UInt32)muteRequested;
+47
pkgs/by-name/sw/switchaudio-osx/package.nix
···
1
1
+
{
2
2
+
lib,
3
3
+
stdenv,
4
4
+
fetchFromGitHub,
5
5
+
xcodebuild,
6
6
+
xcbuildHook,
7
7
+
}:
8
8
+
9
9
+
stdenv.mkDerivation rec {
10
10
+
pname = "switchaudio-osx";
11
11
+
version = "1.2.2";
12
12
+
13
13
+
src = fetchFromGitHub {
14
14
+
owner = "deweller";
15
15
+
repo = "switchaudio-osx";
16
16
+
tag = version;
17
17
+
hash = "sha256-AZJn5kHK/al94ONfIHcG+W0jyMfgdJkIngN+PVj+I44=";
18
18
+
};
19
19
+
20
20
+
buildInputs = [ xcodebuild ];
21
21
+
22
22
+
nativeBuildInputs = [ xcbuildHook ];
23
23
+
24
24
+
patches = [
25
25
+
# Patch to fix running on earlier version of macOS
26
26
+
# https://github.com/deweller/switchaudio-osx/pull/65
27
27
+
./001-macos-legacy-support.patch
28
28
+
];
29
29
+
30
30
+
installPhase = ''
31
31
+
runHook preInstall
32
32
+
33
33
+
# for some reason binary is located in Products/ rather than in build/
34
34
+
install -Dm755 Products/Release/SwitchAudioSource $out/bin/SwitchAudioSource
35
35
+
36
36
+
runHook postInstall
37
37
+
'';
38
38
+
39
39
+
meta = {
40
40
+
description = "Command-line utility to manage audio input/output devices on macOS";
41
41
+
homepage = "https://github.com/deweller/switchaudio-osx";
42
42
+
mainProgram = "SwitchAudioSource";
43
43
+
license = lib.licenses.mit;
44
44
+
maintainers = with lib.maintainers; [ taranarmo ];
45
45
+
platforms = lib.platforms.darwin;
46
46
+
};
47
47
+
}