about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2020-04-27 14:53:28 +0100
committerGitHub <noreply@github.com>2020-04-27 14:53:28 +0100
commit31bc16708a8a11393af1f1949072a2b0f7eb1b40 (patch)
tree209692946512ab63383b6246b8969b5f797a1bad /pkgs
parenteeb257f04df9ff55f0be4d8eba2a377005885a4d (diff)
parent73e46470852753b3f3e22bf79bd4230ff0e1cdc2 (diff)
Merge pull request #85451 from Elyhaka/teams-audio-fix
teams: fixing pulseaudio access
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/networking/instant-messengers/teams/default.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkgs/applications/networking/instant-messengers/teams/default.nix b/pkgs/applications/networking/instant-messengers/teams/default.nix
index 63d922ab29949..6b5acd8344a8e 100644
--- a/pkgs/applications/networking/instant-messengers/teams/default.nix
+++ b/pkgs/applications/networking/instant-messengers/teams/default.nix
@@ -52,6 +52,28 @@ stdenv.mkDerivation rec {
     ln -s $out/opt/teams/teams $out/bin/
   '';
 
+  dontAutoPatchelf = true;
+
+  # Includes runtimeDependencies in the RPATH of the included Node modules
+  # so that dynamic loading works. We cannot use directly runtimeDependencies
+  # here, since the libraries from runtimeDependencies are not propagated 
+  # to the dynamically loadable node modules because of a condition in
+  # autoPatchElfHook since *.node modules have Type: DYN (Shared object file) 
+  # instead of EXEC or INTERP it expects.
+  # Fixes: https://github.com/NixOS/nixpkgs/issues/85449
+  postFixup = ''
+    autoPatchelf "$out"
+
+    runtime_rpath="${lib.makeLibraryPath runtimeDependencies}"
+
+    for mod in $(find "$out/opt/teams" -name '*.node'); do
+      mod_rpath="$(patchelf --print-rpath "$mod")"
+
+      echo "Adding runtime dependencies to RPATH of Node module $mod"
+      patchelf --set-rpath "$runtime_rpath:$mod_rpath" "$mod"
+    done;
+  '';
+
   meta = with stdenv.lib; {
     description = "Microsoft Teams";
     homepage = "https://teams.microsoft.com";