From 315d6e3930f12f69d609701e4f16be80117a0fba Mon Sep 17 00:00:00 2001 From: Aaron Jheng Date: Wed, 18 Jan 2023 06:43:57 +0000 Subject: [PATCH] oras: 0.15.1 -> 0.16.0 --- pkgs/development/tools/oras/default.nix | 31 +++++++++++++++++++------ 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/pkgs/development/tools/oras/default.nix b/pkgs/development/tools/oras/default.nix index b0adcadd8440..183e26d70494 100644 --- a/pkgs/development/tools/oras/default.nix +++ b/pkgs/development/tools/oras/default.nix @@ -1,25 +1,37 @@ -{ lib, stdenv, buildGoModule, fetchFromGitHub }: +{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles, testers, oras }: buildGoModule rec { pname = "oras"; - version = "0.15.1"; + version = "0.16.0"; src = fetchFromGitHub { owner = "oras-project"; repo = "oras"; rev = "v${version}"; - sha256 = "sha256-8QmMC4eB7WNxfEsVRUzv/gb7QmNBvcgDEENa1XxpCug="; + hash = "sha256-7fmrWkJ2f9LPaBB0vqLqPCCLpkdsS1gVfJ1xn6K/M3E="; }; - vendorSha256 = "sha256-THqrGnJnNDL6BJpRxeNLPjWB+SEUMUhiVOcJZDTM6n8="; + + vendorHash = "sha256-BLjGu1xk5OCNILc2es5Q0fEIqoexq/lHnJtHz72w6iI="; + + nativeBuildInputs = [ installShellFiles ]; + + excludedPackages = [ "./test/e2e" ]; 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" + "-X oras.land/oras/internal/version.Version=${version}" + "-X oras.land/oras/internal/version.BuildMetadata=" + "-X oras.land/oras/internal/version.GitTreeState=clean" ]; + postInstall = '' + installShellCompletion --cmd oras \ + --bash <($out/bin/oras completion bash) \ + --fish <($out/bin/oras completion fish) \ + --zsh <($out/bin/oras completion zsh) + ''; + doInstallCheck = true; installCheckPhase = '' runHook preInstallCheck @@ -30,6 +42,11 @@ buildGoModule rec { runHook postInstallCheck ''; + passthru.tests.version = testers.testVersion { + package = oras; + command = "oras version"; + }; + meta = with lib; { homepage = "https://oras.land/"; changelog = "https://github.com/oras-project/oras/releases/tag/v${version}";