about summary refs log tree commit diff
path: root/pkgs/development/libraries/rnnoise-plugin/default.nix
blob: d41459e25eadb6523687140a2e8d237cb03ee9ab (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
51
52
53
54
55
56
57
{ lib
, stdenv
, cmake
, fetchFromGitHub
, freetype
, gtk3-x11
, pcre
, pkg-config
, webkitgtk
, xorg
, WebKit
, MetalKit
, CoreAudioKit
, simd
}:
stdenv.mkDerivation rec {
  pname = "rnnoise-plugin";
  version = "1.10";

  src = fetchFromGitHub {
    owner = "werman";
    repo = "noise-suppression-for-voice";
    rev = "v${version}";
    sha256 = "sha256-sfwHd5Fl2DIoGuPDjELrPp5KpApZJKzQikCJmCzhtY8=";
  };

  nativeBuildInputs = [ cmake pkg-config ];

  patches = lib.optionals stdenv.isDarwin [
    # Ubsan seems to be broken on aarch64-darwin, it produces linker errors similar to https://github.com/NixOS/nixpkgs/issues/140751
    ./disable-ubsan.patch
  ];

  buildInputs =
    [
      freetype
      gtk3-x11
      pcre
      xorg.libX11
      xorg.libXrandr
    ] ++ lib.optionals stdenv.isLinux [
      webkitgtk
    ] ++ lib.optionals stdenv.isDarwin [
      WebKit
      MetalKit
      CoreAudioKit
      simd
    ];

  meta = with lib; {
    description = "Real-time noise suppression plugin for voice based on Xiph's RNNoise";
    homepage = "https://github.com/werman/noise-suppression-for-voice";
    license = licenses.gpl3;
    platforms = platforms.all;
    maintainers = with maintainers; [ panaeon henrikolsson sciencentistguy ];
  };
}