@@ -1,42 +1,35 @@
1−{ lib, buildGoModule, fetchFromGitHub, rnnoise-plugin }:
1+{ lib, buildGoModule, fetchFromGitHub, copyDesktopItems }:
22
33buildGoModule rec {
44 pname = "NoiseTorch";
5− version = "0.10.1";
5+ version = "0.11.3";
66
77 src = fetchFromGitHub {
88 owner = "lawl";
99 repo = "NoiseTorch";
1010 rev = version;
11− sha256 = "1a4g112h83m55pga8kq2a1wzxpycj59v4bygyjfyi1s09q1y97qg";
11+ sha256 = "0rjs6hbi7dvd179lzjmvqy4rv4pbc9amgzb8jfky4yc0zh8xf5z5";
1212 };
1313
14− patches = [
15− # Get version from environment instead of git tags
16− ./version.patch
17− ];
18−
1914 vendorSha256 = null;
2015
2116 doCheck = false;
2217
23− subPackages = [ "." ];
18+ ldflags = [ "-X main.version=${version}" "-X main.distribution=nix" ];
2419
25− buildInputs = [ rnnoise-plugin ];
20+ subPackages = [ "." ];
2621
27− postPatch = "substituteInPlace main.go --replace 'librnnoise_ladspa/bin/ladspa/librnnoise_ladspa.so' '$RNNOISE_LADSPA_PLUGIN'";
22+ nativeBuildInputs = [ copyDesktopItems ];
2823
2924 preBuild = ''
30− export RNNOISE_LADSPA_PLUGIN="${rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so";
31− go generate;
25+ make -C c/ladspa/
26+ go generate
3227 rm ./scripts/*
3328 '';
3429
3530 postInstall = ''
36− mkdir -p $out/share/icons/hicolor/256x256/apps/
37− cp assets/icon/noisetorch.png $out/share/icons/hicolor/256x256/apps/
38− mkdir -p $out/share/applications/
39− cp assets/noisetorch.desktop $out/share/applications/
31+ install -D ./assets/icon/noisetorch.png $out/share/icons/hicolor/256x256/apps/noisetorch.png
32+ copyDesktopItems assets/noisetorch.desktop $out/share/applications/
4033 '';
4134
4235 meta = with lib; {
@@ -44,6 +37,6 @@ buildGoModule rec {
4437 homepage = "https://github.com/lawl/NoiseTorch";
4538 license = licenses.gpl3Plus;
4639 platforms = platforms.linux;
47− maintainers = with maintainers; [ panaeon ];
40+ maintainers = with maintainers; [ panaeon legendofmiracles ];
4841 };
4942}