Unverified Commit 24f7948c authored by Florian Klink's avatar Florian Klink Committed by GitHub
Browse files

k2tf: 0.7.0 -> 0.8.0; add install check and update script (#498716)

parents f40f639e 69720f60
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -2,30 +2,25 @@
  lib,
  buildGoModule,
  fetchFromGitHub,
  fetchpatch,
  versionCheckHook,
  nix-update-script,
}:

buildGoModule (finalAttrs: {
  pname = "k2tf";
  version = "0.7.0";
  version = "0.8.0";

  src = fetchFromGitHub {
    owner = "sl1pm4t";
    repo = "k2tf";
    rev = "v${finalAttrs.version}";
    sha256 = "sha256-zkkRzCTZCvbwBj4oIhTo5d3PvqLMJPzT3zV9jU3PEJs=";
    tag = "v${finalAttrs.version}";
    hash = "sha256-LoYlX2kAfzI0GMUbBtvuOinDzvoHABKEaGhipe16FeA=";
  };

  patches = [
    # update dependencies
    # https://github.com/sl1pm4t/k2tf/pull/111
    (fetchpatch {
      url = "https://github.com/sl1pm4t/k2tf/commit/7e7b778eeb80400cb0dadb1cdea4e617b5738147.patch";
      hash = "sha256-ZGQUuH7u3aNLml6rvOzOxVwSTlbhZLknXbHKeY4lp00=";
    })
  ];
  proxyVendor = true;
  vendorHash = "sha256-h8ph8K/4luTUCkx5X1iakTubF651HblGDN4G1EtSKeE=";

  vendorHash = "sha256-yGuoE1bgwVHk3ym382OC93me9HPlVoNgGo/3JROVC2E=";
  subPackages = [ "." ];

  ldflags = [
    "-s"
@@ -34,6 +29,11 @@ buildGoModule (finalAttrs: {
    "-X main.commit=v${finalAttrs.version}"
  ];

  nativeInstallCheckInputs = [ versionCheckHook ];
  doInstallCheck = true;

  passthru.updateScript = nix-update-script { extraArgs = [ "--use-github-releases" ]; };

  meta = {
    description = "Kubernetes YAML to Terraform HCL converter";
    mainProgram = "k2tf";