{ lib, stdenv, buildGoModule, sources, makeWrapper, installShellFiles, pkg-config, openssl, xz, go, }: let src = sources.mender-cli; in buildGoModule { inherit (src) pname version src vendorHash; nativeBuildInputs = [ makeWrapper installShellFiles pkg-config ]; buildInputs = [ openssl xz ]; allowGoReference = true; postFixup = '' wrapProgram "$out/bin/mender-cli" \ --prefix PATH : ${go}/bin ''; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd mender-cli \ --bash <($out/bin/mender-cli completion bash) \ --fish <($out/bin/mender-cli completion fish) \ --zsh <($out/bin/mender-cli completion zsh) \ ''; meta = { description = "Mender CLI tool to simplify integration between the Mender server and cloud services like continuous integration (CI)/build automation"; mainProgram = "mender-cli"; homepage = "https://github.com/mendersoftware/mender-cli/"; changelog = "https://github.com/mendersoftware/mender-cli/releases/tag/${src.version}"; license = lib.licenses.asl20; }; }