mmctl: 9.2.2 → 9.5.1, use override on mattermost

This makes the mmctl package be an override on the mattermost package,
as these were both moved by upstream into the same monorepo and use the
same build system. Nevertheless, it makes sense to keep them in separate
packages, as the mmctl utility is usually used on a different machine
than the mattermost server.

The meta information is retained as it was before (via an override).
This commit is contained in:
stuebinm 2024-02-27 19:38:04 +01:00
parent 923c6a8b5c
commit 221d194cb7
3 changed files with 5 additions and 48 deletions

View File

@ -1,8 +0,0 @@
--- a/go.mod
+++ b/go.mod
@@ -218,3 +218,5 @@ exclude (
github.com/dyatlov/go-opengraph v0.0.0-20210112100619-dae8665a5b09
github.com/willf/bitset v1.2.0
)
+
+replace github.com/mattermost/mattermost/server/public => ./public

View File

@ -1,43 +1,12 @@
{ lib
, fetchFromGitHub
, buildGoModule
{ mattermost
}:
buildGoModule rec {
mattermost.overrideAttrs (o: {
pname = "mmctl";
version = "9.2.2";
src = fetchFromGitHub {
owner = "mattermost";
repo = "mattermost";
rev = "v${version}";
hash = "sha256-53L2F20vaLLxtQS3DP/u0ZxLtnXHmjfcOMbXd4i+A6Y=";
} + "/server";
vendorHash = "sha256-v8aKZyb4emrwuIgSBDgla5wzwyt6PVGakbXjB9JVaCk=";
patches = [ ./0001-module-replace-public.patch ];
subPackages = [ "cmd/mmctl" ];
checkPhase = "go test -tags unit -timeout 30m ./cmd/mmctl/...";
ldflags = [
"-s"
"-w"
"-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}"
"-X github.com/mattermost/mattermost/server/public/model.BuildHashEnterprise=none"
"-X github.com/mattermost/mattermost/server/public/model.BuildEnterpriseReady=false"
];
meta = with lib; {
meta = o.meta // {
description = "A remote CLI tool for Mattermost";
homepage = "https://github.com/mattermost/mmctl";
license = licenses.asl20;
maintainers = with maintainers; [ ppom mgdelacroix ];
mainProgram = "mmctl";
};
}
})

View File

@ -5986,11 +5986,7 @@ with pkgs;
mlarchive2maildir = callPackage ../applications/networking/mailreaders/mlarchive2maildir { };
mmctl = callPackage ../tools/misc/mmctl {
# mmctl tests currently fail with go1.21. See
# https://mattermost.atlassian.net/browse/MM-55465
buildGoModule = buildGo120Module;
};
mmctl = callPackage ../tools/misc/mmctl { };
moar = callPackage ../tools/misc/moar { };