From 444a4c09adaf123dd3809243886244bb24add380 Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Fri, 15 Nov 2024 18:28:53 +0100 Subject: [PATCH 1/2] grafana-reporter: fix build by creating mod file (cherry picked from commit a802b225640e048361ee4835ad8263715718bcc5) --- pkgs/by-name/gr/grafana-reporter/package.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/gr/grafana-reporter/package.nix b/pkgs/by-name/gr/grafana-reporter/package.nix index c7cb567d5722..3001b60b9ade 100644 --- a/pkgs/by-name/gr/grafana-reporter/package.nix +++ b/pkgs/by-name/gr/grafana-reporter/package.nix @@ -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"; From abf9bdb9078d02d2582d0ef7cb33499386ec8135 Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Fri, 15 Nov 2024 18:31:22 +0100 Subject: [PATCH 2/2] grafana-reporter: format using nixfmt (cherry picked from commit 7d8e2898c129a75a1688dc49589e71ab11eb3675) --- pkgs/by-name/gr/grafana-reporter/package.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/gr/grafana-reporter/package.nix b/pkgs/by-name/gr/grafana-reporter/package.nix index 3001b60b9ade..04a740d1bddb 100644 --- a/pkgs/by-name/gr/grafana-reporter/package.nix +++ b/pkgs/by-name/gr/grafana-reporter/package.nix @@ -1,9 +1,10 @@ -{ lib -, buildGoModule -, fetchFromGitHub -, fetchpatch2 -, tetex -, makeWrapper +{ + lib, + buildGoModule, + fetchFromGitHub, + fetchpatch2, + tetex, + makeWrapper, }: buildGoModule rec { pname = "reporter";