nixpkgs/pkgs/tools/text/vgrep/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

34 lines
802 B
Nix

{ lib, buildGoModule, fetchFromGitHub, go-md2man, installShellFiles }:
buildGoModule rec {
pname = "vgrep";
version = "2.7.0";
src = fetchFromGitHub {
owner = "vrothberg";
repo = pname;
rev = "v${version}";
hash = "sha256-+KZNNkTuZyF02YDZX3u1KdhOcZ3+Ud6aDGL/sGUN1hI=";
};
vendorHash = null;
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
nativeBuildInputs = [ go-md2man installShellFiles ];
postBuild = ''
sed -i '/SHELL= /d' Makefile
make docs
installManPage docs/*.[1-9]
'';
meta = with lib; {
description = "User-friendly pager for grep/git-grep/ripgrep";
mainProgram = "vgrep";
homepage = "https://github.com/vrothberg/vgrep";
license = licenses.gpl3Only;
maintainers = with maintainers; [ SuperSandro2000 ];
};
}