2020-08-21 07:28:54 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, fetchpatch }:
|
2016-06-15 15:39:43 +01:00
|
|
|
|
2020-01-12 07:33:16 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "shfmt";
|
2020-06-26 13:38:19 +01:00
|
|
|
version = "3.1.2";
|
2016-06-15 15:39:43 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mvdan";
|
|
|
|
repo = "sh";
|
2019-04-07 14:26:50 +01:00
|
|
|
rev = "v${version}";
|
2020-06-26 13:38:19 +01:00
|
|
|
sha256 = "03zgi0rlra3gz8cbqwmhpjxsg5048anfc6ccd2w50fjhx6farsnv";
|
2016-06-15 15:39:43 +01:00
|
|
|
};
|
|
|
|
|
2020-05-01 02:59:00 +01:00
|
|
|
vendorSha256 = "1jq2x4yxshsy4ahp7nrry8dc9cyjj46mljs447rq57sgix4ndpq8";
|
2020-06-26 13:38:19 +01:00
|
|
|
|
|
|
|
subPackages = [ "cmd/shfmt" ];
|
2020-01-12 07:33:16 +00:00
|
|
|
|
2020-04-08 01:59:35 +01:00
|
|
|
buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ];
|
|
|
|
|
2020-08-21 07:28:54 +01:00
|
|
|
patches = [
|
|
|
|
# fix failing test on go 1.15, remove with > 3.1.2
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/mvdan/sh/commit/88956f97dae1f268af6c030bf2ba60762ebb488a.patch";
|
|
|
|
sha256 = "1zg8i7kklr12zjkaxh8djd2bzkdx8klgfj271r2wivkc2x61shgv";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-02-23 07:22:25 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/mvdan/sh";
|
2016-06-15 15:39:43 +01: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 17:38:46 +01:00
|
|
|
license = licenses.bsd3;
|
2020-06-08 04:24:37 +01:00
|
|
|
maintainers = with maintainers; [ zowoq ];
|
2016-06-15 15:39:43 +01:00
|
|
|
};
|
2020-06-08 04:24:37 +01:00
|
|
|
}
|