[Backport release-24.11] grafana-reporter: fix build (#356400)

This commit is contained in:
Nick Cao 2024-11-17 09:16:14 -05:00 committed by GitHub
commit ffe59aaa5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,8 +1,10 @@
{ lib
, buildGoModule
, fetchFromGitHub
, tetex
, makeWrapper
{
lib,
buildGoModule,
fetchFromGitHub,
fetchpatch2,
tetex,
makeWrapper,
}:
buildGoModule rec {
pname = "reporter";
@ -17,20 +19,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";