3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/instant-messengers/mattermost-desktop/default.nix

106 lines
2.9 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, gnome2, gtk3, pango, atk, cairo, gdk-pixbuf, glib,
freetype, fontconfig, dbus, libX11, xorg, libXi, libXcursor, libXdamage,
libXrandr, libXcomposite, libXext, libXfixes, libXrender, libXtst,
libXScrnSaver, nss, nspr, alsa-lib, cups, expat, udev, wrapGAppsHook,
hicolor-icon-theme, libuuid, at-spi2-core, at-spi2-atk, libappindicator-gtk3 }:
let
2021-01-15 05:42:41 +00:00
rpath = lib.makeLibraryPath [
alsa-lib
at-spi2-atk
at-spi2-core
atk
cairo
cups
dbus
expat
fontconfig
freetype
2019-05-22 12:03:39 +01:00
gdk-pixbuf
glib
2018-07-09 23:34:32 +01:00
gnome2.GConf
2019-02-24 10:25:34 +00:00
gtk3
pango
libappindicator-gtk3
libuuid
libX11
libXScrnSaver
libXcomposite
libXcursor
libXdamage
libXext
libXfixes
libXi
libXrandr
libXrender
libXtst
nspr
nss
stdenv.cc.cc
udev
xorg.libxcb
];
in
stdenv.mkDerivation rec {
pname = "mattermost-desktop";
version = "4.6.2";
src =
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = "https://releases.mattermost.com/desktop/${version}/${pname}-${version}-linux-x64.tar.gz";
sha256 = "0i836bc0gx375a9fm2cdxg84k03zhpx1z6jqxndf2m8pkfsblc3x";
}
else if stdenv.hostPlatform.system == "i686-linux" then
fetchurl {
url = "https://releases.mattermost.com/desktop/${version}/${pname}-${version}-linux-ia32.tar.gz";
sha256 = "04jv9hkmkh0jipv0fjdprnp5kmkjvf3c0fah6ysi21wmnmp5ab3m";
}
else
throw "Mattermost-Desktop is not currently supported on ${stdenv.hostPlatform.system}";
2019-02-25 09:13:49 +00:00
dontBuild = true;
dontConfigure = true;
dontPatchELF = true;
nativeBuildInputs = [ wrapGAppsHook ];
buildInputs = [ gtk3 hicolor-icon-theme ];
installPhase = ''
runHook preInstall
2019-02-25 09:13:49 +00:00
mkdir -p $out/share/mattermost-desktop
cp -R . $out/share/mattermost-desktop
2019-02-25 09:13:49 +00:00
mkdir -p "$out/bin"
ln -s $out/share/mattermost-desktop/mattermost-desktop \
$out/bin/mattermost-desktop
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
2019-11-14 15:38:01 +00:00
substituteInPlace \
$out/share/applications/Mattermost.desktop \
--replace /share/mattermost-desktop/mattermost-desktop /bin/mattermost-desktop
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
runHook postInstall
'';
meta = with lib; {
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 ];
};
}