2019-05-22 12:03:39 +01:00
|
|
|
{ stdenv, fetchurl, gnome2, gtk3, pango, atk, cairo, gdk-pixbuf, glib,
|
2018-07-06 18:27:11 +01:00
|
|
|
freetype, fontconfig, dbus, libX11, xorg, libXi, libXcursor, libXdamage,
|
|
|
|
libXrandr, libXcomposite, libXext, libXfixes, libXrender, libXtst,
|
|
|
|
libXScrnSaver, nss, nspr, alsaLib, cups, expat, udev }:
|
2018-06-13 12:27:29 +01:00
|
|
|
let
|
2019-02-25 09:13:49 +00:00
|
|
|
rpath = stdenv.lib.makeLibraryPath [
|
2018-06-13 12:27:29 +01:00
|
|
|
alsaLib
|
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
2019-05-22 12:03:39 +01:00
|
|
|
gdk-pixbuf
|
2018-06-13 12:27:29 +01:00
|
|
|
glib
|
2018-07-09 23:34:32 +01:00
|
|
|
gnome2.GConf
|
2019-02-24 10:25:34 +00:00
|
|
|
gtk3
|
2018-07-06 18:27:11 +01:00
|
|
|
pango
|
2018-06-13 12:27:29 +01:00
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
stdenv.cc.cc
|
|
|
|
udev
|
|
|
|
xorg.libxcb
|
|
|
|
];
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "mattermost-desktop-${version}";
|
2019-02-24 10:25:34 +00:00
|
|
|
version = "4.2.0";
|
2018-06-13 12:27:29 +01:00
|
|
|
|
|
|
|
src =
|
2018-08-20 20:11:29 +01:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
2018-06-13 12:27:29 +01:00
|
|
|
fetchurl {
|
|
|
|
url = "https://releases.mattermost.com/desktop/${version}/${name}-linux-x64.tar.gz";
|
2019-02-24 10:25:34 +00:00
|
|
|
sha256 = "0hka94gwpscjn61032c0grpjv5gjb0j8rkx6pgwci617n29xkyf6";
|
2018-06-13 12:27:29 +01:00
|
|
|
}
|
2018-08-20 20:11:29 +01:00
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then
|
2018-06-13 12:27:29 +01:00
|
|
|
fetchurl {
|
|
|
|
url = "https://releases.mattermost.com/desktop/${version}/${name}-linux-ia32.tar.gz";
|
2019-02-24 10:25:34 +00:00
|
|
|
sha256 = "1nx2sgbnr60h6kn56wv54m7cvyx27d64bfprpb94hqd5c2z21x80";
|
2018-06-13 12:27:29 +01:00
|
|
|
}
|
|
|
|
else
|
2018-08-20 20:11:29 +01:00
|
|
|
throw "Mattermost-Desktop is not currently supported on ${stdenv.hostPlatform.system}";
|
2018-06-13 12:27:29 +01:00
|
|
|
|
2019-02-25 09:13:49 +00:00
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2018-06-13 12:27:29 +01:00
|
|
|
installPhase = ''
|
2019-02-25 09:13:49 +00:00
|
|
|
mkdir -p $out/share/mattermost-desktop
|
|
|
|
cp -R . $out/share/mattermost-desktop
|
2018-06-13 12:27:29 +01:00
|
|
|
|
2019-02-25 09:13:49 +00:00
|
|
|
mkdir -p "$out/bin"
|
|
|
|
ln -s $out/share/mattermost-desktop/mattermost-desktop \
|
|
|
|
$out/bin/mattermost-desktop
|
2018-06-13 12:27:29 +01:00
|
|
|
|
2019-02-25 09:13:49 +00:00
|
|
|
patchShebangs $out/share/mattermost-desktop/create_desktop_file.sh
|
|
|
|
$out/share/mattermost-desktop/create_desktop_file.sh
|
|
|
|
rm $out/share/mattermost-desktop/create_desktop_file.sh
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
mv Mattermost.desktop $out/share/applications/Mattermost.desktop
|
2018-06-13 12:27:29 +01:00
|
|
|
|
2019-02-25 09:13:49 +00:00
|
|
|
patchelf \
|
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "${rpath}:$out/share/mattermost-desktop" \
|
|
|
|
$out/share/mattermost-desktop/mattermost-desktop
|
2018-06-13 12:27:29 +01:00
|
|
|
'';
|
|
|
|
|
2019-02-25 09:13:49 +00:00
|
|
|
meta = with stdenv.lib; {
|
2018-06-13 12:27:29 +01:00
|
|
|
description = "Mattermost Desktop client";
|
|
|
|
homepage = https://about.mattermost.com/;
|
2019-02-25 09:13:49 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
maintainers = [ maintainers.joko ];
|
2018-06-13 12:27:29 +01:00
|
|
|
};
|
|
|
|
}
|