2023-01-23 07:52:02 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, git
|
|
|
|
, stdenv
|
|
|
|
, testers
|
|
|
|
, manifest-tool
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "manifest-tool";
|
2024-03-15 00:18:57 +00:00
|
|
|
version = "2.1.6";
|
2023-01-23 07:52:02 +00:00
|
|
|
modRoot = "v2";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "estesp";
|
|
|
|
repo = "manifest-tool";
|
|
|
|
rev = "v${version}";
|
2024-03-15 00:18:57 +00:00
|
|
|
hash = "sha256-/u60hi/KnPVWlNh6nxjXpH0ct5PLVE44deGxhzbayD0=";
|
2023-01-23 07:52:02 +00:00
|
|
|
leaveDotGit = true;
|
|
|
|
postFetch = ''
|
|
|
|
git -C $out rev-parse HEAD > $out/.git-revision
|
|
|
|
rm -rf $out/.git
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
vendorHash = null;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ git ];
|
|
|
|
|
2024-01-08 12:44:09 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X main.version=${version}"
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isStatic [
|
|
|
|
"-linkmode=external"
|
|
|
|
"-extldflags"
|
|
|
|
"-static"
|
|
|
|
];
|
|
|
|
|
2023-01-23 07:52:02 +00:00
|
|
|
preConfigure = ''
|
2024-01-08 12:44:09 +00:00
|
|
|
export ldflags+=" -X main.gitCommit=$(cat .git-revision)"
|
2023-01-23 07:52:02 +00:00
|
|
|
'';
|
|
|
|
|
2024-01-08 12:44:09 +00:00
|
|
|
tags = lib.optionals stdenv.hostPlatform.isStatic [
|
|
|
|
"cgo"
|
|
|
|
"netgo"
|
|
|
|
"osusergo"
|
|
|
|
"static_build"
|
|
|
|
];
|
2023-01-23 08:22:25 +00:00
|
|
|
|
2023-01-23 07:52:02 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = manifest-tool;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Command line tool to create and query container image manifest list/indexes";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "manifest-tool";
|
2023-01-23 07:52:02 +00:00
|
|
|
homepage = "https://github.com/estesp/manifest-tool";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ tricktron ];
|
|
|
|
};
|
|
|
|
}
|