summary refs log tree commit diff
path: root/pkgs/applications/radio/dsd/default.nix
blob: e885270370ecab5a8930b57ebfa9e019c5e80d38 (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
{ lib, stdenv, fetchFromGitHub, cmake
, mbelib, libsndfile, itpp
, portaudioSupport ? true, portaudio ? null
}:

assert portaudioSupport -> portaudio != null;

stdenv.mkDerivation rec {
  pname = "dsd";
  version = "2022-03-14";

  src = fetchFromGitHub {
    owner = "szechyjs";
    repo = "dsd";
    rev = "59423fa46be8b41ef0bd2f3d2b45590600be29f0";
    sha256 = "128gvgkanvh4n5bjnzkfk419hf5fdbad94fb8d8lv67h94vfchyd";
  };

  nativeBuildInputs = [ cmake ];
  buildInputs = [
    mbelib libsndfile itpp
  ] ++ lib.optionals portaudioSupport [ portaudio ];

  doCheck = true;
  preCheck = ''
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD
    export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD
  '';

  meta = with lib; {
    description = "Digital Speech Decoder";
    longDescription = ''
      DSD is able to decode several digital voice formats from discriminator
      tap audio and synthesize the decoded speech. Speech synthesis requires
      mbelib, which is a separate package.
    '';
    homepage = "https://github.com/szechyjs/dsd";
    license = licenses.gpl2;
    platforms = platforms.unix;
    maintainers = with maintainers; [ andrew-d ];
  };
}