1{ lib
2, fetchFromGitHub
3, fetchpatch
4, buildGoModule
5}:
6buildGoModule rec {
7 pname = "json-plot";
8 version = "1.1.12";
9
10 src = fetchFromGitHub {
11 owner = "sgreben";
12 repo = "jp";
13 rev = version;
14 hash = "sha256-WWARAh/CF3lGli3VLRzAGaCA8xQyryPi8WcuwvdInjk=";
15 };
16
17 vendorHash = "sha256-EPrlaUHAGATNFv3qgWKGmJdu9EHsV/0DJKEvQck+fWc=";
18
19 patches = [
20 # Add Go Modules support
21 (fetchpatch {
22 url = "https://github.com/sgreben/jp/commit/9516fb4d7c5b011071b4063ea8e8e9667e57a777.patch";
23 hash = "sha256-Vz5HnStrCpMN1L7dne7JDX5F57up3EBPPf/9hN9opRc=";
24 })
25 ];
26
27 ldflags = [ "-s" "-w" ];
28
29 meta = with lib; {
30 description = "Dead simple terminal plots from JSON (or CSV) data. Bar charts, line charts, scatter plots, histograms and heatmaps are supported.";
31 homepage = "https://github.com/sgreben/jp";
32 license = licenses.mit;
33 maintainers = with maintainers; [ urandom ];
34 mainProgram = "jp";
35 };
36}