2023-01-24 02:04:06 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, fetchpatch, installShellFiles }:
|
2016-06-25 19:57:11 +02:00
|
|
|
|
2023-01-24 02:04:06 +01:00
|
|
|
buildGoModule rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "sift";
|
2018-02-14 22:34:31 +01:00
|
|
|
version = "0.9.0";
|
2022-05-05 13:07:46 +02:00
|
|
|
|
2016-06-25 19:57:11 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "svent";
|
|
|
|
repo = "sift";
|
2023-01-24 02:04:06 +01:00
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-IZ4Hwg5NzdSXtrIDNxtkzquuiHQOmLV1HSx8gpwE/i0=";
|
2016-06-25 19:57:11 +02:00
|
|
|
};
|
|
|
|
|
2023-01-24 02:04:06 +01: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-05 13:07:46 +02:00
|
|
|
postInstall = ''
|
2023-01-24 02:04:06 +01:00
|
|
|
installShellCompletion --cmd sift --bash sift-completion.bash
|
2022-05-05 13:07:46 +02:00
|
|
|
'';
|
|
|
|
|
2016-06-25 19:57:11 +02:00
|
|
|
meta = with lib; {
|
2020-10-26 05:08:40 +01:00
|
|
|
description = "A fast and powerful alternative to grep";
|
2024-03-19 03:14:51 +01:00
|
|
|
mainProgram = "sift";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://sift-tool.org";
|
2024-01-10 01:06:37 +01:00
|
|
|
maintainers = with maintainers; [ viraptor ];
|
2016-06-25 19:57:11 +02:00
|
|
|
license = licenses.gpl3;
|
|
|
|
};
|
|
|
|
}
|