jitsi: patch RPATHs of bundled .so files

Possibly helps with bug #3482.
This commit is contained in:
Bryan Gardiner 2015-09-10 09:48:15 -07:00
parent 4140c7fe16
commit 8ef6197be5
No known key found for this signature in database
GPG key ID: 53EFBCA063E6183C

View file

@ -1,4 +1,7 @@
{ stdenv, fetchurl, makeDesktopItem, unzip, ant, jdk }:
{ stdenv, lib, fetchurl, makeDesktopItem, unzip, ant, jdk
# Optional, Jitsi still runs without, but you may pass null:
, alsaLib, dbus_libs, gtk2, libpulseaudio, openssl, xlibs
}:
stdenv.mkDerivation rec {
@ -22,6 +25,21 @@ stdenv.mkDerivation rec {
categories = "Application;Internet;";
};
libPath = lib.makeLibraryPath ([
stdenv.cc.cc # For libstdc++.
] ++ lib.filter (x: x != null) [
alsaLib
dbus_libs
gtk2
libpulseaudio
openssl
] ++ lib.optionals (xlibs != null) [
xlibs.libX11
xlibs.libXext
xlibs.libXScrnSaver
xlibs.libXv
]);
buildInputs = [unzip ant jdk];
buildPhase = ''ant make'';
@ -35,6 +53,12 @@ stdenv.mkDerivation rec {
chmod +x $out/bin/jitsi
sed -i 's| java | ${jdk}/bin/java |' $out/bin/jitsi
patchShebangs $out
libPath="$libPath:${jdk.jre.home}/lib/${jdk.architecture}"
find $out/ -type f -name '*.so' | while read file; do
patchelf --set-rpath "$libPath" "$file" && \
patchelf --shrink-rpath "$file"
done
'';
meta = {