Files
nixpkgs/pkgs/by-name/or/oras/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

58 lines
1.5 KiB
Nix

{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
versionCheckHook,
}:
buildGoModule (finalAttrs: {
pname = "oras";
version = "1.3.0";
src = fetchFromGitHub {
owner = "oras-project";
repo = "oras";
tag = "v${finalAttrs.version}";
hash = "sha256-kGPHW+SSmCJhvhGxpzKFlc80sjYqeCEmwr/f0ltILE4=";
};
vendorHash = "sha256-TDYvYmzAgkL+ZrYKt9HTW7NQAGxd/cYu7e7MRYbW8ho=";
nativeBuildInputs = [ installShellFiles ];
excludedPackages = [ "./test/e2e" ];
ldflags = [
"-s"
"-w"
"-X oras.land/oras/internal/version.Version=${finalAttrs.version}"
"-X oras.land/oras/internal/version.BuildMetadata="
"-X oras.land/oras/internal/version.GitTreeState=clean"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd oras \
--bash <($out/bin/oras completion bash) \
--fish <($out/bin/oras completion fish) \
--zsh <($out/bin/oras completion zsh)
'';
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "version";
meta = {
homepage = "https://oras.land/";
changelog = "https://github.com/oras-project/oras/releases/tag/v${finalAttrs.version}";
description = "Distribute artifacts across OCI registries with ease";
mainProgram = "oras";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
jk
developer-guy
];
};
})