mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-20 11:53:51 +00:00
gomuks: patch out hardcoded path
This commit is contained in:
parent
01291474ea
commit
0915191925
@ -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 {
|
buildGoModule rec {
|
||||||
pname = "gomuks";
|
pname = "gomuks";
|
||||||
@ -15,7 +26,13 @@ buildGoModule rec {
|
|||||||
|
|
||||||
doCheck = false;
|
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 = ''
|
postInstall = ''
|
||||||
cp -r ${
|
cp -r ${
|
||||||
@ -30,6 +47,8 @@ buildGoModule rec {
|
|||||||
}
|
}
|
||||||
}/* $out/
|
}/* $out/
|
||||||
substituteAllInPlace $out/share/applications/*
|
substituteAllInPlace $out/share/applications/*
|
||||||
|
wrapProgram $out/bin/gomuks \
|
||||||
|
--prefix PATH : "${lib.makeBinPath (lib.optionals stdenv.isLinux [ libnotify pulseaudio ])}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
@ -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()
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user