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