1{ lib, buildGoModule, fetchFromGitHub, fetchpatch, testers, docker-credential-gcr }:
2
3buildGoModule rec {
4 pname = "docker-credential-gcr";
5 version = "2.1.8";
6
7 src = fetchFromGitHub {
8 owner = "GoogleCloudPlatform";
9 repo = "docker-credential-gcr";
10 rev = "v${version}";
11 sha256 = "sha256-6f84NRqMx0NX+3g+pCYgRYkGK4DaQmUEau3oMswUmSE=";
12 };
13
14 patches = [
15 (fetchpatch {
16 name = "fix-TestGet_GCRCredentials.patch";
17 url = "https://github.com/GoogleCloudPlatform/docker-credential-gcr/commit/a0c080e58bbfdeb0aa24e66551c4e8b0359bf178.patch";
18 sha256 = "sha256-aXp/1kNaxqQDPszC7pO+qP7ZBWHjpVljUHiKFnnDWuM=";
19 })
20 ];
21
22 postPatch = ''
23 rm -rf ./test
24 '';
25
26 vendorHash = "sha256-e7XNTizZYp/tS7KRvB9KxY3Yurphnm6Ehz4dHZNReK8=";
27
28 CGO_ENABLED = 0;
29
30 ldflags = [
31 "-s"
32 "-w"
33 "-X github.com/GoogleCloudPlatform/docker-credential-gcr/config.Version=${version}"
34 ];
35
36 passthru.tests.version = testers.testVersion {
37 package = docker-credential-gcr;
38 command = "docker-credential-gcr version";
39 };
40
41 meta = with lib; {
42 description = "A Docker credential helper for GCR (https://gcr.io) users";
43 longDescription = ''
44 docker-credential-gcr is Google Container Registry's Docker credential
45 helper. It allows for Docker clients v1.11+ to easily make
46 authenticated requests to GCR's repositories (gcr.io, eu.gcr.io, etc.).
47 '';
48 homepage = "https://github.com/GoogleCloudPlatform/docker-credential-gcr";
49 license = licenses.asl20;
50 maintainers = with maintainers; [ suvash ];
51 };
52}