2022-06-20 23:24:30 +00:00
|
|
|
{ lib
|
2022-06-29 21:13:54 +00:00
|
|
|
, buildGoModule
|
2022-06-20 23:24:30 +00:00
|
|
|
, fetchFromGitHub
|
2024-02-25 17:51:20 +00:00
|
|
|
, nix-update-script
|
2022-06-20 23:24:30 +00:00
|
|
|
, fetchurl
|
|
|
|
, nixosTests
|
|
|
|
}:
|
|
|
|
|
2022-06-29 21:13:54 +00:00
|
|
|
buildGoModule rec {
|
2022-06-20 23:24:30 +00:00
|
|
|
pname = "mattermost";
|
2024-02-25 17:49:15 +00:00
|
|
|
# ESR releases only.
|
2024-02-25 17:51:20 +00:00
|
|
|
# See https://docs.mattermost.com/upgrade/extended-support-release.html
|
|
|
|
# When a new ESR version is available (e.g. 8.1.x -> 9.5.x), update
|
|
|
|
# the version regex in passthru.updateScript as well.
|
2024-05-17 19:19:29 +00:00
|
|
|
version = "9.5.5";
|
2022-06-20 23:24:30 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mattermost";
|
mattermost: 7.10.2 -> 7.10.3
Fixes security issues MMSA-2023-00190, MMSA-2023-00175, MMSA-2023-00202, MMSA-2023-00174,
MMSA-2023-00169, MMSA-2023-00186, MMSA-2023-00200, MMSA-2023-00178, MMSA-2023-00185, MMSA-2023-00176,
MMSA-2023-00147 and MMSA-2023-00168.
Release announcement:
https://mattermost.com/blog/mattermost-security-updates-7-10-3-7-9-5-7-8-7-esr-released/
2023-07-08 08:17:04 +00:00
|
|
|
repo = "mattermost";
|
2022-06-20 23:24:30 +00:00
|
|
|
rev = "v${version}";
|
2024-05-17 19:19:29 +00:00
|
|
|
hash = "sha256-ZaFXuYm9SEE9ARN5PG8vjt9WnNfGiALilGzjfnDP7aA=";
|
2024-02-25 17:49:15 +00:00
|
|
|
};
|
2018-05-16 17:09:19 +00:00
|
|
|
|
2024-02-25 17:49:15 +00:00
|
|
|
# Needed because buildGoModule does not support go workspaces yet.
|
|
|
|
# We use go 1.22's workspace vendor command, which is not yet available
|
|
|
|
# in the default version of go used in nixpkgs, nor is it used by upstream:
|
|
|
|
# https://github.com/mattermost/mattermost/issues/26221#issuecomment-1945351597
|
2024-02-16 23:11:22 +00:00
|
|
|
overrideModAttrs = (_: {
|
2024-02-25 17:49:15 +00:00
|
|
|
buildPhase = ''
|
|
|
|
make setup-go-work
|
|
|
|
go work vendor -e
|
2024-02-16 23:11:22 +00:00
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
2022-06-20 23:24:30 +00:00
|
|
|
webapp = fetchurl {
|
|
|
|
url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
|
2024-05-17 19:19:29 +00:00
|
|
|
hash = "sha256-tgds8eTBeisuJcLgtx6zOiFUcVL1oU0LLbPqmh4SQUU=";
|
2016-08-15 01:17:05 +00:00
|
|
|
};
|
|
|
|
|
2024-02-25 17:49:15 +00:00
|
|
|
vendorHash = "sha256-TJCtgNf56A1U0EbV5gXjTro+YudVBRWiSZoBC3nJxnE=";
|
|
|
|
|
|
|
|
modRoot = "./server";
|
|
|
|
preBuild = ''
|
|
|
|
make setup-go-work
|
|
|
|
'';
|
2021-12-31 08:15:17 +00:00
|
|
|
|
2022-06-20 23:24:30 +00:00
|
|
|
subPackages = [ "cmd/mattermost" ];
|
2021-12-31 08:15:17 +00:00
|
|
|
|
2023-12-01 09:22:25 +00:00
|
|
|
tags = [ "production" ];
|
|
|
|
|
2022-06-20 23:24:30 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
2023-09-23 18:05:24 +00:00
|
|
|
"-X github.com/mattermost/mattermost/server/public/model.Version=${version}"
|
|
|
|
"-X github.com/mattermost/mattermost/server/public/model.BuildNumber=${version}-nixpkgs"
|
|
|
|
"-X github.com/mattermost/mattermost/server/public/model.BuildDate=1970-01-01"
|
|
|
|
"-X github.com/mattermost/mattermost/server/public/model.BuildHash=v${version}"
|
2023-12-01 09:22:25 +00:00
|
|
|
"-X github.com/mattermost/mattermost/server/public/model.BuildHashEnterprise=none"
|
2023-09-23 18:05:24 +00:00
|
|
|
"-X github.com/mattermost/mattermost/server/public/model.BuildEnterpriseReady=false"
|
2022-06-20 23:24:30 +00:00
|
|
|
];
|
2021-12-31 08:15:17 +00:00
|
|
|
|
2022-06-20 23:24:30 +00:00
|
|
|
postInstall = ''
|
|
|
|
tar --strip 1 --directory $out -xf $webapp \
|
|
|
|
mattermost/{client,i18n,fonts,templates,config}
|
2018-05-16 17:09:19 +00:00
|
|
|
|
2022-06-20 23:24:30 +00:00
|
|
|
# For some reason a bunch of these files are executable
|
|
|
|
find $out/{client,i18n,fonts,templates,config} -type f -exec chmod -x {} \;
|
|
|
|
'';
|
2018-05-16 17:09:19 +00:00
|
|
|
|
2024-02-25 17:51:20 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script {
|
2024-05-06 03:35:55 +00:00
|
|
|
extraArgs = [ "--version-regex" "v(9\.5\.[0-9]+)" ];
|
2024-02-25 17:51:20 +00:00
|
|
|
};
|
|
|
|
tests.mattermost = nixosTests.mattermost;
|
|
|
|
};
|
2022-01-23 23:56:02 +00:00
|
|
|
|
2022-06-20 23:24:30 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Mattermost is an open source platform for secure collaboration across the entire software development lifecycle";
|
|
|
|
homepage = "https://www.mattermost.org";
|
2024-03-19 12:26:06 +00:00
|
|
|
license = with licenses; [ agpl3Only asl20 ];
|
2023-12-01 09:22:25 +00:00
|
|
|
maintainers = with maintainers; [ ryantm numinit kranzes mgdelacroix ];
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "mattermost";
|
2016-08-15 01:17:05 +00:00
|
|
|
};
|
2022-06-20 23:24:30 +00:00
|
|
|
}
|