Merge pull request #127457 from legendofmiracles/noisetorch/update

noisetorch: 0.10.1 -> 0.11.3

authored by

Sandro and committed by
GitHub
2f44c029 b8334f30

+11 -55
+11 -18
pkgs/applications/audio/noisetorch/default.nix
··· 1 - { lib, buildGoModule, fetchFromGitHub, rnnoise-plugin }: 1 + { lib, buildGoModule, fetchFromGitHub, copyDesktopItems }: 2 2 3 3 buildGoModule rec { 4 4 pname = "NoiseTorch"; 5 - version = "0.10.1"; 5 + version = "0.11.3"; 6 6 7 7 src = fetchFromGitHub { 8 8 owner = "lawl"; 9 9 repo = "NoiseTorch"; 10 10 rev = version; 11 - sha256 = "1a4g112h83m55pga8kq2a1wzxpycj59v4bygyjfyi1s09q1y97qg"; 11 + sha256 = "0rjs6hbi7dvd179lzjmvqy4rv4pbc9amgzb8jfky4yc0zh8xf5z5"; 12 12 }; 13 13 14 - patches = [ 15 - # Get version from environment instead of git tags 16 - ./version.patch 17 - ]; 18 - 19 14 vendorSha256 = null; 20 15 21 16 doCheck = false; 22 17 18 + ldflags = [ "-X main.version=${version}" "-X main.distribution=nix" ]; 19 + 23 20 subPackages = [ "." ]; 24 21 25 - buildInputs = [ rnnoise-plugin ]; 26 - 27 - postPatch = "substituteInPlace main.go --replace 'librnnoise_ladspa/bin/ladspa/librnnoise_ladspa.so' '$RNNOISE_LADSPA_PLUGIN'"; 22 + nativeBuildInputs = [ copyDesktopItems ]; 28 23 29 24 preBuild = '' 30 - export RNNOISE_LADSPA_PLUGIN="${rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so"; 31 - go generate; 25 + make -C c/ladspa/ 26 + go generate 32 27 rm ./scripts/* 33 28 ''; 34 29 35 30 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/ 40 33 ''; 41 34 42 35 meta = with lib; { ··· 44 37 homepage = "https://github.com/lawl/NoiseTorch"; 45 38 license = licenses.gpl3Plus; 46 39 platforms = platforms.linux; 47 - maintainers = with maintainers; [ panaeon ]; 40 + maintainers = with maintainers; [ panaeon legendofmiracles ]; 48 41 }; 49 42 }
-37
pkgs/applications/audio/noisetorch/version.patch
··· 1 - diff --git a/scripts/embedversion.go b/scripts/embedversion.go 2 - index ce0a756..60e7a5e 100644 3 - --- a/scripts/embedversion.go 4 - +++ b/scripts/embedversion.go 5 - @@ -1,24 +1,18 @@ 6 - package main 7 - 8 - import ( 9 - - "os" 10 - - "os/exec" 11 - - "strings" 12 - + "os" 13 - + "strings" 14 - ) 15 - 16 - func main() { 17 - - cmd := exec.Command("git", "describe", "--tags") 18 - - ret, err := cmd.Output() 19 - 20 - - if err != nil { 21 - - panic("Couldn't read git tags to embed version number") 22 - - } 23 - - version := strings.TrimSpace(string(ret)) 24 - + version := strings.TrimSpace(string(os.Getenv("version"))) 25 - 26 - - out, _ := os.Create("version.go") 27 - - defer out.Close() 28 - + out, _ := os.Create("version.go") 29 - + defer out.Close() 30 - 31 - - out.Write([]byte("package main\n\n//THIS FILE IS AUTOMATICALLY GENERATED BY `go generate` DO NOT EDIT!\n\nvar version=\"")) 32 - - out.Write([]byte(version)) 33 - - out.Write([]byte("\"\n")) 34 - + out.Write([]byte("package main\n\n//THIS FILE IS AUTOMATICALLY GENERATED BY `go generate` DO NOT EDIT!\n\nvar version=\"")) 35 - + out.Write([]byte(version)) 36 - + out.Write([]byte("\"\n")) 37 - }