From 461a23c756c31f0925159601e46b16072f9f8920 Mon Sep 17 00:00:00 2001 From: Maximilian Marx Date: Mon, 15 Apr 2024 11:17:07 +0200 Subject: [PATCH] electron: add libnotify to the RPATH Electron loads libnotify dynamically via dlopen(3), which fails if it is not in the RPATH. This, in turn, breaks desktop notifications in, e.g., mattermost-desktop. --- pkgs/development/tools/electron/common.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/development/tools/electron/common.nix b/pkgs/development/tools/electron/common.nix index a29de512404d..6084fc3c8ebd 100644 --- a/pkgs/development/tools/electron/common.nix +++ b/pkgs/development/tools/electron/common.nix @@ -190,6 +190,18 @@ in (chromium.override { upstream-info = info.chromium; }).mkDerivation (base: { runHook postInstall ''; + postFixup = + let + libPath = lib.makeLibraryPath [ + libnotify + ]; + in + base.postFixup + '' + patchelf \ + --add-rpath "${libPath}" \ + $out/libexec/electron/electron + ''; + requiredSystemFeatures = [ "big-parallel" ]; passthru = {