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

103 lines
2.8 KiB
Nix
Raw Normal View History

2014-05-27 00:48:30 +02:00
{ stdenv, fetchurl, libtool, xlibs, freetype, fontconfig, openssl, glib
, mesa, gstreamer, gst_plugins_base, dbus, alsaLib, zlib, libuuid
, libxml2, libxslt, sqlite, libogg, libvorbis, xz, libcanberra
2014-09-15 16:01:32 +02:00
, makeWrapper, libredirect, xkeyboard_config, xcbutilkeysyms }:
let
2014-05-27 00:48:30 +02:00
2015-05-18 13:15:50 +02:00
version = "2.2.1373";
rpath = stdenv.lib.makeSearchPath "lib" [
stdenv.glibc
libtool
2014-05-27 00:48:30 +02:00
xlibs.libXext
xlibs.libSM
xlibs.libICE
xlibs.libX11
xlibs.libXft
xlibs.libXau
xlibs.libXdmcp
xlibs.libXrender
xlibs.libXfixes
xlibs.libXcomposite
xlibs.libxcb
xlibs.libXi
freetype
fontconfig
openssl
2014-05-27 00:48:30 +02:00
glib
mesa
gstreamer
gst_plugins_base
dbus
alsaLib
zlib
libuuid
libxml2
libxslt
sqlite
libogg
libvorbis
xz
libcanberra
2014-09-15 16:01:32 +02:00
xcbutilkeysyms
] + ":${stdenv.cc.cc}/lib${stdenv.lib.optionalString stdenv.is64bit "64"}";
2014-05-27 00:48:30 +02:00
src =
if stdenv.system == "x86_64-linux" then
fetchurl {
url = "http://downloads.hipchat.com/linux/arch/x86_64/hipchat-${version}-x86_64.pkg.tar.xz";
2015-05-18 13:15:50 +02:00
sha256 = "0mxjzigncp8sh5w2rpr7kvkiahagm3adss1zv6rqk8hc1awrnd8n";
2014-05-27 00:48:30 +02:00
}
else if stdenv.system == "i686-linux" then
fetchurl {
url = "http://downloads.hipchat.com/linux/arch/i686/hipchat-${version}-i686.pkg.tar.xz";
2015-05-18 13:15:50 +02:00
sha256 = "1f4cjbazgifxpyr6589frs417h4wpxbykf46w5qiw0m2wiqpqff5";
2014-05-27 00:48:30 +02:00
}
else
throw "HipChat is not supported on ${stdenv.system}";
in
stdenv.mkDerivation {
name = "hipchat-${version}";
2014-05-27 00:48:30 +02:00
inherit src;
buildInputs = [ makeWrapper ];
buildCommand = ''
tar xf ${src}
2014-05-27 00:48:30 +02:00
mkdir -p $out/libexec/hipchat/bin
d=$out/libexec/hipchat/lib
2014-05-27 00:48:30 +02:00
rm -rfv opt/HipChat/lib/{libstdc++*,libz*,libuuid*,libxml2*,libxslt*,libsqlite*,libogg*,libvorbis*,liblzma*,libcanberra.*,libcanberra-*}
mv opt/HipChat/lib/ $d
mv usr/share $out
2014-05-27 00:48:30 +02:00
for file in $(find $d -type f); do
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $file || true
2014-05-27 00:48:30 +02:00
patchelf --set-rpath ${rpath}:\$ORIGIN $file || true
done
2014-05-27 00:48:30 +02:00
2013-05-14 14:29:53 +02:00
substituteInPlace $out/share/applications/hipchat.desktop \
--replace /opt/HipChat/bin $out/bin
2014-05-27 00:48:30 +02:00
makeWrapper $d/hipchat.bin $out/bin/hipchat \
--set HIPCHAT_LD_LIBRARY_PATH '"$LD_LIBRARY_PATH"' \
--set HIPCHAT_QT_PLUGIN_PATH '"$QT_PLUGIN_PATH"' \
--set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
--set NIX_REDIRECTS /usr/share/X11/xkb=${xkeyboard_config}/share/X11/xkb
2014-05-27 00:48:30 +02:00
mv opt/HipChat/bin/linuxbrowserlaunch $out/libexec/hipchat/bin/
'';
2015-05-18 13:15:50 +02:00
meta = with stdenv.lib; {
description = "Desktop client for HipChat services";
homepage = http://www.hipchat.com;
2015-05-18 13:15:50 +02:00
license = licenses.unfree;
platforms = [ "i686-linux" "x86_64-linux" ];
2015-05-18 13:15:50 +02:00
maintainers = with maintainers; [ jgeerds ];
};
}