grafana-reporter: fix build by creating mod file

(cherry picked from commit a802b22564)
This commit is contained in:
Noa Aarts 2024-11-15 18:28:53 +01:00 committed by github-actions[bot]
parent 201a24e649
commit 444a4c09ad

View File

@ -1,6 +1,7 @@
{ lib
, buildGoModule
, fetchFromGitHub
, fetchpatch2
, tetex
, makeWrapper
}:
@ -17,20 +18,21 @@ buildGoModule rec {
nativeBuildInputs = [ makeWrapper ];
vendorHash = null;
vendorHash = "sha256-QlNOx2jm1LVz066t9khppf//T5c9z3YUrSOr6qzbUzI=";
postPatch = ''
go mod init github.com/IzakMarais/reporter
'';
patches = [
(fetchpatch2 {
name = "use-go-mod-and-remove-vendor-dirs";
url = "https://github.com/IzakMarais/reporter/commit/e844b3f624e0da3a960f98cade427fe54f595504.patch";
hash = "sha256-CdI7/mkYG6t6H6ydGu7atwk18DpagdP7uzfrZVKKlhA=";
})
];
postInstall = ''
wrapProgram $out/bin/grafana-reporter \
--prefix PATH : ${lib.makeBinPath [ tetex ]}
'';
# Testing library used had a breaking API change and upstream didn't adapt.
doCheck = false;
meta = {
description = "PDF report generator from a Grafana dashboard";
mainProgram = "grafana-reporter";