about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/parrot/default.nix
blob: 04153c54d9baa66ae4d90350ed7afe5b971a59cf (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
42
43
44
45
46
47
48
49
50
{ lib
, rustPlatform
, fetchFromGitHub
, cmake
, ffmpeg
, libopus
, makeBinaryWrapper
, nix-update-script
, openssl
, pkg-config
, stdenv
, yt-dlp
, Security
}:
let
  version = "1.6.0";
in
rustPlatform.buildRustPackage {
  pname = "parrot";
  inherit version;

  src = fetchFromGitHub {
    owner = "aquelemiguel";
    repo = "parrot";
    rev = "v${version}";
    hash = "sha256-f6YAdsq2ecsOCvk+A8wsUu+ywQnW//gCAkVLF0HTn8c=";
  };

  cargoHash = "sha256-e4NHgwoNkZ0//rugHrP0gU3pntaMeBJsV/YSzJfD8r4=";

  nativeBuildInputs = [ cmake makeBinaryWrapper pkg-config ];

  buildInputs = [ libopus openssl ]
    ++ lib.optionals stdenv.isDarwin [ Security ];

  postInstall = ''
    wrapProgram $out/bin/parrot \
      --prefix PATH : ${lib.makeBinPath [ ffmpeg yt-dlp ]}
  '';

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "A hassle-free Discord music bot";
    homepage = "https://github.com/aquelemiguel/parrot";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ gerg-l ];
    mainProgram = "parrot";
  };
}