From 221d194cb79299ffde6022161c0ed5ce06a5f025 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Tue, 27 Feb 2024 19:38:04 +0100 Subject: [PATCH] =?UTF-8?q?mmctl:=209.2.2=20=E2=86=92=209.5.1,=20use=20ove?= =?UTF-8?q?rride=20on=20mattermost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- .../mmctl/0001-module-replace-public.patch | 8 ---- pkgs/tools/misc/mmctl/default.nix | 39 ++----------------- pkgs/top-level/all-packages.nix | 6 +-- 3 files changed, 5 insertions(+), 48 deletions(-) delete mode 100644 pkgs/tools/misc/mmctl/0001-module-replace-public.patch diff --git a/pkgs/tools/misc/mmctl/0001-module-replace-public.patch b/pkgs/tools/misc/mmctl/0001-module-replace-public.patch deleted file mode 100644 index 2ac563dbbf4b..000000000000 --- a/pkgs/tools/misc/mmctl/0001-module-replace-public.patch +++ /dev/null @@ -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 diff --git a/pkgs/tools/misc/mmctl/default.nix b/pkgs/tools/misc/mmctl/default.nix index 197d145fc6c7..a884f24db470 100644 --- a/pkgs/tools/misc/mmctl/default.nix +++ b/pkgs/tools/misc/mmctl/default.nix @@ -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"; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e8a5bb73d67b..dd554e91fdbe 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };