Merge pull request #9785 from khumba/jitsi-rpath-fix

jitsi: patch RPATHs for missing libraries

Changed files
+44 -4
pkgs
applications
networking
instant-messengers
development
compilers
openjdk
+27 -2
pkgs/applications/networking/instant-messengers/jitsi/default.nix
···
-
{ stdenv, fetchurl, makeDesktopItem, unzip, ant, jdk }:
stdenv.mkDerivation rec {
···
categories = "Application;Internet;";
};
buildInputs = [unzip ant jdk];
buildPhase = ''ant make'';
···
mkdir $out/bin
cp resources/install/generic/run.sh $out/bin/jitsi
chmod +x $out/bin/jitsi
-
sed -i 's| java | ${jdk}/bin/java |' $out/bin/jitsi
patchShebangs $out
'';
meta = {
···
description = "Open Source Video Calls and Chat";
license = stdenv.lib.licenses.lgpl21Plus.shortName;
platforms = stdenv.lib.platforms.linux;
};
}
···
+
{ 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 {
···
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'';
···
mkdir $out/bin
cp resources/install/generic/run.sh $out/bin/jitsi
chmod +x $out/bin/jitsi
+
substituteInPlace $out/bin/jitsi --replace '@JAVA@' '${jdk}/bin/java'
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 = {
···
description = "Open Source Video Calls and Chat";
license = stdenv.lib.licenses.lgpl21Plus.shortName;
platforms = stdenv.lib.platforms.linux;
+
maintainers = [ stdenv.lib.maintainers.khumba ];
};
}
+1 -1
pkgs/applications/networking/instant-messengers/jitsi/jitsi.patch
···
export PATH=$PATH:native
-java $CLIENTARGS -classpath "lib/felix.jar:sc-bundles/sc-launcher.jar:sc-bundles/util.jar:lib/" -Djava.library.path=native -Dfelix.config.properties=file:./lib/felix.client.run.properties -Djava.util.logging.config.file=lib/logging.properties net.java.sip.communicator.launcher.SIPCommunicator
-
+exec java $CLIENTARGS -classpath "lib/felix.jar:sc-bundles/sc-launcher.jar:sc-bundles/util.jar:lib/" -Djava.library.path=$NATIVELIBS -Dfelix.config.properties=file:lib/felix.client.run.properties -Djava.util.logging.config.file=lib/logging.properties net.java.sip.communicator.launcher.SIPCommunicator
···
export PATH=$PATH:native
-java $CLIENTARGS -classpath "lib/felix.jar:sc-bundles/sc-launcher.jar:sc-bundles/util.jar:lib/" -Djava.library.path=native -Dfelix.config.properties=file:./lib/felix.client.run.properties -Djava.util.logging.config.file=lib/logging.properties net.java.sip.communicator.launcher.SIPCommunicator
+
+exec @JAVA@ $CLIENTARGS -classpath "lib/felix.jar:sc-bundles/sc-launcher.jar:sc-bundles/util.jar:lib/" -Djava.library.path=$NATIVELIBS -Dfelix.config.properties=file:lib/felix.client.run.properties -Djava.util.logging.config.file=lib/logging.properties net.java.sip.communicator.launcher.SIPCommunicator
+16 -1
pkgs/development/compilers/openjdk/8.nix
···
}:
let
update = "60";
build = "24";
baseurl = "http://hg.openjdk.java.net/jdk8u/jdk8u";
···
platforms = platforms.linux;
};
-
passthru.home = "${openjdk8}/lib/openjdk";
};
in openjdk8
···
}:
let
+
+
/**
+
* The JRE libraries are in directories that depend on the CPU.
+
*/
+
architecture =
+
if stdenv.system == "i686-linux" then
+
"i386"
+
else if stdenv.system == "x86_64-linux" then
+
"amd64"
+
else
+
throw "openjdk requires i686-linux or x86_64 linux";
+
update = "60";
build = "24";
baseurl = "http://hg.openjdk.java.net/jdk8u/jdk8u";
···
platforms = platforms.linux;
};
+
passthru = {
+
inherit architecture;
+
home = "${openjdk8}/lib/openjdk";
+
};
};
in openjdk8