2017-09-20 07:46:11 +00:00
|
|
|
{ stdenv, fetchurl, fetchFromGitHub, buildGoPackage }:
|
2016-08-15 01:17:05 +00:00
|
|
|
|
2017-09-20 07:46:11 +00:00
|
|
|
buildGoPackage rec {
|
2016-08-15 01:17:05 +00:00
|
|
|
name = "mattermost-${version}";
|
2017-11-18 05:05:02 +00:00
|
|
|
version = "4.4.1";
|
2016-08-15 01:17:05 +00:00
|
|
|
|
2017-09-20 07:46:11 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mattermost";
|
|
|
|
repo = "mattermost-server";
|
|
|
|
rev = "v${version}";
|
2017-11-16 18:00:29 +00:00
|
|
|
sha256 = "0imda96wgr2nkkxs2jfcqszx1fqgmbbrh7zqmgjh6ks3an1v4m3c";
|
2017-09-20 07:46:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
webApp = fetchurl {
|
2016-08-15 01:17:05 +00:00
|
|
|
url = "https://releases.mattermost.com/${version}/mattermost-team-${version}-linux-amd64.tar.gz";
|
2017-11-18 05:05:02 +00:00
|
|
|
sha256 = "1gnzv9xkqawi36z7v9xsy1gk16x71qf0kn8r059qvyarjlyp7888";
|
2016-08-15 01:17:05 +00:00
|
|
|
};
|
|
|
|
|
2017-11-05 20:56:33 +00:00
|
|
|
goPackagePath = "github.com/mattermost/mattermost-server";
|
2017-09-20 07:46:11 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
cd go/src/${goPackagePath}/cmd/platform
|
|
|
|
go install
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $bin
|
|
|
|
tar --strip 1 -C $bin -xf $webApp
|
2016-08-15 01:17:05 +00:00
|
|
|
'';
|
|
|
|
|
2017-09-20 07:46:11 +00:00
|
|
|
postInstall = ''
|
|
|
|
ln -s $bin/bin/platform $bin/bin/mattermost-platform
|
2016-08-15 01:17:05 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Open-Source, self-hosted Slack-alternative";
|
2017-08-01 20:03:30 +00:00
|
|
|
homepage = https://www.mattermost.org;
|
2016-08-15 01:17:05 +00:00
|
|
|
license = with licenses; [ agpl3 asl20 ];
|
2017-11-18 05:07:21 +00:00
|
|
|
maintainers = with maintainers; [ fpletz ryantm ];
|
2017-09-20 07:46:11 +00:00
|
|
|
platforms = platforms.unix;
|
2016-08-15 01:17:05 +00:00
|
|
|
};
|
|
|
|
}
|