lol
1{ lib
2, stdenv
3, cmake
4, fetchFromGitHub
5, freetype
6, gtk3-x11
7, mount
8, pcre
9, pkg-config
10, webkitgtk
11, xorg
12, llvmPackages
13, WebKit
14, MetalKit
15, CoreAudioKit
16, simd
17}:
18stdenv.mkDerivation rec {
19 pname = "rnnoise-plugin";
20 version = "1.03";
21
22 src = fetchFromGitHub {
23 owner = "werman";
24 repo = "noise-suppression-for-voice";
25 rev = "v${version}";
26 sha256 = "sha256-1DgrpGYF7G5Zr9vbgtKm/Yv0HSdI7LrFYPSGKYNnNDQ=";
27 };
28
29 nativeBuildInputs = [ cmake pkg-config ];
30
31 patches = lib.optionals stdenv.isDarwin [
32 # Ubsan seems to be broken on aarch64-darwin, it produces linker errors similar to https://github.com/NixOS/nixpkgs/issues/140751
33 ./disable-ubsan.patch
34 ];
35
36 buildInputs =
37 [
38 freetype
39 gtk3-x11
40 pcre
41 xorg.libX11
42 xorg.libXrandr
43 ] ++ lib.optionals stdenv.isLinux [
44 webkitgtk
45 ] ++ lib.optionals stdenv.isDarwin [
46 WebKit
47 MetalKit
48 CoreAudioKit
49 simd
50 ];
51
52 meta = with lib; {
53 description = "A real-time noise suppression plugin for voice based on Xiph's RNNoise";
54 homepage = "https://github.com/werman/noise-suppression-for-voice";
55 license = licenses.gpl3;
56 platforms = platforms.all;
57 maintainers = with maintainers; [ panaeon henrikolsson sciencentistguy ];
58 };
59}