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