From 13e83251a0bd69cf3ab99fa78f571d71932b79ee Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 13 Jul 2015 19:30:01 +0200 Subject: [PATCH] virtualbox: Fix load of libpulse.so at runtime. Within fractions* of a second, the beautifully crafted history and branching mechanisms of SVN found out the exact revision which caused this to be visible in version 5.x but not in version 4.x: https://www.virtualbox.org/changeset?old_path=%2Fvbox%2Ftrunk&old=30933&new_path=%2Fvbox%2Ftrunk&new=30934 Also note the very short URL and the informative changeset message which shows you exactly what was the issue, I think. Be warned however, it may contain traces of history amnesia, revision epilepsy and other related diseases. As for the issue itself: This was very much broken in 4.x as well, but it didn't show an error message in the UI. The PulseAudio library is loaded at runtime and it's not able to do that unless it's in LD_LIBRARY_PATH. Now, we're doing the same as with the ALSA libraries: We're hardcoding the path to the shared object file in patchPhase. Thanks to @devhell for reporting and testing. *: Might be off several minutes or hours due to rounding errors in floating point arithmetic. Signed-off-by: aszlig Reported-by: devhell <"^"@regexmail.net> Tested-by: devhell <"^"@regexmail.net> --- pkgs/applications/virtualization/virtualbox/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix index a1a389314105..3250dc419d1e 100644 --- a/pkgs/applications/virtualization/virtualbox/default.nix +++ b/pkgs/applications/virtualization/virtualbox/default.nix @@ -81,7 +81,12 @@ in stdenv.mkDerivation { ls kBuild/bin/linux.x86/k* tools/linux.x86/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux.so.2 ls kBuild/bin/linux.amd64/k* tools/linux.amd64/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 find . -type f -iname '*makefile*' -exec sed -i -e 's/depmod -a/:/g' {} + - sed -e 's@"libasound.so.2"@"${alsaLib}/lib/libasound.so.2"@g' -i src/VBox/Main/xml/Settings.cpp src/VBox/Devices/Audio/alsa_stubs.c + sed -i -e ' + s@"libasound.so.2"@"${alsaLib}/lib/libasound.so.2"@g + ${optionalString pulseSupport '' + s@"libpulse.so.0"@"${libpulseaudio}/lib/libpulse.so.0"@g + ''} + ' src/VBox/Main/xml/Settings.cpp src/VBox/Devices/Audio/{alsa,pulse}_stubs.c export USER=nix set +x '';