1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-08 19:45:42 +03:00

mattermost: build from source

at least the go part
This commit is contained in:
Jörg Thalheim 2017-09-20 08:46:11 +01:00 committed by Ryan Mulligan
parent 78d702f580
commit ec2f834fb1

View file

@ -1,22 +1,37 @@
{ stdenv, fetchurl }: { stdenv, fetchurl, fetchFromGitHub, buildGoPackage }:
stdenv.mkDerivation rec { buildGoPackage rec {
name = "mattermost-${version}"; name = "mattermost-${version}";
version = "4.2.0"; version = "4.2.0";
src = fetchurl { src = fetchFromGitHub {
owner = "mattermost";
repo = "mattermost-server";
rev = "v${version}";
sha256 = "0ngkdckd5bwh7ycnzspy9n16cqpk6pp9ifq8n19nkjlzynhsw2zd";
};
webApp = fetchurl {
url = "https://releases.mattermost.com/${version}/mattermost-team-${version}-linux-amd64.tar.gz"; url = "https://releases.mattermost.com/${version}/mattermost-team-${version}-linux-amd64.tar.gz";
sha256 = "0h52j1zmiij3g3rs10dr6xi2qdzqmb7xfj3rwbrlnvipjpnsa3v1"; sha256 = "0h52j1zmiij3g3rs10dr6xi2qdzqmb7xfj3rwbrlnvipjpnsa3v1";
}; };
installPhase = '' goPackagePath = "github.com/mattermost/platform";
mkdir -p $out
mv * $out/ buildPhase = ''
ln -s ./platform $out/bin/mattermost-platform runHook preBuild
cd go/src/${goPackagePath}/cmd/platform
go install
runHook postBuild
''; '';
postFixup = '' preInstall = ''
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/platform mkdir -p $bin
tar --strip 1 -C $bin -xf $webApp
'';
postInstall = ''
ln -s $bin/bin/platform $bin/bin/mattermost-platform
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
@ -24,6 +39,6 @@ stdenv.mkDerivation rec {
homepage = https://www.mattermost.org; homepage = https://www.mattermost.org;
license = with licenses; [ agpl3 asl20 ]; license = with licenses; [ agpl3 asl20 ];
maintainers = with maintainers; [ fpletz ]; maintainers = with maintainers; [ fpletz ];
platforms = [ "x86_64-linux" ]; platforms = platforms.unix;
}; };
} }