audiobookshelf: 2.18.1 -> 2.19.0 (#378967)
[NixPkgs.git] / pkgs / by-name / de / deepsource / package.nix
blob39f97281d73b2b5cef08f8f6ffa2793c0a81731c
2   lib,
3   stdenv,
4   installShellFiles,
5   buildGoModule,
6   fetchFromGitHub,
7   versionCheckHook,
8 }:
10 buildGoModule rec {
11   pname = "deepsource";
12   version = "0.8.6";
14   src = fetchFromGitHub {
15     owner = "DeepSourceCorp";
16     repo = "cli";
17     rev = "v${version}";
18     hash = "sha256-6uNb4cQVerrlW/eUkjmlO1i1YKYX3qaVdo0i5cczt+I=";
19   };
21   nativeBuildInputs = [ installShellFiles ];
23   doCheck = true;
25   checkFlags =
26     let
27       # Skip tests that require network access
28       skippedTests = [
29         "TestReportKeyValueWorkflow"
30         "TestReportAnalyzerTypeWorkflow"
31         "TestReportKeyValueFileWorkflow"
32       ];
33     in
34     [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
36   vendorHash = "sha256-SsMq4ngq3sSOL28ysHTxTF4CT9sIcCIW7yIhBxIPrNs=";
38   ldflags = [
39     "-s"
40     "-w"
41     "-X=main.version=${version}"
42   ];
44   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
45     installShellCompletion --cmd deepsource \
46       --bash <($out/bin/deepsource completion bash) \
47       --fish <($out/bin/deepsource completion fish) \
48       --zsh <($out/bin/deepsource completion zsh)
49   '';
51   doInstallCheck = true;
52   versionCheckProgramArg = [ "version" ];
53   nativeInstallCheckInputs = [
54     versionCheckHook
55   ];
57   meta = {
58     description = "Command line interface to DeepSource, the code health platform";
59     mainProgram = "deepsource";
60     homepage = "https://github.com/DeepSourceCorp/cli";
61     license = lib.licenses.bsd2;
62     maintainers = with lib.maintainers; [ nipeharefa ];
63   };