From 481f4286048ae8b38edad39441df36ec42322f4d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 27 May 2014 00:48:30 +0200 Subject: [PATCH] hipchat: Update to 2.2.1107 --- .../instant-messengers/hipchat/default.nix | 108 ++++++++++++------ pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 72 insertions(+), 38 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/hipchat/default.nix b/pkgs/applications/networking/instant-messengers/hipchat/default.nix index c0f76602b2bb..857f162d7e47 100644 --- a/pkgs/applications/networking/instant-messengers/hipchat/default.nix +++ b/pkgs/applications/networking/instant-messengers/hipchat/default.nix @@ -1,59 +1,93 @@ -{ stdenv -, fetchurl -, libtool -, libXext -, libSM -, libICE -, libX11 -, libXft -, libXau -, libXdmcp -, libXrender -, freetype -, fontconfig -, openssl -}: +{ stdenv, fetchurl, libtool, xlibs, freetype, fontconfig, openssl, glib +, mesa, gstreamer, gst_plugins_base, dbus, alsaLib, zlib, libuuid +, libxml2, libxslt, sqlite, libogg, libvorbis, xz, libcanberra, makeWrapper }: let - version = "1.94.407"; + + version = "2.2.1107"; rpath = stdenv.lib.makeSearchPath "lib" [ stdenv.glibc - stdenv.gcc.gcc libtool - libXext - libSM - libICE - libX11 - libXft - libXau - libXdmcp - libXrender + 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 - ]; + glib + mesa + gstreamer + gst_plugins_base + dbus + alsaLib + zlib + libuuid + libxml2 + libxslt + sqlite + libogg + libvorbis + xz + libcanberra + ] + ":${stdenv.gcc.gcc}/lib${stdenv.lib.optionalString stdenv.is64bit "64"}"; - src = fetchurl { - url = "http://downloads.hipchat.com/linux/arch/hipchat-${version}-i686.pkg.tar.xz"; - sha256 = "0kyjpa2ir066zqkvs1zmnx6kvl8v4jfl8h7bw110cgigwmiplk7k"; - }; -in stdenv.mkDerivation { + 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"; + sha256 = "0lf780pxbh40m2i48cki072lrm75924cz3zgkmaxddmar3y13bwa"; + } + else if stdenv.system == "i686-linux" then + fetchurl { + url = "http://downloads.hipchat.com/linux/arch/i686/hipchat-${version}-i686.pkg.tar.xz"; + sha256 = "1k33670rpigdpy9jcacryc1i05ykp5yffcplmbm5q29ng54cn0zv"; + } + else + throw "HipChat is not supported on ${stdenv.system}"; + +in + +stdenv.mkDerivation { name = "hipchat-${version}"; + inherit src; + + buildInputs = [ makeWrapper ]; + buildCommand = '' tar xf ${src} - mkdir -p $out - mv opt/HipChat/lib $out - mv opt/HipChat/bin $out + + d=$out/libexec/hipchat + mkdir -p $out/libexec + 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 + 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 + + for file in $(find $d -type f); do + patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" $file || true + patchelf --set-rpath ${rpath}:\$ORIGIN $file || true done + substituteInPlace $out/share/applications/hipchat.desktop \ --replace /opt/HipChat/bin $out/bin + + makeWrapper $d/hipchat.bin $out/bin/hipchat \ + --set HIPCHAT_LD_LIBRARY_PATH '"$LD_LIBRARY_PATH"' \ + --set HIPCHAT_QT_PLUGIN_PATH '"$QT_PLUGIN_PATH"' + + mv opt/HipChat/bin/linuxbrowserlaunch $out/bin ''; meta = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e0b35e55d47f..fd4161190b65 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8620,7 +8620,7 @@ let hexedit = callPackage ../applications/editors/hexedit { }; - hipchat = callPackage_i686 ../applications/networking/instant-messengers/hipchat { }; + hipchat = callPackage ../applications/networking/instant-messengers/hipchat { }; homebank = callPackage ../applications/office/homebank { };