lol
1{ lib, stdenv
2, fetchFromGitHub
3, pkg-config
4, autoreconfHook
5, pcre
6}:
7
8stdenv.mkDerivation rec {
9 pname = "ucg";
10 version = "0.3.3+date=2019-02-25";
11
12 src = fetchFromGitHub {
13 owner = "gvansickle";
14 repo = pname;
15 rev = "c3a67632f1e3f332bfb102f0db167f34a2e42da7";
16 sha256 = "sha256-/wU1PmI4ejlv7gZzZNasgROYXFiDiIxE9BFoCo6+G5Y=";
17 };
18
19 nativeBuildInputs = [
20 autoreconfHook
21 pkg-config
22 ];
23
24 buildInputs = [
25 pcre
26 ];
27
28 doInstallCheck = true;
29 installCheckPhase = ''
30 runHook preInstallCheck
31
32 testFile=$(mktemp /tmp/ucg-test.XXXX)
33 echo -ne 'Lorem ipsum dolor sit amet\n2.7182818284590' > $testFile
34 $out/bin/ucg 'dolor' $testFile || { rm $testFile; exit -1; }
35 $out/bin/ucg --ignore-case 'lorem' $testFile || { rm $testFile; exit -1; }
36 $out/bin/ucg --word-regexp '2718' $testFile && { rm $testFile; exit -1; }
37 $out/bin/ucg 'pisum' $testFile && { rm $testFile; exit -1; }
38 rm $testFile
39
40 runHook postInstallCheck
41 '';
42
43 meta = with lib; {
44 homepage = "https://github.com/gvansickle/ucg/";
45 description = "Grep-like tool for searching large bodies of source code";
46 longDescription = ''
47 UniversalCodeGrep (ucg) is an extremely fast grep-like tool specialized
48 for searching large bodies of source code. It is intended to be largely
49 command-line compatible with Ack, to some extent with ag, and where
50 appropriate with grep. Search patterns are specified as PCRE regexes.
51 '';
52 license = licenses.gpl3Plus;
53 maintainers = with maintainers; [ AndersonTorres ];
54 platforms = with platforms; unix;
55 broken = stdenv.isAarch64; # cpuid.h: no such file or directory
56 };
57}
58# TODO: report upstream