From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id VTJWNWh7DGDmbQAA0tVLHw (envelope-from ) for ; Sat, 23 Jan 2021 19:39:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id YAO8MGh7DGDANQAA1q6Kng (envelope-from ) for ; Sat, 23 Jan 2021 19:39:20 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 274A49402B1 for ; Sat, 23 Jan 2021 19:39:20 +0000 (UTC) Received: from localhost ([::1]:42210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3Okg-000206-QO for larch@yhetil.org; Sat, 23 Jan 2021 14:39:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3OkR-0001xi-7c for guix-patches@gnu.org; Sat, 23 Jan 2021 14:39:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:52018) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3OkP-0004dG-QE for guix-patches@gnu.org; Sat, 23 Jan 2021 14:39:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l3OkP-0007bC-Ns for guix-patches@gnu.org; Sat, 23 Jan 2021 14:39:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45614] [PATCH v4] gnu: Add ugrep. References: In-Reply-To: Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 23 Jan 2021 19:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45614 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45614@debbugs.gnu.org Received: via spool by 45614-submit@debbugs.gnu.org id=B45614.161143069629156 (code B ref 45614); Sat, 23 Jan 2021 19:39:01 +0000 Received: (at 45614) by debbugs.gnu.org; 23 Jan 2021 19:38:16 +0000 Received: from localhost ([127.0.0.1]:35331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3Ojf-0007aB-NK for submit@debbugs.gnu.org; Sat, 23 Jan 2021 14:38:16 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:55123) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3Ojd-0007a2-Kf for 45614@debbugs.gnu.org; Sat, 23 Jan 2021 14:38:14 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4DNRHm2MmQz1qs0H for <45614@debbugs.gnu.org>; Sat, 23 Jan 2021 20:38:12 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4DNRHm0rm0z1tYW8 for <45614@debbugs.gnu.org>; Sat, 23 Jan 2021 20:38:12 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id ZGfCUpRzsdBQ for <45614@debbugs.gnu.org>; Sat, 23 Jan 2021 20:38:10 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-188-174-57-66.dynamic.mnet-online.de [188.174.57.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for <45614@debbugs.gnu.org>; Sat, 23 Jan 2021 20:38:10 +0100 (CET) Received: from thisbe.fritz.box (thisbe.fritz.box [192.168.110.24]) by hermia.goebel-consult.de (Postfix) with ESMTP id 0FCC2604F2; Sat, 23 Jan 2021 20:38:08 +0100 (CET) From: Hartmut Goebel Date: Sat, 23 Jan 2021 20:38:07 +0100 Message-Id: <6bb6e856d75e400d8c6841478be9ed218c655e41.1611430623.git.h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.35 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 274A49402B1 X-Spam-Score: -1.35 X-Migadu-Scanner: scn1.migadu.com X-TUID: DGFkqmT8724Z * 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 ;;; Copyright © 2018, 2020, 2021 Tobias Geerinckx-Rice ;;; Copyright © 2018 Adam Massmann +;;; Copyright © 2020 Hartmut Goebel ;;; ;;; 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