From 0915191925e18bef56a9a75253c3bb6f5c06d179 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Sun, 17 Jan 2021 09:45:00 +0100 Subject: [PATCH] gomuks: patch out hardcoded path --- .../instant-messengers/gomuks/default.nix | 23 +++++++++++++++++-- .../gomuks/hardcoded_path.patch | 13 +++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 pkgs/applications/networking/instant-messengers/gomuks/hardcoded_path.patch diff --git a/pkgs/applications/networking/instant-messengers/gomuks/default.nix b/pkgs/applications/networking/instant-messengers/gomuks/default.nix index 3d1fc19113c6..08e67c59efc3 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,6 +47,8 @@ buildGoModule rec { } }/* $out/ substituteAllInPlace $out/share/applications/* + wrapProgram $out/bin/gomuks \ + --prefix PATH : "${lib.makeBinPath (lib.optionals stdenv.isLinux [ libnotify pulseaudio ])}" ''; meta = with lib; { 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 000000000000..0e0d4e28b0a1 --- /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() + }