about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/pulseaudio-ctl/default.nix
blob: 1b21aa9d4163463dfdb99b0a698c00b602081579 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ lib, stdenv, fetchFromGitHub, makeWrapper
, bc, dbus, gawk, gnused, libnotify, pulseaudio }:

let
  path = lib.makeBinPath [ bc dbus gawk gnused libnotify pulseaudio ];
  pname = "pulseaudio-ctl";

in stdenv.mkDerivation rec {
  name = "${pname}-${version}";
  version = "1.70";

  src = fetchFromGitHub {
    owner = "graysky2";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-ZB1jrr31PF7+vNB+Xo5CATJmYbuDAPwewpDxCVnAowY=";
  };

  postPatch = ''
    substituteInPlace Makefile \
      --replace /usr $out

    substituteInPlace common/${pname}.in \
      --replace '$0' ${pname}
  '';

  nativeBuildInputs = [ makeWrapper ];

  postFixup = ''
    wrapProgram $out/bin/${pname} \
      --prefix PATH : ${path}
  '';

  meta = with lib; {
    description = "Control pulseaudio volume from the shell or mapped to keyboard shortcuts. No need for alsa-utils";
    homepage = "https://bbs.archlinux.org/viewtopic.php?id=124513";
    license = licenses.mit;
    maintainers = with maintainers; [ peterhoeg ];
    platforms = platforms.linux;
  };
}