about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2017-11-08 17:45:42 +0000
committerGitHub <noreply@github.com>2017-11-08 17:45:42 +0000
commit999bcd098da0fc6b16ae769dde95573e6b110844 (patch)
treef18102342758a973f9cef66d6f51fac25fd3e8d3
parente9965b5b1970b70ecdba3a725aa723703377f5d9 (diff)
parente8c83704257f52e53e982fa8f577ba3f93520270 (diff)
downloadnixlib-999bcd098da0fc6b16ae769dde95573e6b110844.tar
nixlib-999bcd098da0fc6b16ae769dde95573e6b110844.tar.gz
nixlib-999bcd098da0fc6b16ae769dde95573e6b110844.tar.bz2
nixlib-999bcd098da0fc6b16ae769dde95573e6b110844.tar.lz
nixlib-999bcd098da0fc6b16ae769dde95573e6b110844.tar.xz
nixlib-999bcd098da0fc6b16ae769dde95573e6b110844.tar.zst
nixlib-999bcd098da0fc6b16ae769dde95573e6b110844.zip
Merge pull request #31296 from ryantm/mattermost43
mattermost, nixos/mattermost: update to 4.3.0
-rw-r--r--nixos/modules/services/web-apps/mattermost.nix2
-rw-r--r--pkgs/servers/mattermost/default.nix39
2 files changed, 28 insertions, 13 deletions
diff --git a/nixos/modules/services/web-apps/mattermost.nix b/nixos/modules/services/web-apps/mattermost.nix
index 0b637e3991b4..be74a2b1955b 100644
--- a/nixos/modules/services/web-apps/mattermost.nix
+++ b/nixos/modules/services/web-apps/mattermost.nix
@@ -173,7 +173,7 @@ in
 
         preStart = ''
           mkdir -p ${cfg.statePath}/{data,config,logs}
-          ln -sf ${pkgs.mattermost}/{bin,fonts,i18n,templates,webapp} ${cfg.statePath}
+          ln -sf ${pkgs.mattermost}/{bin,fonts,i18n,templates,client} ${cfg.statePath}
         '' + lib.optionalString (!cfg.mutableConfig) ''
           ln -sf ${mattermostConfJSON} ${cfg.statePath}/config/config.json
         '' + lib.optionalString cfg.mutableConfig ''
diff --git a/pkgs/servers/mattermost/default.nix b/pkgs/servers/mattermost/default.nix
index c99f939437b0..2bfe929784b8 100644
--- a/pkgs/servers/mattermost/default.nix
+++ b/pkgs/servers/mattermost/default.nix
@@ -1,22 +1,37 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, fetchFromGitHub, buildGoPackage }:
 
-stdenv.mkDerivation rec {
+buildGoPackage rec {
   name = "mattermost-${version}";
-  version = "4.1.0";
+  version = "4.3.0";
 
-  src = fetchurl {
+  src = fetchFromGitHub {
+    owner = "mattermost";
+    repo = "mattermost-server";
+    rev = "v${version}";
+    sha256 = "05119h3x81p8plfjq99khfywc3plv2zynvf83vkhj48zqk61wvbq";
+  };
+
+  webApp = fetchurl {
     url = "https://releases.mattermost.com/${version}/mattermost-team-${version}-linux-amd64.tar.gz";
-    sha256 = "0bp56i108pxsqcswxy1hdz3d8wq83lc29wcq6npimwx566rx4xhf";
+    sha256 = "0d30zj036nz6vwpiv0mn656j5r4br6y4x8iqc5jn785fiwk2pdls";
   };
 
-  installPhase = ''
-    mkdir -p $out
-    mv * $out/
-    ln -s ./platform $out/bin/mattermost-platform
+  goPackagePath = "github.com/mattermost/mattermost-server";
+
+  buildPhase = ''
+    runHook preBuild
+    cd go/src/${goPackagePath}/cmd/platform
+    go install
+    runHook postBuild
+  '';
+
+  preInstall = ''
+    mkdir -p $bin
+    tar --strip 1 -C $bin -xf $webApp
   '';
 
-  postFixup = ''
-    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/platform
+  postInstall = ''
+    ln -s $bin/bin/platform $bin/bin/mattermost-platform
   '';
 
   meta = with stdenv.lib; {
@@ -24,6 +39,6 @@ stdenv.mkDerivation rec {
     homepage = https://www.mattermost.org;
     license = with licenses; [ agpl3 asl20 ];
     maintainers = with maintainers; [ fpletz ];
-    platforms = [ "x86_64-linux" ];
+    platforms = platforms.unix;
   };
 }