nixpkgs/pkgs/applications/networking/instant-messengers/jitsi/default.nix

76 lines
2.0 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, makeDesktopItem, unzip, ant, jdk
# Optional, Jitsi still runs without, but you may pass null:
2015-09-23 11:36:23 +00:00
, alsaLib, dbus_libs, gtk2, libpulseaudio, openssl, xorg
}:
2014-03-04 12:17:57 +00:00
2015-09-17 20:04:06 +00:00
assert stdenv.isLinux;
2014-03-04 12:17:57 +00:00
stdenv.mkDerivation rec {
name = "jitsi-${version}";
version = "2.10.5550";
2014-03-04 12:17:57 +00:00
src = fetchurl {
url = "https://download.jitsi.org/jitsi/src/jitsi-src-${version}.zip";
sha256 = "11vjchc3dnzj55x7c62wsm6masvwmij1ifkds917r1qvil1nzz6d";
2014-03-04 12:17:57 +00:00
};
patches = [ ./jitsi.patch ];
jitsiItem = makeDesktopItem {
name = "Jitsi";
exec = "jitsi";
comment = "VoIP and Instant Messaging client";
desktopName = "Jitsi";
genericName = "Instant Messaging";
categories = "Application;Internet;";
};
libPath = lib.makeLibraryPath ([
stdenv.cc.cc # For libstdc++.
] ++ lib.filter (x: x != null) [
alsaLib
dbus_libs
gtk2
libpulseaudio
openssl
2015-09-23 11:36:23 +00:00
] ++ lib.optionals (xorg != null) [
xorg.libX11
xorg.libXext
xorg.libXScrnSaver
xorg.libXv
]);
nativeBuildInputs = [ unzip ];
buildInputs = [ ant jdk ];
2014-03-04 12:17:57 +00:00
buildPhase = ''ant make'';
installPhase = ''
mkdir -p $out
cp -a lib $out/
2015-09-18 18:10:00 +00:00
rm -rf $out/lib/native/solaris
2014-03-04 12:17:57 +00:00
cp -a sc-bundles $out/
mkdir $out/bin
cp resources/install/generic/run.sh $out/bin/jitsi
chmod +x $out/bin/jitsi
substituteInPlace $out/bin/jitsi \
--subst-var-by JAVA ${jdk}/bin/java \
--subst-var-by EXTRALIBS ${gtk2.out}/lib
sed -e 's,^java\ ,${jdk}/bin/java ,' -i $out/bin/jitsi
patchShebangs $out
libPath="$libPath:${jdk.home}/lib/${jdk.architecture}"
find $out/ -type f -name '*.so' | while read file; do
patchelf --set-rpath "$libPath" "$file" && \
patchelf --shrink-rpath "$file"
done
2014-03-04 12:17:57 +00:00
'';
meta = with stdenv.lib; {
2014-03-04 12:17:57 +00:00
homepage = https://jitsi.org/;
description = "Open Source Video Calls and Chat";
license = licenses.lgpl21Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ khumba ndowens ];
2014-03-04 12:17:57 +00:00
};
}