2021-10-20 16:23:30 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
|
|
|
|
, fetchurl
|
2021-11-02 17:42:57 +00:00
|
|
|
|
, atomEnv
|
|
|
|
|
, systemd
|
|
|
|
|
, pulseaudio
|
|
|
|
|
, libxshmfence
|
|
|
|
|
, libnotify
|
2021-10-20 16:23:30 +00:00
|
|
|
|
, libappindicator-gtk3
|
2021-11-02 17:42:57 +00:00
|
|
|
|
, wrapGAppsHook
|
|
|
|
|
, autoPatchelfHook
|
2021-10-20 16:23:30 +00:00
|
|
|
|
}:
|
2019-11-06 00:16:15 +00:00
|
|
|
|
|
2018-06-13 11:27:29 +00:00
|
|
|
|
let
|
|
|
|
|
|
2021-10-20 16:23:30 +00:00
|
|
|
|
pname = "mattermost-desktop";
|
2022-06-18 09:31:42 +00:00
|
|
|
|
version = "5.1.0";
|
2021-11-02 17:42:57 +00:00
|
|
|
|
|
|
|
|
|
srcs = {
|
|
|
|
|
"x86_64-linux" = {
|
|
|
|
|
url = "https://releases.mattermost.com/desktop/${version}/${pname}-${version}-linux-x64.tar.gz";
|
2022-06-18 09:31:42 +00:00
|
|
|
|
hash = "sha256-KmtQUqg2ODbZ6zJjsnwlvB+vhR1xbK2X9qqmZpyTR78=";
|
2021-11-02 17:42:57 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
"i686-linux" = {
|
|
|
|
|
url = "https://releases.mattermost.com/desktop/${version}/${pname}-${version}-linux-ia32.tar.gz";
|
2022-06-18 09:31:42 +00:00
|
|
|
|
hash = "sha256-X8Zrthw1hZOqmcYidt72l2vonh31iiA3EDGmCQr7e4c=";
|
2021-11-02 17:42:57 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
inherit (stdenv.hostPlatform) system;
|
|
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
|
|
src = fetchurl (srcs."${system}" or (throw "Unsupported system ${system}"));
|
2018-06-13 11:27:29 +00:00
|
|
|
|
|
2021-10-20 16:23:30 +00:00
|
|
|
|
dontBuild = true;
|
|
|
|
|
dontConfigure = true;
|
2021-11-02 17:42:57 +00:00
|
|
|
|
dontStrip = true;
|
2019-02-25 09:13:49 +00:00
|
|
|
|
|
2021-11-02 17:42:57 +00:00
|
|
|
|
nativeBuildInputs = [ wrapGAppsHook autoPatchelfHook ];
|
2021-05-07 15:00:53 +00:00
|
|
|
|
|
2021-11-02 17:42:57 +00:00
|
|
|
|
buildInputs = atomEnv.packages ++ [
|
|
|
|
|
libxshmfence
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
runtimeDependencies = [
|
|
|
|
|
(lib.getLib systemd)
|
|
|
|
|
pulseaudio
|
|
|
|
|
libnotify
|
|
|
|
|
libappindicator-gtk3
|
|
|
|
|
];
|
2019-11-06 00:16:15 +00:00
|
|
|
|
|
2021-10-20 16:23:30 +00:00
|
|
|
|
installPhase = ''
|
|
|
|
|
runHook preInstall
|
2021-05-07 15:00:53 +00:00
|
|
|
|
|
2021-11-02 17:42:57 +00:00
|
|
|
|
# Mattermost tarball comes with executable bit set for everything.
|
|
|
|
|
# We’ll apply it only to files that need it.
|
|
|
|
|
find . -type f -print0 | xargs -0 chmod -x
|
|
|
|
|
find . -type f \( -name '*.so.*' -o -name '*.s[oh]' \) -print0 | xargs -0 chmod +x
|
|
|
|
|
chmod +x mattermost-desktop chrome-sandbox
|
|
|
|
|
|
2021-10-20 16:23:30 +00:00
|
|
|
|
mkdir -p $out/share/mattermost-desktop
|
|
|
|
|
cp -R . $out/share/mattermost-desktop
|
2018-06-13 11:27:29 +00:00
|
|
|
|
|
2021-10-20 16:23:30 +00:00
|
|
|
|
mkdir -p "$out/bin"
|
2021-11-02 17:42:57 +00:00
|
|
|
|
ln -s $out/share/mattermost-desktop/mattermost-desktop $out/bin/mattermost-desktop
|
2018-06-13 11:27:29 +00:00
|
|
|
|
|
2021-10-20 16:23:30 +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
|
2021-11-02 17:42:57 +00:00
|
|
|
|
chmod -x Mattermost.desktop
|
2021-10-20 16:23:30 +00:00
|
|
|
|
mv Mattermost.desktop $out/share/applications/Mattermost.desktop
|
2021-11-02 17:42:57 +00:00
|
|
|
|
substituteInPlace $out/share/applications/Mattermost.desktop \
|
2021-10-20 16:23:30 +00:00
|
|
|
|
--replace /share/mattermost-desktop/mattermost-desktop /bin/mattermost-desktop
|
2018-06-13 11:27:29 +00:00
|
|
|
|
|
2021-10-20 16:23:30 +00:00
|
|
|
|
runHook postInstall
|
|
|
|
|
'';
|
2018-06-13 11:27:29 +00:00
|
|
|
|
|
2021-10-20 16:23:30 +00:00
|
|
|
|
meta = with lib; {
|
|
|
|
|
description = "Mattermost Desktop client";
|
|
|
|
|
homepage = "https://about.mattermost.com/";
|
2022-06-04 22:19:25 +00:00
|
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2021-10-20 16:23:30 +00:00
|
|
|
|
license = licenses.asl20;
|
|
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
|
maintainers = [ maintainers.joko ];
|
|
|
|
|
};
|
|
|
|
|
}
|