evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / sc / scaleway-cli / package.nix
blob3939c25b67bf7159bdc2a7acfa9aecef05e6903f
1 { lib, fetchFromGitHub, buildGoModule }:
3 buildGoModule rec {
4   pname = "scaleway-cli";
5   version = "2.34.0";
7   src = fetchFromGitHub {
8     owner = "scaleway";
9     repo = "scaleway-cli";
10     rev = "v${version}";
11     sha256 = "sha256-Ynhom4WX1ME6/uI0HQ83S1DgLYN1HjUxKk5CUL/Fgzk=";
12   };
14   vendorHash = "sha256-FHvppbAAKW2Nf5GKhMWoMuOgqAp6deOSE61hg7dASqo=";
16   ldflags = [
17     "-w"
18     "-extldflags"
19     "-static"
20     "-X main.Version=${version}"
21     "-X main.GitCommit=ref/tags/${version}"
22     "-X main.GitBranch=HEAD"
23     "-X main.BuildDate=unknown"
24   ];
26   doCheck = true;
28   # Some tests require access to scaleway's API, failing when sandboxed
29   preCheck = ''
30     substituteInPlace core/bootstrap_test.go \
31       --replace-warn "TestInterruptError" "SkipInterruptError"
32     substituteInPlace internal/e2e/errors_test.go \
33       --replace-warn "TestStandardErrors" "SkipStandardErrors"
34     substituteInPlace internal/e2e/human_test.go \
35       --replace-warn "TestTestCommand" "SkipTestCommand" \
36       --replace-warn "TestHumanCreate" "SkipHumanCreate" \
37       --replace-warn "TestHumanList" "SkipHumanList" \
38       --replace-warn "TestHumanUpdate" "SkipHumanUpdate" \
39       --replace-warn "TestHumanGet" "SkipHumanGet" \
40       --replace-warn "TestHumanDelete" "SkipHumanDelete"
41     substituteInPlace internal/e2e/sdk_errors_test.go \
42       --replace-warn "TestSdkStandardErrors" "SkipSdkStandardErrors"
43   '';
45   doInstallCheck = true;
47   installCheckPhase = ''
48     runHook preInstallCheck
50     $out/bin/scw --help
52     runHook postInstallCheck
53   '';
55   meta = with lib; {
56     description = "Interact with Scaleway API from the command line";
57     homepage = "https://github.com/scaleway/scaleway-cli";
58     license = licenses.mit;
59     maintainers = with maintainers; [ nickhu techknowlogick kashw2 ];
60   };