depot/third_party/nixpkgs/pkgs/tools/text/shfmt/default.nix
Default email a66bca1520 Project import generated by Copybara.
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
2022-12-17 11:02:37 +01:00

37 lines
1 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, scdoc }:
buildGoModule rec {
pname = "shfmt";
version = "3.6.0";
src = fetchFromGitHub {
owner = "mvdan";
repo = "sh";
rev = "v${version}";
sha256 = "sha256-hu08TouICK9tg8+QrAUWpzEAkJ1hHJEIz/UXL+jexrQ=";
};
vendorSha256 = "sha256-De/8PLio63xn2byfVzGVCdzRwFxzFMy0ftjB+VEBLrQ=";
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 ];
};
}