about summary refs log tree commit diff
path: root/pkgs/development/tools/manifest-tool/default.nix
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-01-25 12:01:34 +0000
committerGitHub <noreply@github.com>2023-01-25 12:01:34 +0000
commit20df8d00cc2e95ebfc7503f6cfc11ff05d0db403 (patch)
tree96a67882d22cd900e2a44e527d29538ac21b5dca /pkgs/development/tools/manifest-tool/default.nix
parenta2f216a00334b1350df235e7c6613c6f3e9022af (diff)
parent55e19102526fba191a5aa4b8dc4529bd3af298e2 (diff)
Merge master into staging-next
Diffstat (limited to 'pkgs/development/tools/manifest-tool/default.nix')
-rw-r--r--pkgs/development/tools/manifest-tool/default.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/pkgs/development/tools/manifest-tool/default.nix b/pkgs/development/tools/manifest-tool/default.nix
new file mode 100644
index 0000000000000..6282619535b92
--- /dev/null
+++ b/pkgs/development/tools/manifest-tool/default.nix
@@ -0,0 +1,51 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, git
+, stdenv
+, testers
+, manifest-tool
+}:
+
+buildGoModule rec {
+  pname = "manifest-tool";
+  version = "2.0.6";
+  gitCommit = "2ed9312726765567a84f2acc44a0c8a6e50f4b7a";
+  modRoot = "v2";
+
+  src = fetchFromGitHub {
+    owner = "estesp";
+    repo = "manifest-tool";
+    rev = "v${version}";
+    sha256 = "sha256-oopk++IdNF6msxOszT0fKxQABgWKbaQZ2aNH9chqWU0=";
+    leaveDotGit = true;
+    postFetch = ''
+      git -C $out rev-parse HEAD > $out/.git-revision
+      rm -rf $out/.git
+    '';
+  };
+
+  vendorHash = null;
+
+  nativeBuildInputs = [ git ];
+
+  preConfigure = ''
+    ldflags="-X main.gitCommit=$(cat .git-revision)"
+  '';
+
+  CGO_ENABLED = if stdenv.hostPlatform.isStatic then "0" else "1";
+  GO_EXTLINK_ENABLED = if stdenv.hostPlatform.isStatic then "0" else "1";
+  ldflags = lib.optionals stdenv.hostPlatform.isStatic [ "-w" "-extldflags" "-static" ];
+  tags = lib.optionals stdenv.hostPlatform.isStatic [ "netgo" ];
+
+  passthru.tests.version = testers.testVersion {
+    package = manifest-tool;
+  };
+
+  meta = with lib; {
+    description = "Command line tool to create and query container image manifest list/indexes";
+    homepage = "https://github.com/estesp/manifest-tool";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ tricktron ];
+  };
+}