2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchurl, gnome2, gtk3, pango, atk, cairo, gdk-pixbuf, glib,
|
2018-07-06 19:27:11 +02:00
|
|
|
freetype, fontconfig, dbus, libX11, xorg, libXi, libXcursor, libXdamage,
|
|
|
|
libXrandr, libXcomposite, libXext, libXfixes, libXrender, libXtst,
|
2019-11-06 01:16:15 +01:00
|
|
|
libXScrnSaver, nss, nspr, alsaLib, cups, expat, udev, wrapGAppsHook,
|
2019-11-06 00:13:04 +01:00
|
|
|
hicolor-icon-theme, libuuid, at-spi2-core, at-spi2-atk }:
|
2019-11-06 01:16:15 +01:00
|
|
|
|
2018-06-13 13:27:29 +02:00
|
|
|
let
|
2021-01-15 06:42:41 +01:00
|
|
|
rpath = lib.makeLibraryPath [
|
2018-06-13 13:27:29 +02:00
|
|
|
alsaLib
|
2019-11-06 00:13:04 +01:00
|
|
|
at-spi2-atk
|
|
|
|
at-spi2-core
|
2018-06-13 13:27:29 +02:00
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
2019-05-22 13:03:39 +02:00
|
|
|
gdk-pixbuf
|
2018-06-13 13:27:29 +02:00
|
|
|
glib
|
2018-07-10 00:34:32 +02:00
|
|
|
gnome2.GConf
|
2019-02-24 11:25:34 +01:00
|
|
|
gtk3
|
2018-07-06 19:27:11 +02:00
|
|
|
pango
|
2019-11-06 00:13:04 +01:00
|
|
|
libuuid
|
2018-06-13 13:27:29 +02:00
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
stdenv.cc.cc
|
|
|
|
udev
|
|
|
|
xorg.libxcb
|
|
|
|
];
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "mattermost-desktop";
|
2020-07-23 01:52:31 +02:00
|
|
|
version = "4.5.2";
|
2018-06-13 13:27:29 +02:00
|
|
|
|
|
|
|
src =
|
2018-08-20 21:11:29 +02:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
2018-06-13 13:27:29 +02:00
|
|
|
fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "https://releases.mattermost.com/desktop/${version}/${pname}-${version}-linux-x64.tar.gz";
|
2020-07-23 01:52:31 +02:00
|
|
|
sha256 = "0r9xmhzif1ia1m53yr59q6p3niyq3jv3vgv4703x68jmd46f91n6";
|
2018-06-13 13:27:29 +02:00
|
|
|
}
|
2018-08-20 21:11:29 +02:00
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then
|
2018-06-13 13:27:29 +02:00
|
|
|
fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "https://releases.mattermost.com/desktop/${version}/${pname}-${version}-linux-ia32.tar.gz";
|
2020-07-23 01:52:31 +02:00
|
|
|
sha256 = "1h8lw06p3cqz9dkgbhfmzcrzjsir5cfhx28xm4zrmvkj4yfzbcnv";
|
2018-06-13 13:27:29 +02:00
|
|
|
}
|
|
|
|
else
|
2018-08-20 21:11:29 +02:00
|
|
|
throw "Mattermost-Desktop is not currently supported on ${stdenv.hostPlatform.system}";
|
2018-06-13 13:27:29 +02:00
|
|
|
|
2019-02-25 10:13:49 +01:00
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2019-11-06 01:16:15 +01:00
|
|
|
buildInputs = [ wrapGAppsHook gtk3 hicolor-icon-theme ];
|
|
|
|
|
2018-06-13 13:27:29 +02:00
|
|
|
installPhase = ''
|
2019-02-25 10:13:49 +01:00
|
|
|
mkdir -p $out/share/mattermost-desktop
|
|
|
|
cp -R . $out/share/mattermost-desktop
|
2018-06-13 13:27:29 +02:00
|
|
|
|
2019-02-25 10:13:49 +01:00
|
|
|
mkdir -p "$out/bin"
|
|
|
|
ln -s $out/share/mattermost-desktop/mattermost-desktop \
|
|
|
|
$out/bin/mattermost-desktop
|
2018-06-13 13:27:29 +02:00
|
|
|
|
2019-02-25 10:13:49 +01: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
|
2019-11-14 16:38:01 +01:00
|
|
|
substituteInPlace \
|
|
|
|
$out/share/applications/Mattermost.desktop \
|
|
|
|
--replace /share/mattermost-desktop/mattermost-desktop /bin/mattermost-desktop
|
2018-06-13 13:27:29 +02:00
|
|
|
|
2019-02-25 10:13:49 +01: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 13:27:29 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2018-06-13 13:27:29 +02:00
|
|
|
description = "Mattermost Desktop client";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://about.mattermost.com/";
|
2019-02-25 10:13:49 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
maintainers = [ maintainers.joko ];
|
2018-06-13 13:27:29 +02:00
|
|
|
};
|
|
|
|
}
|