nixpkgs/pkgs/tools/text/ucg/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.7 KiB
Nix
Raw Normal View History

2023-04-13 03:05:26 +00:00
{ lib
, stdenv
2020-11-29 23:00:38 +00:00
, fetchFromGitHub
, autoreconfHook
2023-04-13 03:05:26 +00:00
, pkg-config
2020-11-29 23:00:38 +00:00
, pcre
}:
stdenv.mkDerivation {
2020-11-29 23:00:38 +00:00
pname = "ucg";
2023-04-13 03:17:57 +00:00
version = "unstable-2022-09-03";
2020-11-29 23:00:38 +00:00
src = fetchFromGitHub {
owner = "gvansickle";
2023-04-13 03:05:26 +00:00
repo = "ucg";
2023-04-13 03:17:57 +00:00
rev = "cbb185e8adad6546b7e1c5e9ca59a81f98dca49f";
hash = "sha256-Osdyxp8DoEjcr2wQLCPqOQ2zQf/0JWYxaDpZB02ACWo=";
2020-11-29 23:00:38 +00:00
};
2023-04-13 03:17:57 +00:00
outputs = [ "out" "man" ];
nativeBuildInputs = [
autoreconfHook
pkg-config
];
buildInputs = [
pcre
];
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
testFile=$(mktemp /tmp/ucg-test.XXXX)
echo -ne 'Lorem ipsum dolor sit amet\n2.7182818284590' > $testFile
$out/bin/ucg 'dolor' $testFile || { rm $testFile; exit -1; }
$out/bin/ucg --ignore-case 'lorem' $testFile || { rm $testFile; exit -1; }
$out/bin/ucg --word-regexp '2718' $testFile && { rm $testFile; exit -1; }
$out/bin/ucg 'pisum' $testFile && { rm $testFile; exit -1; }
rm $testFile
runHook postInstallCheck
'';
2020-11-29 23:00:38 +00:00
2023-04-13 03:05:26 +00:00
meta = {
2023-04-13 03:17:57 +00:00
homepage = "https://gvansickle.github.io/ucg/";
2020-11-29 23:00:38 +00:00
description = "Grep-like tool for searching large bodies of source code";
longDescription = ''
UniversalCodeGrep (ucg) is an extremely fast grep-like tool specialized
for searching large bodies of source code. It is intended to be largely
command-line compatible with Ack, to some extent with ag, and where
appropriate with grep. Search patterns are specified as PCRE regexes.
'';
2023-04-13 03:05:26 +00:00
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.unix;
2023-04-16 21:13:31 +00:00
broken = stdenv.isAarch64 || stdenv.isDarwin;
2020-11-29 23:00:38 +00:00
};
}
2021-10-31 02:13:06 +00:00
# TODO: report upstream