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
|
2014-05-27 01:00:04 +02:00
|
|
|
, libxml2, libxslt, sqlite, libogg, libvorbis, xz, libcanberra
|
2014-09-15 16:01:32 +02:00
|
|
|
, makeWrapper, libredirect, xkeyboard_config, xcbutilkeysyms }:
|
2013-04-11 20:42:32 +02:00
|
|
|
|
|
|
|
let
|
2014-05-27 00:48:30 +02:00
|
|
|
|
2014-12-07 11:56:51 +01:00
|
|
|
version = "2.2.1287";
|
2013-04-11 20:42:32 +02:00
|
|
|
|
|
|
|
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
|
2013-04-11 20:42:32 +02:00
|
|
|
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
|
2014-12-17 19:11:30 +01:00
|
|
|
] + ":${stdenv.cc.gcc}/lib${stdenv.lib.optionalString stdenv.is64bit "64"}";
|
2013-04-11 20:42:32 +02:00
|
|
|
|
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";
|
2014-12-07 11:56:51 +01:00
|
|
|
sha256 = "170izy3v18rgriz84h4gyf9354jvjrsbkgg53czq9l0scyz8x55b";
|
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";
|
2014-12-07 11:56:51 +01:00
|
|
|
sha256 = "150q7pxg5vs14is5qf36yfsf7r70g49q9xr1d1rknmc5m4qa5rc5";
|
2014-05-27 00:48:30 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
throw "HipChat is not supported on ${stdenv.system}";
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2013-04-11 20:42:32 +02:00
|
|
|
name = "hipchat-${version}";
|
|
|
|
|
2014-05-27 00:48:30 +02:00
|
|
|
inherit src;
|
|
|
|
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
2013-04-11 20:42:32 +02:00
|
|
|
buildCommand = ''
|
|
|
|
tar xf ${src}
|
2014-05-27 00:48:30 +02:00
|
|
|
|
2014-05-27 01:00:04 +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
|
2013-04-11 20:42:32 +02:00
|
|
|
mv usr/share $out
|
2014-05-27 00:48:30 +02:00
|
|
|
|
|
|
|
for file in $(find $d -type f); do
|
2014-12-17 19:11:30 +01:00
|
|
|
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
|
2013-04-11 20:42:32 +02:00
|
|
|
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"' \
|
2014-05-27 01:00:04 +02:00
|
|
|
--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
|
|
|
|
2014-05-27 01:00:04 +02:00
|
|
|
mv opt/HipChat/bin/linuxbrowserlaunch $out/libexec/hipchat/bin/
|
2013-04-11 20:42:32 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2014-08-24 16:21:08 +02:00
|
|
|
description = "Desktop client for HipChat services";
|
2013-04-11 20:42:32 +02:00
|
|
|
homepage = http://www.hipchat.com;
|
2013-04-12 14:37:50 +02:00
|
|
|
license = stdenv.lib.licenses.unfree;
|
2013-04-11 20:42:32 +02:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|