2015-09-15 09:26:18 +00:00
|
|
|
{ stdenv, fetchurl, libtool, xorg, freetype, fontconfig, openssl, glib
|
2014-05-26 22:48:30 +00:00
|
|
|
, mesa, gstreamer, gst_plugins_base, dbus, alsaLib, zlib, libuuid
|
2014-05-26 23:00:04 +00:00
|
|
|
, libxml2, libxslt, sqlite, libogg, libvorbis, xz, libcanberra
|
2014-09-15 14:01:32 +00:00
|
|
|
, makeWrapper, libredirect, xkeyboard_config, xcbutilkeysyms }:
|
2013-04-11 18:42:32 +00:00
|
|
|
|
|
|
|
let
|
2014-05-26 22:48:30 +00:00
|
|
|
|
2015-09-17 09:06:24 +00:00
|
|
|
version = "2.2.1388";
|
2013-04-11 18:42:32 +00:00
|
|
|
|
|
|
|
rpath = stdenv.lib.makeSearchPath "lib" [
|
|
|
|
stdenv.glibc
|
|
|
|
libtool
|
2015-09-15 09:26:18 +00:00
|
|
|
xorg.libXext
|
|
|
|
xorg.libSM
|
|
|
|
xorg.libICE
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXft
|
|
|
|
xorg.libXau
|
|
|
|
xorg.libXdmcp
|
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXfixes
|
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libxcb
|
|
|
|
xorg.libXi
|
2013-04-11 18:42:32 +00:00
|
|
|
freetype
|
|
|
|
fontconfig
|
|
|
|
openssl
|
2014-05-26 22:48:30 +00:00
|
|
|
glib
|
|
|
|
mesa
|
|
|
|
gstreamer
|
|
|
|
gst_plugins_base
|
|
|
|
dbus
|
|
|
|
alsaLib
|
|
|
|
zlib
|
|
|
|
libuuid
|
|
|
|
libxml2
|
|
|
|
libxslt
|
|
|
|
sqlite
|
|
|
|
libogg
|
|
|
|
libvorbis
|
|
|
|
xz
|
|
|
|
libcanberra
|
2014-09-15 14:01:32 +00:00
|
|
|
xcbutilkeysyms
|
2015-01-15 04:25:26 +00:00
|
|
|
] + ":${stdenv.cc.cc}/lib${stdenv.lib.optionalString stdenv.is64bit "64"}";
|
2013-04-11 18:42:32 +00:00
|
|
|
|
2014-05-26 22:48:30 +00: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-09-17 09:06:24 +00:00
|
|
|
sha256 = "18vl0c7xgyzd2miwkfzc638z0wzszgsdlbnslkkvxmg95ykdrdnz";
|
2014-05-26 22:48:30 +00:00
|
|
|
}
|
|
|
|
else if stdenv.system == "i686-linux" then
|
|
|
|
fetchurl {
|
|
|
|
url = "http://downloads.hipchat.com/linux/arch/i686/hipchat-${version}-i686.pkg.tar.xz";
|
2015-09-17 09:06:24 +00:00
|
|
|
sha256 = "12q8hf3gmcgrqg6v9xqyknwsmwywpwm76jc54sfniiqv5ngq24hl";
|
2014-05-26 22:48:30 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
throw "HipChat is not supported on ${stdenv.system}";
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2013-04-11 18:42:32 +00:00
|
|
|
name = "hipchat-${version}";
|
|
|
|
|
2014-05-26 22:48:30 +00:00
|
|
|
inherit src;
|
|
|
|
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
2013-04-11 18:42:32 +00:00
|
|
|
buildCommand = ''
|
|
|
|
tar xf ${src}
|
2014-05-26 22:48:30 +00:00
|
|
|
|
2014-05-26 23:00:04 +00:00
|
|
|
mkdir -p $out/libexec/hipchat/bin
|
|
|
|
d=$out/libexec/hipchat/lib
|
2014-05-26 22:48:30 +00: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 18:42:32 +00:00
|
|
|
mv usr/share $out
|
2014-05-26 22:48:30 +00:00
|
|
|
|
|
|
|
for file in $(find $d -type f); do
|
2014-12-17 18:11:30 +00:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $file || true
|
2014-05-26 22:48:30 +00:00
|
|
|
patchelf --set-rpath ${rpath}:\$ORIGIN $file || true
|
2013-04-11 18:42:32 +00:00
|
|
|
done
|
2014-05-26 22:48:30 +00:00
|
|
|
|
2013-05-14 12:29:53 +00:00
|
|
|
substituteInPlace $out/share/applications/hipchat.desktop \
|
|
|
|
--replace /opt/HipChat/bin $out/bin
|
2014-05-26 22:48:30 +00:00
|
|
|
|
|
|
|
makeWrapper $d/hipchat.bin $out/bin/hipchat \
|
|
|
|
--set HIPCHAT_LD_LIBRARY_PATH '"$LD_LIBRARY_PATH"' \
|
2014-05-26 23:00:04 +00: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-26 22:48:30 +00:00
|
|
|
|
2014-05-26 23:00:04 +00:00
|
|
|
mv opt/HipChat/bin/linuxbrowserlaunch $out/libexec/hipchat/bin/
|
2013-04-11 18:42:32 +00:00
|
|
|
'';
|
|
|
|
|
2015-05-18 11:15:50 +00:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-24 14:21:08 +00:00
|
|
|
description = "Desktop client for HipChat services";
|
2013-04-11 18:42:32 +00:00
|
|
|
homepage = http://www.hipchat.com;
|
2015-05-18 11:15:50 +00:00
|
|
|
license = licenses.unfree;
|
2013-04-11 18:42:32 +00:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2015-05-18 11:15:50 +00:00
|
|
|
maintainers = with maintainers; [ jgeerds ];
|
2013-04-11 18:42:32 +00:00
|
|
|
};
|
|
|
|
}
|