summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/hipchat/default.nix
blob: b202a0f09db8dd827f963608f29e80d0a81c0c89 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{ stdenv
, fetchurl
, libtool
, libXext
, libSM
, libICE
, libX11
, libXft
, libXau
, libXdmcp
, libXrender
, freetype
, fontconfig
, openssl
}:

let
  version = "1.94.407";

  rpath = stdenv.lib.makeSearchPath "lib" [
    stdenv.glibc
    stdenv.gcc.gcc
    libtool
    libXext
    libSM
    libICE
    libX11
    libXft
    libXau
    libXdmcp
    libXrender
    freetype
    fontconfig
    openssl
  ];

  src = fetchurl {
    url = "http://downloads.hipchat.com/linux/arch/hipchat-${version}-i686.pkg.tar.xz";
    sha256 = "0kyjpa2ir066zqkvs1zmnx6kvl8v4jfl8h7bw110cgigwmiplk7k";
  };
in stdenv.mkDerivation {
  name = "hipchat-${version}";

  buildCommand = ''
    tar xf ${src}
    mkdir -p $out
    mv opt/HipChat/lib $out
    mv opt/HipChat/bin $out
    mv usr/share $out
    patchShebangs $out/bin
    for file in $(find $out/lib -type f); do
        patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux.so.2 $file || true
        patchelf --set-rpath ${rpath}:$out/lib $file || true
    done
  '';

  meta = {
    description = "HipChat Desktop Client";
    homepage = http://www.hipchat.com;
    license = stdenv.lib.licenses.proprietary;
    platforms = [ "i686-linux" "x86_64-linux" ];
  };
}