-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/config.go b/config.go | ||
index de16249..fb91ec0 100644 | ||
--- a/config.go | ||
+++ b/config.go | ||
@@ -20,7 +20,7 @@ const configFile = "config.toml" | ||
|
||
func initializeConfigIfNot() { | ||
log.Println("Checking if config needs to be initialized") | ||
- conf := config{Threshold: 95, DisplayMonitorSources: false, EnableUpdates: true} | ||
+ conf := config{Threshold: 95, DisplayMonitorSources: false, EnableUpdates: false} | ||
configdir := configDir() | ||
ok, err := exists(configdir) | ||
if err != nil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ stdenv, buildGoModule, fetchFromGitHub, rnnoise-plugin }: | ||
|
||
buildGoModule rec { | ||
pname = "NoiseTorch"; | ||
version = "0.5.2-beta"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "lawl"; | ||
repo = "NoiseTorch"; | ||
rev = version; | ||
sha256 = "1q0gfpqczlpybxcjjkiybcy6yc0gnrq8x27r0mpg4pvgwy7mps47"; | ||
}; | ||
|
||
patches = [ ./version.patch ./config.patch ./embedlibrnnoise.patch ]; | ||
|
||
vendorSha256 = null; | ||
|
||
subPackages = [ "." ]; | ||
|
||
buildInputs = [ rnnoise-plugin ]; | ||
|
||
preBuild = '' | ||
export RNNOISE_LADSPA_PLUGIN="${rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so"; | ||
go generate; | ||
rm ./scripts/* | ||
''; | ||
|
||
postInstall = '' | ||
mkdir -p $out/share/icons/hicolor/256x256/apps/ | ||
cp assets/icon/noisetorch.png $out/share/icons/hicolor/256x256/apps/ | ||
mkdir -p $out/share/applications/ | ||
cp assets/noisetorch.desktop $out/share/applications/ | ||
''; | ||
|
||
meta = with stdenv.lib; { | ||
description = "Virtual microphone device with noise supression for PulseAudio"; | ||
homepage = "https://github.com/lawl/NoiseTorch"; | ||
license = licenses.gpl3Plus; | ||
platforms = platforms.linux; | ||
maintainers = with maintainers; [ panaeon ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/scripts/embedlibrnnoise.go b/scripts/embedlibrnnoise.go | ||
index 43daf80..0b3004b 100644 | ||
--- a/scripts/embedlibrnnoise.go | ||
+++ b/scripts/embedlibrnnoise.go | ||
@@ -8,7 +8,7 @@ import ( | ||
) | ||
|
||
func main() { | ||
- b, err := ioutil.ReadFile("librnnoise_ladspa/bin/ladspa/librnnoise_ladspa.so") | ||
+ b, err := ioutil.ReadFile(os.Getenv("RNNOISE_LADSPA_PLUGIN")) | ||
if err != nil { | ||
fmt.Printf("Couldn't read librnnoise_ladspa.so: %v\n", err) | ||
os.Exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
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")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters