git.iko.soy/typeable/nixpkgs
on master help sign in
mattermost: 4.8.0 -> 4.10.0
commite76711fe9d685553318939cfb25c3c23ea374eb6 authorRyan Mulligan <ryan@ryantm.com> dateWed 16 May 2018, 10:09 (9 years ago) parent8a93595
1 file changed+53−41
pkgs/servers/mattermost/default.nix+53−41
pkgs/servers/mattermost/default.nix+53−41
@@ -1,49 +1,61 @@
1−{ stdenv, fetchurl, fetchFromGitHub, buildGoPackage }:
1+{ stdenv, fetchurl, fetchFromGitHub, buildGoPackage, buildEnv }:
22
33let
4− version = "4.8.0";
5− goPackagePath = "github.com/mattermost/mattermost-server";
6− buildFlags = "-ldflags \"-X '${goPackagePath}/model.BuildNumber=nixpkgs-${version}'\"";
7−in
4+ version = "4.10.0";
85
9−buildGoPackage rec {
10− name = "mattermost-${version}";
6+ mattermost-server = buildGoPackage rec {
7+ name = "mattermost-server-${version}";
118
12− src = fetchFromGitHub {
13− owner = "mattermost";
14− repo = "mattermost-server";
15− rev = "v${version}";
16− sha256 = "16yf4p0n3klgh0zw2ikbahj9cy1wcxbwg86pld0yz63cfvfz5ns4";
17− };
9+ src = fetchFromGitHub {
10+ owner = "mattermost";
11+ repo = "mattermost-server";
12+ rev = "v${version}";
13+ sha256 = "02isw8qapp35pgriy4w1ar1ppvgc5a10j550hjbc1mylnhzkg1jf";
14+ };
15+
16+ goPackagePath = "github.com/mattermost/mattermost-server";
17+
18+ buildFlagsArray = ''
19+ -ldflags=
20+ -X ${goPackagePath}/model.BuildNumber=nixpkgs-${version}
21+ '';
22+
23+ postInstall = ''
24+ ln -s $bin/bin/mattermost-server $bin/bin/platform
25+ ln -s $bin/bin/mattermost-server $bin/bin/mattermost-platform
26+ '';
1827
19− webApp = fetchurl {
20− url = "https://releases.mattermost.com/${version}/mattermost-team-${version}-linux-amd64.tar.gz";
21− sha256 = "0ykp9apsv2514bircgay0xi0jigiai65cnb8q77v1qxjzdyx8s75";
2228 };
2329
24− inherit goPackagePath;
25−
26− buildPhase = ''
27− runHook preBuild
28− cd go/src/${goPackagePath}/cmd/platform
29− go install ${buildFlags}
30− runHook postBuild
31− '';
32−
33− preInstall = ''
34− mkdir -p $bin
35− tar --strip 1 -C $bin -xf $webApp
36− '';
37−
38− postInstall = ''
39− ln -s $bin/bin/platform $bin/bin/mattermost-platform
40− '';
41−
42− meta = with stdenv.lib; {
43− description = "Open-source, self-hosted Slack-alternative";
44− homepage = https://www.mattermost.org;
45− license = with licenses; [ agpl3 asl20 ];
46− maintainers = with maintainers; [ fpletz ryantm ];
47− platforms = platforms.unix;
30+ mattermost-webapp = stdenv.mkDerivation {
31+ name = "mattermost-webapp-${version}";
32+
33+ src = fetchurl {
34+ url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
35+ sha256 = "0pfj2dxl4qrv4w6yj0385nw0fa4flcg95kkahs0arwhan5bgifl5";
36+ };
37+
38+ installPhase = ''
39+ mkdir -p $out
40+ tar --strip 1 --directory $out -xf $src \
41+ mattermost/client \
42+ mattermost/i18n \
43+ mattermost/fonts \
44+ mattermost/templates \
45+ mattermost/config
46+ '';
4847 };
49−}
48+
49+in
50+ buildEnv {
51+ name = "mattermost-${version}";
52+ paths = [ mattermost-server mattermost-webapp ];
53+
54+ meta = with stdenv.lib; {
55+ description = "Open-source, self-hosted Slack-alternative";
56+ homepage = https://www.mattermost.org;
57+ license = with licenses; [ agpl3 asl20 ];
58+ maintainers = with maintainers; [ fpletz ryantm ];
59+ platforms = platforms.unix;
60+ };
61+ }