2021-01-15 22:18:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-05-15 21:57:56 +00:00
|
|
|
, buildGoModule
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, gpgme
|
|
|
|
, lvm2
|
|
|
|
, btrfs-progs
|
|
|
|
, pkg-config
|
|
|
|
, go-md2man
|
|
|
|
, installShellFiles
|
2020-05-15 21:57:56 +00:00
|
|
|
, makeWrapper
|
|
|
|
, fuse-overlayfs
|
2022-04-15 01:41:22 +00:00
|
|
|
, dockerTools
|
2023-01-11 07:51:40 +00:00
|
|
|
, runCommand
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "skopeo";
|
2022-10-06 18:32:54 +00:00
|
|
|
version = "1.10.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "containers";
|
|
|
|
repo = "skopeo";
|
2022-10-06 18:32:54 +00:00
|
|
|
sha256 = "sha256-Q6gdkaIYTDUqDbjmE9TcRtQcHjpOJ3bXLJtN8NPp9KA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
outputs = [ "out" "man" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
vendorSha256 = null;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config go-md2man installShellFiles makeWrapper ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ gpgme ]
|
2021-01-15 22:18:51 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ lvm2 btrfs-progs ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
buildPhase = ''
|
2021-04-05 15:23:46 +00:00
|
|
|
runHook preBuild
|
2020-05-29 06:06:01 +00:00
|
|
|
patchShebangs .
|
2022-07-14 12:49:19 +00:00
|
|
|
make bin/skopeo completions docs
|
2021-04-05 15:23:46 +00:00
|
|
|
runHook postBuild
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
installPhase = ''
|
2021-04-05 15:23:46 +00:00
|
|
|
runHook preInstall
|
2022-07-14 12:49:19 +00:00
|
|
|
PREFIX=$out make install-binary install-completions
|
|
|
|
PREFIX=$man make install-docs
|
2023-01-11 07:51:40 +00:00
|
|
|
install ${passthru.policy}/default-policy.json -Dt $out/etc/containers
|
2021-01-15 22:18:51 +00:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2020-05-15 21:57:56 +00:00
|
|
|
wrapProgram $out/bin/skopeo \
|
2021-01-15 22:18:51 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ fuse-overlayfs ]}
|
2021-04-05 15:23:46 +00:00
|
|
|
'' + ''
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
passthru = {
|
|
|
|
policy = runCommand "policy" { } ''
|
|
|
|
install ${src}/default-policy.json -Dt $out
|
|
|
|
'';
|
|
|
|
tests = {
|
|
|
|
inherit (dockerTools.examples) testNixFromDockerHub;
|
|
|
|
};
|
2022-04-15 01:41:22 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A command line utility for various operations on container images and image repositories";
|
|
|
|
homepage = "https://github.com/containers/skopeo";
|
|
|
|
maintainers = with maintainers; [ lewo ] ++ teams.podman.members;
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|