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 <aszlig@redmoonstudios.org>
Reported-by: devhell <"^"@regexmail.net>
Tested-by: devhell <"^"@regexmail.net>
This commit is contained in:
aszlig 2015-07-13 19:30:01 +02:00
parent fd06533def
commit 13e83251a0
No known key found for this signature in database
GPG Key ID: D0EBD0EC8C2DC961

View File

@ -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
'';