all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: 45614@debbugs.gnu.org
Subject: [bug#45614] [PATCH v4] gnu: Add ugrep.
Date: Sat, 23 Jan 2021 20:38:07 +0100	[thread overview]
Message-ID: <6bb6e856d75e400d8c6841478be9ed218c655e41.1611430623.git.h.goebel@crazy-compilers.com> (raw)
In-Reply-To: <d27faa5979139afaac0795d08bb3a2d47803522e.1609625371.git.h.goebel@crazy-compilers.com>

* gnu/packages/search.scm (ugrep): New Variable.
---
 gnu/packages/search.scm | 66 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/gnu/packages/search.scm b/gnu/packages/search.scm
index e261e64a7f..2667096c44 100644
--- a/gnu/packages/search.scm
+++ b/gnu/packages/search.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2018, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
+;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26,6 +27,7 @@
                 #:select (gpl2 gpl2+ gpl3+ lgpl2.1+ bsd-3 x11 perl-license))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
@@ -35,7 +37,9 @@
   #:use-module (gnu packages check)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages less)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pdf)
   #:use-module (gnu packages python)
@@ -413,4 +417,66 @@ online libraries.  It provides fast search of document text and
 bibliographic data and simple document and bibtex retrieval.")
     (license gpl3+)))
 
+(define-public ugrep
+  (package
+    (name "ugrep")
+    (version "3.1.4")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Genivia/ugrep")
+                    (commit (string-append "v" version))))
+              (sha256
+               (base32 "1ydnpdhn1mp2pnbqzvwabrp573626k89kbv97fax6y1bz2pamrg4"))
+              (file-name (string-append name "-" version "-checkout"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (delete-file-recursively "bin")  ;; pre-build executables
+                  (for-each delete-file (find-files "tests" "^archive\\..*"))
+                  (for-each delete-file (find-files "tests" "^.*\\.pdf$"))
+                  (for-each delete-file (find-files "tests" "^.*\\.class$"))
+                  #t))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("bzip2" ,bzip2)
+       ("less" ,less)
+       ("lz4" ,lz4)
+       ("lzip" ,lzip)  ;; lzma
+       ("pcre2" ,pcre2)
+       ("zlib" ,zlib)))
+    (arguments
+     `(#:configure-flags '("--enable-pager")
+       #:tests? #f ;; No script for re-building the binary test input-files
+       #:test-target "test"
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'patch-paths-to-binaries
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((less (assoc-ref inputs "less")))
+               (substitute* "src/ugrep.cpp"
+                 (("(#\\s*define +DEFAULT_PAGER_COMMAND +\")(less\\W)" _ a b)
+                  (string-append a less "/bin/" b))))))
+         (add-before 'check 'check-setup
+           (lambda _
+             ;; unpatch shepengs in tests
+             (substitute* '("tests/Hello.bat"
+                            "tests/Hello.sh")
+               (("#!/gnu/store/.*/bin/sh") "#!/bin/sh")))))))
+    (home-page "https://github.com/Genivia/ugrep/")
+    (synopsis "Faster grep with an interactive query UI")
+    (description "Ugrep is a ultra fast searcher of file systems, text
+and binary files, source code, archives, compressed files, documents, and
+more.
+
+While still being compatible with the standard GNU/BSD grep command-line
+options, ugrep supports fuzzy search as well as structured and (adjustable)
+colored output, piped through \"less\" for pagination.  An interactive query
+UI allows refinement and has a built-in help (press F1).  Ugrep implements
+multi-threaded and other techniques to speed up search, pattern-matching and
+decompression.  Many pre-defined regexps ease searching e.g. C typdefs or XML
+attributes.  Results can be output in several structured or self-defined
+formats.")
+    (license bsd-3)))
+
 ;;; search.scm ends here
-- 
2.21.3





      parent reply	other threads:[~2021-01-23 19:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-02 22:10 [bug#45614] [PATCH] gnu: Add ugrep Hartmut Goebel
2021-01-05 12:05 ` [bug#45672] [PATCH v2] " Hartmut Goebel
2021-01-13 15:19   ` [bug#45614] [PATCH] " Ludovic Courtès
2021-01-22 20:13     ` Hartmut Goebel
2021-01-25 18:13       ` Ludovic Courtès
2021-01-27 15:58         ` bug#45614: " Hartmut Goebel
2021-01-22 19:58 ` [bug#45614] [PATCH v3] " Hartmut Goebel
2021-01-23 19:38 ` Hartmut Goebel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6bb6e856d75e400d8c6841478be9ed218c655e41.1611430623.git.h.goebel@crazy-compilers.com \
    --to=h.goebel@crazy-compilers.com \
    --cc=45614@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.