at 24.05-pre 57 lines 1.5 kB view raw
1{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, oras }: 2 3buildGoModule rec { 4 pname = "oras"; 5 version = "1.1.0"; 6 7 src = fetchFromGitHub { 8 owner = "oras-project"; 9 repo = "oras"; 10 rev = "v${version}"; 11 hash = "sha256-oWDxrxCrBU0quSpRLXZ0w1COuImVj4FzAmv8574x76o="; 12 }; 13 14 vendorHash = "sha256-51keQmj1eGT3rJysnfTWIl8xoHfz3NPL/qXegc3wwNc="; 15 16 nativeBuildInputs = [ installShellFiles ]; 17 18 excludedPackages = [ "./test/e2e" ]; 19 20 ldflags = [ 21 "-s" 22 "-w" 23 "-X oras.land/oras/internal/version.Version=${version}" 24 "-X oras.land/oras/internal/version.BuildMetadata=" 25 "-X oras.land/oras/internal/version.GitTreeState=clean" 26 ]; 27 28 postInstall = '' 29 installShellCompletion --cmd oras \ 30 --bash <($out/bin/oras completion bash) \ 31 --fish <($out/bin/oras completion fish) \ 32 --zsh <($out/bin/oras completion zsh) 33 ''; 34 35 doInstallCheck = true; 36 installCheckPhase = '' 37 runHook preInstallCheck 38 39 $out/bin/oras --help 40 $out/bin/oras version | grep "${version}" 41 42 runHook postInstallCheck 43 ''; 44 45 passthru.tests.version = testers.testVersion { 46 package = oras; 47 command = "oras version"; 48 }; 49 50 meta = with lib; { 51 homepage = "https://oras.land/"; 52 changelog = "https://github.com/oras-project/oras/releases/tag/v${version}"; 53 description = "The ORAS project provides a way to push and pull OCI Artifacts to and from OCI Registries"; 54 license = licenses.asl20; 55 maintainers = with maintainers; [ jk developer-guy ]; 56 }; 57}