about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-01-20 16:01:12 +0100
committerGitHub <noreply@github.com>2021-01-20 16:01:12 +0100
commit6e3870622d3fb3e46ce18066dd0fe6a49f0a7970 (patch)
tree795c99e02d3a686de4b37f11af2039eaf43926bb /pkgs/applications/networking/instant-messengers
parentf0cf05c4b94457d393ae6bac27a4aa6109367f8d (diff)
parent8cc494b1bbd00e1516c016549726a7c3d252add2 (diff)
Merge pull request #109608 from charvp/pr/gomuks-hardcoded-path
gomuks: patch out hardcoded path
Diffstat (limited to 'pkgs/applications/networking/instant-messengers')
-rw-r--r--pkgs/applications/networking/instant-messengers/gomuks/default.nix25
-rw-r--r--pkgs/applications/networking/instant-messengers/gomuks/hardcoded_path.patch13
2 files changed, 35 insertions, 3 deletions
diff --git a/pkgs/applications/networking/instant-messengers/gomuks/default.nix b/pkgs/applications/networking/instant-messengers/gomuks/default.nix
index 3d1fc19113c6e..a2d12124dbf15 100644
--- a/pkgs/applications/networking/instant-messengers/gomuks/default.nix
+++ b/pkgs/applications/networking/instant-messengers/gomuks/default.nix
@@ -1,4 +1,15 @@
-{ lib, stdenv, buildGoModule, fetchFromGitHub, olm, makeDesktopItem }:
+{ lib
+, stdenv
+, substituteAll
+, buildGoModule
+, fetchFromGitHub
+, makeDesktopItem
+, makeWrapper
+, libnotify
+, olm
+, pulseaudio
+, sound-theme-freedesktop
+}:
 
 buildGoModule rec {
   pname = "gomuks";
@@ -15,7 +26,13 @@ buildGoModule rec {
 
   doCheck = false;
 
-  buildInputs = [ olm ];
+  buildInputs = [ makeWrapper olm ];
+
+  # Upstream issue: https://github.com/tulir/gomuks/issues/260
+  patches = lib.optional stdenv.isLinux (substituteAll {
+    src = ./hardcoded_path.patch;
+    soundTheme = sound-theme-freedesktop;
+  });
 
   postInstall = ''
     cp -r ${
@@ -30,13 +47,15 @@ buildGoModule rec {
       }
     }/* $out/
     substituteAllInPlace $out/share/applications/*
+    wrapProgram $out/bin/gomuks \
+      --prefix PATH : "${lib.makeBinPath (lib.optionals stdenv.isLinux [ libnotify pulseaudio ])}"
   '';
 
   meta = with lib; {
     homepage = "https://maunium.net/go/gomuks/";
     description = "A terminal based Matrix client written in Go";
     license = licenses.gpl3;
-    maintainers = with maintainers; [ tilpner emily ];
+    maintainers = with maintainers; [ charvp emily ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/gomuks/hardcoded_path.patch b/pkgs/applications/networking/instant-messengers/gomuks/hardcoded_path.patch
new file mode 100644
index 0000000000000..0e0d4e28b0a1d
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/gomuks/hardcoded_path.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/notification/notify_linux.go b/lib/notification/notify_linux.go
+index f93a95f..da6a61d 100644
+--- a/lib/notification/notify_linux.go
++++ b/lib/notification/notify_linux.go
+@@ -32,7 +32,7 @@ func Send(title, text string, critical, sound bool) error {
+ 		if critical {
+ 			soundName = "complete"
+ 		}
+-		exec.Command("paplay", "/usr/share/sounds/freedesktop/stereo/"+soundName+".oga").Run()
++		exec.Command("paplay", "@soundTheme@/share/sounds/freedesktop/stereo/"+soundName+".oga").Run()
+ 	}
+ 	return exec.Command("notify-send", args...).Run()
+ }