summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/sb/sblast/package.nix
blob: fa0aa017835912e5600e77865b694131d60b7d79 (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
  buildGoModule,
  fetchFromGitHub,
  ffmpeg,
  lib,
  makeBinaryWrapper,
  nix-update-script,
  pulseaudio,
  testers,
}:
let
  self = buildGoModule rec {
    pname = "sblast";
    version = "0.7.2";

    src = fetchFromGitHub {
      owner = "ugjka";
      repo = "sblast";
      rev = "v${version}";
      hash = "sha256-ICSnLfzBoaax3YKa4LiTBQ4zxgDxttxcN4YVLApFH24=";
    };

    vendorHash = "sha256-yPwLilMiDR1aSeuk8AEmuYPsHPRWqiByGLwgkdI5t+s=";

    nativeBuildInputs = [
      makeBinaryWrapper
    ];

    postInstall = ''
      wrapProgram $out/bin/sblast \
          --suffix PATH : ${
            lib.makeBinPath [
              ffmpeg
              pulseaudio
            ]
          }
    '';

    # build only the toplevel package, and not `makerel`
    subPackages = ".";

    passthru = {
      updateScript = nix-update-script { };
      tests.version = testers.testVersion {
        package = self;
        version = "v${version}";
      };
    };

    meta = {
      description = "Blast your Linux audio to DLNA receivers";
      homepage = "https://github.com/ugjka/sblast";
      license = lib.licenses.mit;
      mainProgram = "sblast";
      maintainers = with lib.maintainers; [ colinsane ];
      platforms = lib.platforms.linux;
    };
  };
in
self