docker-credential-helpers: 0.6.3 -> 0.7.0
This commit is contained in:
parent
dbed7c274f
commit
91d1af7d8c
|
@ -1,50 +1,52 @@
|
||||||
{ lib, stdenv, buildGoPackage, fetchFromGitHub, pkg-config, libsecret }:
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, pkg-config, libsecret, testers, docker-credential-helpers }:
|
||||||
|
|
||||||
buildGoPackage rec {
|
buildGoModule rec {
|
||||||
pname = "docker-credential-helpers";
|
pname = "docker-credential-helpers";
|
||||||
version = "0.6.3";
|
version = "0.7.0";
|
||||||
|
|
||||||
goPackagePath = "github.com/docker/docker-credential-helpers";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "docker";
|
owner = "docker";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "0xgmwjva3j1s0cqkbajbamj13bgzh5jkf2ir54m9a7w8gjnsh6dx";
|
sha256 = "sha256-KtDWrtd88s4Al3iWxIYE+YlhZTzf8/YDVYE2AwxH8ho=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
vendorSha256 = null;
|
||||||
|
|
||||||
nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config ];
|
nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config ];
|
||||||
|
|
||||||
buildInputs = lib.optionals stdenv.isLinux [ libsecret ];
|
buildInputs = lib.optionals stdenv.isLinux [ libsecret ];
|
||||||
|
|
||||||
|
ldflags = [
|
||||||
|
"-s"
|
||||||
|
"-w"
|
||||||
|
"-X github.com/docker/docker-credential-helpers/credentials.Version=${version}"
|
||||||
|
];
|
||||||
|
|
||||||
buildPhase =
|
buildPhase =
|
||||||
if stdenv.isDarwin
|
let
|
||||||
then ''
|
cmds = if stdenv.isDarwin then [ "osxkeychain" "pass" ] else [ "secretservice" "pass" ];
|
||||||
cd go/src/${goPackagePath}
|
in
|
||||||
go build -ldflags -s -o bin/docker-credential-osxkeychain osxkeychain/cmd/main_darwin.go
|
|
||||||
''
|
''
|
||||||
else ''
|
for cmd in ${builtins.toString cmds}; do
|
||||||
cd go/src/${goPackagePath}
|
go build -ldflags "${builtins.toString ldflags}" -trimpath -o bin/docker-credential-$cmd ./$cmd/cmd
|
||||||
go build -o bin/docker-credential-secretservice secretservice/cmd/main_linux.go
|
done
|
||||||
go build -o bin/docker-credential-pass pass/cmd/main_linux.go
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase =
|
installPhase = ''
|
||||||
if stdenv.isDarwin
|
install -Dm755 -t $out/bin bin/docker-credential-*
|
||||||
then ''
|
'';
|
||||||
install -Dm755 -t $out/bin bin/docker-credential-osxkeychain
|
|
||||||
''
|
passthru.tests.version = testers.testVersion {
|
||||||
else ''
|
package = docker-credential-helpers;
|
||||||
install -Dm755 -t $out/bin bin/docker-credential-pass
|
command = "docker-credential-pass version";
|
||||||
install -Dm755 -t $out/bin bin/docker-credential-secretservice
|
};
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Suite of programs to use native stores to keep Docker credentials safe";
|
description = "Suite of programs to use native stores to keep Docker credentials safe";
|
||||||
homepage = "https://github.com/docker/docker-credential-helpers";
|
homepage = "https://github.com/docker/docker-credential-helpers";
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
maintainers = [ maintainers.marsam ];
|
maintainers = with maintainers; [ marsam ];
|
||||||
platforms = platforms.linux ++ platforms.darwin;
|
|
||||||
} // lib.optionalAttrs stdenv.isDarwin {
|
} // lib.optionalAttrs stdenv.isDarwin {
|
||||||
mainProgram = "docker-credential-osxkeychain";
|
mainProgram = "docker-credential-osxkeychain";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue