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