2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-11-29 23:00:38 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, autoreconfHook
|
|
|
|
, pcre
|
|
|
|
}:
|
|
|
|
|
2021-10-29 18:42:32 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2020-11-29 23:00:38 +00:00
|
|
|
pname = "ucg";
|
2021-10-29 18:42:32 +01:00
|
|
|
version = "0.3.3+date=2019-02-25";
|
2020-11-29 23:00:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gvansickle";
|
|
|
|
repo = pname;
|
|
|
|
rev = "c3a67632f1e3f332bfb102f0db167f34a2e42da7";
|
|
|
|
sha256 = "sha256-/wU1PmI4ejlv7gZzZNasgROYXFiDiIxE9BFoCo6+G5Y=";
|
|
|
|
};
|
|
|
|
|
2021-10-29 18:42:32 +01:00
|
|
|
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
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-11-29 23:00:38 +00:00
|
|
|
homepage = "https://github.com/gvansickle/ucg/";
|
|
|
|
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.
|
|
|
|
'';
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ AndersonTorres ];
|
|
|
|
platforms = with platforms; unix;
|
2021-10-31 02:13:06 +00:00
|
|
|
broken = stdenv.isAarch64; # cpuid.h: no such file or directory
|
2020-11-29 23:00:38 +00:00
|
|
|
};
|
|
|
|
}
|
2021-10-31 02:13:06 +00:00
|
|
|
# TODO: report upstream
|