lol

Merge pull request #193513 from aaronjheng/docker-credential-helpers-0.7.0

docker-credential-helpers: 0.6.3 -> 0.7.0

authored by

Mario Rodas and committed by
GitHub
213c5409 3f7fa3fe

+27 -25
+27 -25
pkgs/tools/admin/docker-credential-helpers/default.nix
··· 1 - { lib, stdenv, buildGoPackage, fetchFromGitHub, pkg-config, libsecret }: 1 + { lib, stdenv, buildGoModule, fetchFromGitHub, pkg-config, libsecret, testers, docker-credential-helpers }: 2 2 3 - buildGoPackage rec { 3 + buildGoModule rec { 4 4 pname = "docker-credential-helpers"; 5 - version = "0.6.3"; 6 - 7 - goPackagePath = "github.com/docker/docker-credential-helpers"; 5 + version = "0.7.0"; 8 6 9 7 src = fetchFromGitHub { 10 8 owner = "docker"; 11 9 repo = pname; 12 10 rev = "v${version}"; 13 - sha256 = "0xgmwjva3j1s0cqkbajbamj13bgzh5jkf2ir54m9a7w8gjnsh6dx"; 11 + sha256 = "sha256-KtDWrtd88s4Al3iWxIYE+YlhZTzf8/YDVYE2AwxH8ho="; 14 12 }; 15 13 14 + vendorSha256 = null; 15 + 16 16 nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config ]; 17 17 18 18 buildInputs = lib.optionals stdenv.isLinux [ libsecret ]; 19 19 20 + ldflags = [ 21 + "-s" 22 + "-w" 23 + "-X github.com/docker/docker-credential-helpers/credentials.Version=${version}" 24 + ]; 25 + 20 26 buildPhase = 21 - if stdenv.isDarwin 22 - then '' 23 - cd go/src/${goPackagePath} 24 - go build -ldflags -s -o bin/docker-credential-osxkeychain osxkeychain/cmd/main_darwin.go 27 + let 28 + cmds = if stdenv.isDarwin then [ "osxkeychain" "pass" ] else [ "secretservice" "pass" ]; 29 + in 25 30 '' 26 - else '' 27 - cd go/src/${goPackagePath} 28 - go build -o bin/docker-credential-secretservice secretservice/cmd/main_linux.go 29 - go build -o bin/docker-credential-pass pass/cmd/main_linux.go 31 + for cmd in ${builtins.toString cmds}; do 32 + go build -ldflags "${builtins.toString ldflags}" -trimpath -o bin/docker-credential-$cmd ./$cmd/cmd 33 + done 30 34 ''; 31 35 32 - installPhase = 33 - if stdenv.isDarwin 34 - then '' 35 - install -Dm755 -t $out/bin bin/docker-credential-osxkeychain 36 - '' 37 - else '' 38 - install -Dm755 -t $out/bin bin/docker-credential-pass 39 - install -Dm755 -t $out/bin bin/docker-credential-secretservice 40 - ''; 36 + installPhase = '' 37 + install -Dm755 -t $out/bin bin/docker-credential-* 38 + ''; 39 + 40 + passthru.tests.version = testers.testVersion { 41 + package = docker-credential-helpers; 42 + command = "docker-credential-pass version"; 43 + }; 41 44 42 45 meta = with lib; { 43 46 description = "Suite of programs to use native stores to keep Docker credentials safe"; 44 47 homepage = "https://github.com/docker/docker-credential-helpers"; 45 48 license = licenses.mit; 46 - maintainers = [ maintainers.marsam ]; 47 - platforms = platforms.linux ++ platforms.darwin; 49 + maintainers = with maintainers; [ marsam ]; 48 50 } // lib.optionalAttrs stdenv.isDarwin { 49 51 mainProgram = "docker-credential-osxkeychain"; 50 52 };