From ac782ae4e01a32dc375976d67db3c1fe71bd6701 Mon Sep 17 00:00:00 2001 From: Ryan Mulligan Date: Fri, 23 Feb 2018 09:50:33 -0800 Subject: [PATCH] mattermost: add build number --- pkgs/servers/mattermost/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/mattermost/default.nix b/pkgs/servers/mattermost/default.nix index bff973d786a1..f0c1a0fcec55 100644 --- a/pkgs/servers/mattermost/default.nix +++ b/pkgs/servers/mattermost/default.nix @@ -1,8 +1,13 @@ { stdenv, fetchurl, fetchFromGitHub, buildGoPackage }: +let + version = "4.7.2"; + goPackagePath = "github.com/mattermost/mattermost-server"; + buildFlags = "-ldflags \"-X '${goPackagePath}/model.BuildNumber=nixpkgs-${version}'\""; +in + buildGoPackage rec { name = "mattermost-${version}"; - version = "4.7.2"; src = fetchFromGitHub { owner = "mattermost"; @@ -16,12 +21,12 @@ buildGoPackage rec { sha256 = "14gr7zzx77q862qccjcdwrzd6n8g2z8yngw8aa4g3q6hypsqi4v3"; }; - goPackagePath = "github.com/mattermost/mattermost-server"; + inherit goPackagePath; buildPhase = '' runHook preBuild cd go/src/${goPackagePath}/cmd/platform - go install + go install ${buildFlags} runHook postBuild ''; @@ -35,7 +40,7 @@ buildGoPackage rec { ''; meta = with stdenv.lib; { - description = "Open-Source, self-hosted Slack-alternative"; + description = "Open-source, self-hosted Slack-alternative"; homepage = https://www.mattermost.org; license = with licenses; [ agpl3 asl20 ]; maintainers = with maintainers; [ fpletz ryantm ];