btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / no / noisetorch / package.nix
blob5f3dfc7bf8fd97f8eb001f61f3a0ca665ac83c04
1 { lib, buildGoModule, fetchFromGitHub }:
3 buildGoModule rec {
4   pname = "NoiseTorch";
5   version = "0.12.2";
7   src = fetchFromGitHub {
8     owner = "noisetorch";
9     repo = "NoiseTorch";
10     rev = "v${version}";
11     fetchSubmodules = true;
12     hash = "sha256-gOPSMPH99Upi/30OnAdwSb7SaMV0i/uHB051cclfz6A=";
13   };
15   vendorHash = null;
17   doCheck = false;
19   ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.distribution=nixpkgs" ];
21   subPackages = [ "." ];
23   preBuild = ''
24     make -C c/ladspa/
25     go generate
26     rm  ./scripts/*
27   '';
29   postInstall = ''
30     install -D ./assets/icon/noisetorch.png $out/share/icons/hicolor/256x256/apps/noisetorch.png
31     install -Dm444 ./assets/noisetorch.desktop $out/share/applications/noisetorch.desktop
32   '';
34   meta = with lib; {
35     description = "Virtual microphone device with noise supression for PulseAudio";
36     homepage = "https://github.com/noisetorch/NoiseTorch";
37     license = licenses.gpl3Plus;
38     platforms = platforms.linux;
39     maintainers = with maintainers; [ panaeon lom ];
40     mainProgram = "noisetorch";
41   };