2020-09-25 04:45:31 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, fetchpatch }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "shfmt";
|
2020-07-18 16:06:22 +00:00
|
|
|
version = "3.1.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mvdan";
|
|
|
|
repo = "sh";
|
|
|
|
rev = "v${version}";
|
2020-07-18 16:06:22 +00:00
|
|
|
sha256 = "03zgi0rlra3gz8cbqwmhpjxsg5048anfc6ccd2w50fjhx6farsnv";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
vendorSha256 = "1jq2x4yxshsy4ahp7nrry8dc9cyjj46mljs447rq57sgix4ndpq8";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
subPackages = [ "cmd/shfmt" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ];
|
|
|
|
|
2020-09-25 04:45:31 +00: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-04-24 23:36:52 +00:00
|
|
|
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;
|
2020-06-18 07:06:33 +00:00
|
|
|
maintainers = with maintainers; [ zowoq ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-06-18 07:06:33 +00:00
|
|
|
}
|