summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/js/jsonschema/package.nix
blob: 5cf5096417810023b3052c5691080c32a249e322 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
  lib,
  buildGoModule,
  fetchFromGitHub,
  nix-update-script,
}:

buildGoModule (finalAttrs: {
  pname = "jsonschema";
  version = "0.7.0";

  src = fetchFromGitHub {
    owner = "santhosh-tekuri";
    repo = "jsonschema";
    tag = "cmd/jv/v${finalAttrs.version}";
    hash = "sha256-bMDDji5daBmjSeGxeS4PZfmTg+b8OVHsP8+m3jtpQJc=";
  };

  sourceRoot = "${finalAttrs.src.name}/cmd/jv";
  env.GOWORK = "off";
  passthru.updateScript = nix-update-script {
    extraArgs = [ "--version-regex=cmd/jv/v([\\d\\.]+)" ];
  };

  vendorHash = "sha256-s7kEdA4yuExuzwN3hHgeZmtkES3Zw1SALoEHSNtdAww=";

  ldflags = [
    "-s"
    "-w"
  ];

  meta = {
    description = "JSON schema compilation and validation";
    homepage = "https://github.com/santhosh-tekuri/jsonschema";
    changelog = "https://github.com/santhosh-tekuri/jsonschema/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.asl20;
    mainProgram = "jv";
    maintainers = with lib.maintainers; [ ibizaman ];
  };
})