git.iko.soy/typeable/nixpkgs
on master help sign in
noisetorch: 0.10.1 -> 0.11.3
commit507d17e2c801d1ce66bddc2c9cfc01670a3176cb authorlegendofmiracles <legendofmiracles@protonmail.com> dateSat 19 Jun 2021, 05:08 (5 years ago) parent3e7ec42
2 files changed+11−55
pkgs/applications/audio/noisetorch/default.nix+11−18 pkgs/applications/audio/noisetorch/version.patch−37
pkgs/applications/audio/noisetorch/default.nix+11−18
@@ -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}
pkgs/applications/audio/noisetorch/version.patchdeleted−37
@@ -1,37 +0,0 @@
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− }