2020-10-31 00:22:22 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, scdoc }:
|
2016-06-15 16:39:43 +02:00
|
|
|
|
2020-01-12 08:33:16 +01:00
|
|
|
buildGoModule rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "shfmt";
|
2021-11-26 00:18:57 +01:00
|
|
|
version = "3.4.1";
|
2016-06-15 16:39:43 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mvdan";
|
|
|
|
repo = "sh";
|
2019-04-07 15:26:50 +02:00
|
|
|
rev = "v${version}";
|
2021-11-26 00:18:57 +01:00
|
|
|
sha256 = "sha256-Afu1KjbnIcXQZB8rrpCdgP/ud+tpCf8BrCCOCoSGcms=";
|
2016-06-15 16:39:43 +02:00
|
|
|
};
|
|
|
|
|
2021-10-02 01:29:40 +02:00
|
|
|
vendorSha256 = "sha256-ZYsQ+wE+G7xNrBN29npSxxPCz9+Wb/RsBzM5uwJkhO8=";
|
2020-06-26 14:38:19 +02:00
|
|
|
|
|
|
|
subPackages = [ "cmd/shfmt" ];
|
2020-01-12 08:33:16 +01:00
|
|
|
|
2021-08-01 23:41:18 +02:00
|
|
|
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
|
2020-04-08 02:59:35 +02:00
|
|
|
|
2020-10-31 00:22:22 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles scdoc ];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
scdoc < cmd/shfmt/shfmt.1.scd > shfmt.1
|
|
|
|
installManPage shfmt.1
|
|
|
|
'';
|
|
|
|
|
2020-02-23 08:22:25 +01:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/mvdan/sh";
|
2016-06-15 16:39:43 +02: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 18:38:46 +02:00
|
|
|
license = licenses.bsd3;
|
2021-03-08 21:05:12 +01:00
|
|
|
maintainers = with maintainers; [ zowoq SuperSandro2000 ];
|
2016-06-15 16:39:43 +02:00
|
|
|
};
|
2020-06-08 05:24:37 +02:00
|
|
|
}
|