depot/third_party/nixpkgs/pkgs/tools/text/shfmt/default.nix
Default email 2ce5db779a Project import generated by Copybara.
GitOrigin-RevId: 48037fd90426e44e4bf03e6479e88a11453b9b66
2022-05-18 16:49:53 +02:00

37 lines
1 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, scdoc }:
buildGoModule rec {
pname = "shfmt";
version = "3.5.0";
src = fetchFromGitHub {
owner = "mvdan";
repo = "sh";
rev = "v${version}";
sha256 = "sha256-ZhuOOZ+Lttan7R5YgpiM5okGNkSH0NRUj4hHd1ELbLI=";
};
vendorSha256 = "sha256-3eao9bORPTsyCFpafp89mcL2Y7HNBlDfUsTull7qnYs=";
subPackages = [ "cmd/shfmt" ];
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
nativeBuildInputs = [ installShellFiles scdoc ];
postBuild = ''
scdoc < cmd/shfmt/shfmt.1.scd > shfmt.1
installManPage shfmt.1
'';
meta = with lib; {
homepage = "https://github.com/mvdan/sh";
description = "A shell parser and formatter";
longDescription = ''
shfmt formats shell programs. It can use tabs or any number of spaces to indent.
You can feed it standard input, any number of files or any number of directories to recurse into.
'';
license = licenses.bsd3;
maintainers = with maintainers; [ zowoq SuperSandro2000 ];
};
}