From bce914acba5ee6ccdfe65fd55fa730b6d4811b5c Mon Sep 17 00:00:00 2001 From: Luflosi Date: Mon, 2 Dec 2019 23:57:38 +0100 Subject: [PATCH] kitty: fix loading of library When trying to play a sound, kitty prints an error message because it cannot find `libcanberra.so`: ``` Failed to load libcanberra.so, cannot play beep sound, with error: libcanberra.so.0.2.5: cannot open shared object file: No such file or directory ``` This is fixed by patching the path to the library. --- pkgs/applications/misc/kitty/default.nix | 1 + pkgs/applications/misc/kitty/fix-paths.patch | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/pkgs/applications/misc/kitty/default.nix b/pkgs/applications/misc/kitty/default.nix index cd04fdb2574..d5f5fceb039 100644 --- a/pkgs/applications/misc/kitty/default.nix +++ b/pkgs/applications/misc/kitty/default.nix @@ -67,6 +67,7 @@ buildPythonApplication rec { (substituteAll { src = ./fix-paths.patch; libstartup_notification = "${libstartup_notification}/lib/libstartup-notification-1.so"; + libcanberra = "${libcanberra}/lib/libcanberra.so"; }) ] ++ stdenv.lib.optionals stdenv.isDarwin [ ./no-lto.patch diff --git a/pkgs/applications/misc/kitty/fix-paths.patch b/pkgs/applications/misc/kitty/fix-paths.patch index 70460581307..65c78d22a82 100644 --- a/pkgs/applications/misc/kitty/fix-paths.patch +++ b/pkgs/applications/misc/kitty/fix-paths.patch @@ -8,6 +8,16 @@ + static const char* libname = "@libstartup_notification@"; // some installs are missing the .so symlink, so try the full name static const char* libname2 = "libstartup-notification-1.so.0"; + static const char* libname3 = "libstartup-notification-1.so.0.0.0"; +@@ -105,7 +105,7 @@ load_libcanberra_functions(void) { + + static void + load_libcanberra(void) { +- static const char* libname = "libcanberra.so"; ++ static const char* libname = "@libcanberra@"; + // some installs are missing the .so symlink, so try the full name + static const char* libname2 = "libcanberra.so.0"; + static const char* libname3 = "libcanberra.so.0.2.5"; --- a/docs/Makefile +++ b/docs/Makefile