2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, alsaLib, atk, at-spi2-core, cairo, cups, dbus, dpkg, expat, fetchurl
|
2020-08-25 15:19:57 +01:00
|
|
|
, fontconfig, freetype, gdk-pixbuf, glib, gnome2, gtk3, libdrm, libX11
|
2018-08-01 19:51:17 +01:00
|
|
|
, libXScrnSaver, libXcomposite, libXcursor, libXdamage, libXext, libXfixes
|
|
|
|
, libXi, libXrandr, libXrender, libXtst, libappindicator-gtk3, libcxx
|
2020-08-25 15:19:57 +01:00
|
|
|
, libnotify, libpulseaudio, libxcb, makeDesktopItem, makeWrapper, mesa, nspr, nss
|
2019-06-16 20:59:06 +01:00
|
|
|
, pango, systemd }:
|
2018-08-01 19:51:17 +01:00
|
|
|
|
|
|
|
let gitterDirectorySuffix = "opt/gitter";
|
2021-01-15 05:42:41 +00:00
|
|
|
libPath = lib.makeLibraryPath [
|
2020-08-25 15:19:57 +01:00
|
|
|
alsaLib
|
|
|
|
atk
|
|
|
|
at-spi2-core
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
gdk-pixbuf
|
|
|
|
glib
|
|
|
|
gnome2.GConf
|
|
|
|
gtk3
|
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
libappindicator-gtk3
|
|
|
|
libcxx
|
|
|
|
libdrm
|
|
|
|
libnotify
|
|
|
|
libpulseaudio
|
|
|
|
libxcb
|
|
|
|
mesa
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
pango
|
|
|
|
stdenv.cc.cc
|
|
|
|
systemd
|
|
|
|
];
|
2018-08-01 19:51:17 +01:00
|
|
|
doELFPatch = target: ''
|
|
|
|
patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
|
|
|
|
--set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \
|
|
|
|
$out/${gitterDirectorySuffix}/${target}
|
|
|
|
'';
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "gitter";
|
2020-08-25 15:19:57 +01:00
|
|
|
version = "5.0.1";
|
2018-08-01 19:51:17 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://update.gitter.im/linux64/${pname}_${version}_amd64.deb";
|
2020-08-25 15:19:57 +01:00
|
|
|
sha256 = "1ps9akylqrril4902r8mi0mprm0hb5wra51ry6c1rb5xz5nrzgh1";
|
2018-08-01 19:51:17 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper dpkg ];
|
|
|
|
|
|
|
|
unpackPhase = "dpkg -x $src .";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,opt/gitter,share/pixmaps}
|
|
|
|
mv ./opt/Gitter/linux64/* $out/opt/gitter
|
|
|
|
|
|
|
|
${doELFPatch "Gitter"}
|
|
|
|
${doELFPatch "nacl_helper"}
|
|
|
|
${doELFPatch "minidump_stackwalk"}
|
|
|
|
${doELFPatch "nwjc"}
|
|
|
|
${doELFPatch "chromedriver"}
|
|
|
|
${doELFPatch "payload"}
|
|
|
|
|
|
|
|
patchelf --set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \
|
|
|
|
$out/${gitterDirectorySuffix}/lib/libnw.so
|
|
|
|
|
|
|
|
wrapProgram $out/${gitterDirectorySuffix}/Gitter --prefix LD_LIBRARY_PATH : ${libPath}
|
|
|
|
|
|
|
|
ln -s $out/${gitterDirectorySuffix}/Gitter $out/bin/
|
|
|
|
ln -s $out/${gitterDirectorySuffix}/logo.png $out/share/pixmaps/gitter.png
|
|
|
|
ln -s "${desktopItem}/share/applications" $out/share/
|
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = pname;
|
|
|
|
exec = "Gitter";
|
|
|
|
icon = pname;
|
|
|
|
desktopName = "Gitter";
|
|
|
|
genericName = meta.description;
|
|
|
|
categories = "Network;InstantMessaging;";
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-08-01 19:51:17 +01:00
|
|
|
description = "Where developers come to talk";
|
|
|
|
downloadPage = "https://gitter.im/apps";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.imalison ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|