2023-02-02 18:25:31 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, fetchpatch, installShellFiles }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "sift";
|
|
|
|
version = "0.9.0";
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "svent";
|
|
|
|
repo = "sift";
|
2023-02-02 18:25:31 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-IZ4Hwg5NzdSXtrIDNxtkzquuiHQOmLV1HSx8gpwE/i0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
vendorHash = "sha256-y883la4R4jhsS99/ohgBC9SHggybAq9hreda6quG3IY=";
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Add Go Modules support
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/svent/sift/commit/b56fb3d0fd914c8a6c08b148e15dd8a07c7d8a5a.patch";
|
|
|
|
hash = "sha256-mFCEpkgQ8XDPRQ3yKDZ5qY9tKGSuHs+RnhMeAlx33Ng=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
postInstall = ''
|
2023-02-02 18:25:31 +00:00
|
|
|
installShellCompletion --cmd sift --bash sift-completion.bash
|
2022-05-18 14:49:53 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2020-11-03 02:18:15 +00:00
|
|
|
description = "A fast and powerful alternative to grep";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://sift-tool.org";
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ carlsverre viraptor ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
};
|
|
|
|
}
|