2020-10-30 16:22:22 -07:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, scdoc }:
|
2016-06-15 07:39:43 -07:00
|
|
|
|
2020-01-11 23:33:16 -08:00
|
|
|
buildGoModule rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "shfmt";
|
2021-03-08 11:32:47 -08:00
|
|
|
version = "3.2.4";
|
2016-06-15 07:39:43 -07:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mvdan";
|
|
|
|
repo = "sh";
|
2019-04-07 06:26:50 -07:00
|
|
|
rev = "v${version}";
|
2021-03-08 11:32:47 -08:00
|
|
|
sha256 = "sha256-BkvsCIcm3qnfECNhY3DIPnBRih6D7rOHOQu9oc0YDZA=";
|
2016-06-15 07:39:43 -07:00
|
|
|
};
|
|
|
|
|
2020-10-30 15:18:53 -07:00
|
|
|
vendorSha256 = "1ma7nvyn6ylbi8bd7x900i94pzs877kfy9xh0nf1bbify1vcpd29";
|
2020-06-26 05:38:19 -07:00
|
|
|
|
|
|
|
subPackages = [ "cmd/shfmt" ];
|
2020-01-11 23:33:16 -08:00
|
|
|
|
2020-04-07 17:59:35 -07:00
|
|
|
buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ];
|
|
|
|
|
2020-10-30 16:22:22 -07:00
|
|
|
nativeBuildInputs = [ installShellFiles scdoc ];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
scdoc < cmd/shfmt/shfmt.1.scd > shfmt.1
|
|
|
|
installManPage shfmt.1
|
|
|
|
'';
|
|
|
|
|
2020-02-22 23:22:25 -08:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/mvdan/sh";
|
2016-06-15 07:39:43 -07:00
|
|
|
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.
|
|
|
|
'';
|
2018-08-04 09:38:46 -07:00
|
|
|
license = licenses.bsd3;
|
2020-06-07 20:24:37 -07:00
|
|
|
maintainers = with maintainers; [ zowoq ];
|
2016-06-15 07:39:43 -07:00
|
|
|
};
|
2020-06-07 20:24:37 -07:00
|
|
|
}
|