streamlink: 7.1.1 -> 7.1.2 (#373269)
[NixPkgs.git] / pkgs / by-name / sw / switchaudio-osx / package.nix
blobe359da554d7b09a100763e18b43bfd1fe54eed48
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   xcodebuild,
6   xcbuildHook,
7 }:
9 stdenv.mkDerivation rec {
10   pname = "switchaudio-osx";
11   version = "1.2.2";
13   src = fetchFromGitHub {
14     owner = "deweller";
15     repo = "switchaudio-osx";
16     tag = version;
17     hash = "sha256-AZJn5kHK/al94ONfIHcG+W0jyMfgdJkIngN+PVj+I44=";
18   };
20   buildInputs = [ xcodebuild ];
22   nativeBuildInputs = [ xcbuildHook ];
24   patches = [
25     # Patch to fix running on earlier version of macOS
26     # https://github.com/deweller/switchaudio-osx/pull/65
27     ./001-macos-legacy-support.patch
28   ];
30   installPhase = ''
31     runHook preInstall
33     # for some reason binary is located in Products/ rather than in build/
34     install -Dm755 Products/Release/SwitchAudioSource $out/bin/SwitchAudioSource
36     runHook postInstall
37   '';
39   meta = {
40     description = "Command-line utility to manage audio input/output devices on macOS";
41     homepage = "https://github.com/deweller/switchaudio-osx";
42     mainProgram = "SwitchAudioSource";
43     license = lib.licenses.mit;
44     maintainers = with lib.maintainers; [ taranarmo ];
45     platforms = lib.platforms.darwin;
46   };