2018-05-16 18:09:19 +01:00
|
|
|
{ stdenv, fetchurl, fetchFromGitHub, buildGoPackage, buildEnv }:
|
2016-08-15 02:17:05 +01:00
|
|
|
|
2018-02-23 17:50:33 +00:00
|
|
|
let
|
2019-02-08 22:26:37 +00:00
|
|
|
version = "5.7.1";
|
2018-02-23 17:50:33 +00:00
|
|
|
|
2018-05-16 18:09:19 +01:00
|
|
|
mattermost-server = buildGoPackage rec {
|
|
|
|
name = "mattermost-server-${version}";
|
2016-08-15 02:17:05 +01:00
|
|
|
|
2018-05-16 18:09:19 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mattermost";
|
|
|
|
repo = "mattermost-server";
|
|
|
|
rev = "v${version}";
|
2019-02-08 22:26:37 +00:00
|
|
|
sha256 = "1k4rd8383bz9q23wgxnqcp69hcixaa0zd256h54wmwqw6fdn3bc0";
|
2018-05-16 18:09:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
goPackagePath = "github.com/mattermost/mattermost-server";
|
|
|
|
|
|
|
|
buildFlagsArray = ''
|
|
|
|
-ldflags=
|
|
|
|
-X ${goPackagePath}/model.BuildNumber=nixpkgs-${version}
|
|
|
|
'';
|
|
|
|
|
2016-08-15 02:17:05 +01:00
|
|
|
};
|
|
|
|
|
2018-05-16 18:09:19 +01:00
|
|
|
mattermost-webapp = stdenv.mkDerivation {
|
|
|
|
name = "mattermost-webapp-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
|
2019-02-08 22:26:37 +00:00
|
|
|
sha256 = "0rxbgd3cb9m7rf0yg1vpd1af6x6bn0jilb0pfqr46dg42a70dx09";
|
2018-05-16 18:09:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
tar --strip 1 --directory $out -xf $src \
|
|
|
|
mattermost/client \
|
|
|
|
mattermost/i18n \
|
|
|
|
mattermost/fonts \
|
|
|
|
mattermost/templates \
|
|
|
|
mattermost/config
|
|
|
|
'';
|
2016-08-15 02:17:05 +01:00
|
|
|
};
|
2018-05-16 18:09:19 +01:00
|
|
|
|
|
|
|
in
|
|
|
|
buildEnv {
|
|
|
|
name = "mattermost-${version}";
|
|
|
|
paths = [ mattermost-server mattermost-webapp ];
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Open-source, self-hosted Slack-alternative";
|
|
|
|
homepage = https://www.mattermost.org;
|
|
|
|
license = with licenses; [ agpl3 asl20 ];
|
|
|
|
maintainers = with maintainers; [ fpletz ryantm ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|