depot/third_party/nixpkgs/pkgs/tools/text/shfmt/default.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

28 lines
816 B
Nix

{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "shfmt";
version = "3.1.0";
src = fetchFromGitHub {
owner = "mvdan";
repo = "sh";
rev = "v${version}";
sha256 = "1k0bq4b4rv6wrh24jvcnpg1mfqrzqhl90zg4zibxzv3zkhjdskzh";
};
modSha256 = "080k8d5rp8kyg0x7vjxm758b9ya9z336yd4rcqws7yhqawxiv55z";
subPackages = ["cmd/shfmt"];
buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ];
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;
};
}