Merge pull request #127457 from legendofmiracles/noisetorch/update

noisetorch: 0.10.1 -> 0.11.3
This commit is contained in:
Sandro 2021-06-20 18:19:41 +02:00 committed by GitHub
commit 2f44c029ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 55 deletions

View file

@ -1,42 +1,35 @@
{ lib, buildGoModule, fetchFromGitHub, rnnoise-plugin }: { lib, buildGoModule, fetchFromGitHub, copyDesktopItems }:
buildGoModule rec { buildGoModule rec {
pname = "NoiseTorch"; pname = "NoiseTorch";
version = "0.10.1"; version = "0.11.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "lawl"; owner = "lawl";
repo = "NoiseTorch"; repo = "NoiseTorch";
rev = version; rev = version;
sha256 = "1a4g112h83m55pga8kq2a1wzxpycj59v4bygyjfyi1s09q1y97qg"; sha256 = "0rjs6hbi7dvd179lzjmvqy4rv4pbc9amgzb8jfky4yc0zh8xf5z5";
}; };
patches = [
# Get version from environment instead of git tags
./version.patch
];
vendorSha256 = null; vendorSha256 = null;
doCheck = false; doCheck = false;
ldflags = [ "-X main.version=${version}" "-X main.distribution=nix" ];
subPackages = [ "." ]; subPackages = [ "." ];
buildInputs = [ rnnoise-plugin ]; nativeBuildInputs = [ copyDesktopItems ];
postPatch = "substituteInPlace main.go --replace 'librnnoise_ladspa/bin/ladspa/librnnoise_ladspa.so' '$RNNOISE_LADSPA_PLUGIN'";
preBuild = '' preBuild = ''
export RNNOISE_LADSPA_PLUGIN="${rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so"; make -C c/ladspa/
go generate; go generate
rm ./scripts/* rm ./scripts/*
''; '';
postInstall = '' postInstall = ''
mkdir -p $out/share/icons/hicolor/256x256/apps/ install -D ./assets/icon/noisetorch.png $out/share/icons/hicolor/256x256/apps/noisetorch.png
cp assets/icon/noisetorch.png $out/share/icons/hicolor/256x256/apps/ copyDesktopItems assets/noisetorch.desktop $out/share/applications/
mkdir -p $out/share/applications/
cp assets/noisetorch.desktop $out/share/applications/
''; '';
meta = with lib; { meta = with lib; {
@ -44,6 +37,6 @@ buildGoModule rec {
homepage = "https://github.com/lawl/NoiseTorch"; homepage = "https://github.com/lawl/NoiseTorch";
license = licenses.gpl3Plus; license = licenses.gpl3Plus;
platforms = platforms.linux; platforms = platforms.linux;
maintainers = with maintainers; [ panaeon ]; maintainers = with maintainers; [ panaeon legendofmiracles ];
}; };
} }

View file

@ -1,37 +0,0 @@
diff --git a/scripts/embedversion.go b/scripts/embedversion.go
index ce0a756..60e7a5e 100644
--- a/scripts/embedversion.go
+++ b/scripts/embedversion.go
@@ -1,24 +1,18 @@
package main
import (
- "os"
- "os/exec"
- "strings"
+ "os"
+ "strings"
)
func main() {
- cmd := exec.Command("git", "describe", "--tags")
- ret, err := cmd.Output()
- if err != nil {
- panic("Couldn't read git tags to embed version number")
- }
- version := strings.TrimSpace(string(ret))
+ version := strings.TrimSpace(string(os.Getenv("version")))
- out, _ := os.Create("version.go")
- defer out.Close()
+ out, _ := os.Create("version.go")
+ defer out.Close()
- out.Write([]byte("package main\n\n//THIS FILE IS AUTOMATICALLY GENERATED BY `go generate` DO NOT EDIT!\n\nvar version=\""))
- out.Write([]byte(version))
- out.Write([]byte("\"\n"))
+ out.Write([]byte("package main\n\n//THIS FILE IS AUTOMATICALLY GENERATED BY `go generate` DO NOT EDIT!\n\nvar version=\""))
+ out.Write([]byte(version))
+ out.Write([]byte("\"\n"))
}