1{ lib, stdenv, buildGoModule, fetchFromGitHub }:
2
3buildGoModule rec {
4 pname = "oras";
5 version = "0.15.1";
6
7 src = fetchFromGitHub {
8 owner = "oras-project";
9 repo = "oras";
10 rev = "v${version}";
11 sha256 = "sha256-8QmMC4eB7WNxfEsVRUzv/gb7QmNBvcgDEENa1XxpCug=";
12 };
13 vendorSha256 = "sha256-THqrGnJnNDL6BJpRxeNLPjWB+SEUMUhiVOcJZDTM6n8=";
14
15 ldflags = [
16 "-s"
17 "-w"
18 "-X github.com/oras-project/oras/internal/version.Version=${version}"
19 "-X github.com/oras-project/oras/internal/version.BuildMetadata="
20 "-X github.com/oras-project/oras/internal/version.GitTreeState=clean"
21 ];
22
23 doInstallCheck = true;
24 installCheckPhase = ''
25 runHook preInstallCheck
26
27 $out/bin/oras --help
28 $out/bin/oras version | grep "${version}"
29
30 runHook postInstallCheck
31 '';
32
33 meta = with lib; {
34 homepage = "https://oras.land/";
35 changelog = "https://github.com/oras-project/oras/releases/tag/v${version}";
36 description = "The ORAS project provides a way to push and pull OCI Artifacts to and from OCI Registries";
37 license = licenses.asl20;
38 maintainers = with maintainers; [ jk ];
39 };
40}