1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-27 16:11:58 +00:00
nixpkgs/pkgs/servers/mattermost/default.nix

50 lines
1.3 KiB
Nix
Raw Normal View History

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