From ac92027e5a90dc03b84772953395cfaeb17c93e9 Mon Sep 17 00:00:00 2001 From: Nipe Setiawan Harefa Date: Thu, 24 Oct 2024 22:06:11 +0700 Subject: [PATCH] maintainers: add nipeharefa --- maintainers/maintainer-list.nix | 6 ++++ pkgs/by-name/de/deepsource/package.nix | 47 ++++++++++++++++++++++---- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index c22ecbdce8cf38..5521b453b968f6 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -14436,6 +14436,12 @@ githubId = 3159451; name = "Nicolas Schneider"; }; + nipeharefa = { + name = "Nipe Harefa"; + email = "nipeharefa@gmail.com"; + github = "nipeharefa"; + githubId = 12620257; + }; NIS = { name = "NSC IT Solutions"; github = "dev-nis"; diff --git a/pkgs/by-name/de/deepsource/package.nix b/pkgs/by-name/de/deepsource/package.nix index fd04f354a7f4be..4c4fdaa10c03f4 100644 --- a/pkgs/by-name/de/deepsource/package.nix +++ b/pkgs/by-name/de/deepsource/package.nix @@ -1,9 +1,20 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ + lib, + stdenv, + installShellFiles, + buildGoModule, + fetchFromGitHub, + versionCheckHook, +}: buildGoModule rec { pname = "deepsource"; version = "0.8.6"; + nativeBuildInputs = [ installShellFiles ]; + nativeInstallCheckInputs = [ + versionCheckHook + ]; src = fetchFromGitHub { owner = "DeepSourceCorp"; repo = "cli"; @@ -11,17 +22,39 @@ buildGoModule rec { hash = "sha256-6uNb4cQVerrlW/eUkjmlO1i1YKYX3qaVdo0i5cczt+I="; }; - doCheck = false; - doInstallCheck = true; + doCheck = true; + + checkFlags = + let + # Skip tests that require network access + skippedTests = [ + "TestReportKeyValueWorkflow" + "TestReportAnalyzerTypeWorkflow" + "TestReportKeyValueFileWorkflow" + ]; + in + [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; vendorHash = "sha256-SsMq4ngq3sSOL28ysHTxTF4CT9sIcCIW7yIhBxIPrNs="; - ldflags = [ "-s" "-w" "-X=main.version=${version}" ]; + ldflags = [ + "-s" + "-w" + "-X=main.version=${version}" + ]; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd deepsource \ + --bash <($out/bin/deepsource completion bash) \ + --fish <($out/bin/deepsource completion fish) \ + --zsh <($out/bin/deepsource completion zsh) + ''; - meta = with lib; { - description = "Command line interface to DeepSource"; + meta = { + description = "Command line interface to DeepSource, the code health platform"; mainProgram = "deepsource"; homepage = "https://github.com/DeepSourceCorp/cli"; - license = licenses.bsd3; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ nipeharefa ]; }; }