2022-03-30 09:31:56 +00:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub }:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "oras";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "0.15.1";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "oras-project";
|
|
|
|
repo = "oras";
|
|
|
|
rev = "v${version}";
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-8QmMC4eB7WNxfEsVRUzv/gb7QmNBvcgDEENa1XxpCug=";
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
2022-10-30 15:09:59 +00:00
|
|
|
vendorSha256 = "sha256-THqrGnJnNDL6BJpRxeNLPjWB+SEUMUhiVOcJZDTM6n8=";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/oras-project/oras/internal/version.Version=${version}"
|
|
|
|
"-X github.com/oras-project/oras/internal/version.BuildMetadata="
|
|
|
|
"-X github.com/oras-project/oras/internal/version.GitTreeState=clean"
|
|
|
|
];
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
|
|
|
$out/bin/oras --help
|
|
|
|
$out/bin/oras version | grep "${version}"
|
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://oras.land/";
|
|
|
|
changelog = "https://github.com/oras-project/oras/releases/tag/v${version}";
|
|
|
|
description = "The ORAS project provides a way to push and pull OCI Artifacts to and from OCI Registries";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ jk ];
|
|
|
|
};
|
|
|
|
}
|