From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uNXFH48uC2DHNQAA0tVLHw (envelope-from ) for ; Fri, 22 Jan 2021 19:59:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id sEqoG48uC2A8ZwAAB5/wlQ (envelope-from ) for ; Fri, 22 Jan 2021 19:59:11 +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 AD2909403AC for ; Fri, 22 Jan 2021 19:59:10 +0000 (UTC) Received: from localhost ([::1]:33528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l32aL-0008PL-N1 for larch@yhetil.org; Fri, 22 Jan 2021 14:59:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l32aE-0008P8-56 for guix-patches@gnu.org; Fri, 22 Jan 2021 14:59:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49852) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l32aD-0007fi-St for guix-patches@gnu.org; Fri, 22 Jan 2021 14:59:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l32aD-00064X-SQ for guix-patches@gnu.org; Fri, 22 Jan 2021 14:59:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45614] [PATCH v3] gnu: Add ugrep. References: In-Reply-To: Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 22 Jan 2021 19:59: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.161134552523317 (code B ref 45614); Fri, 22 Jan 2021 19:59:01 +0000 Received: (at 45614) by debbugs.gnu.org; 22 Jan 2021 19:58:45 +0000 Received: from localhost ([127.0.0.1]:33165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l32Zw-000640-P2 for submit@debbugs.gnu.org; Fri, 22 Jan 2021 14:58:45 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:58738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l32Zr-00063m-Jn for 45614@debbugs.gnu.org; Fri, 22 Jan 2021 14:58:43 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4DMqnp1Kpjz1rtZW for <45614@debbugs.gnu.org>; Fri, 22 Jan 2021 20:58:37 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4DMqnn6L2Jz1tYVn for <45614@debbugs.gnu.org>; Fri, 22 Jan 2021 20:58:37 +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 1Pe-CmH7Xdwn for <45614@debbugs.gnu.org>; Fri, 22 Jan 2021 20:58:35 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-188-174-60-46.dynamic.mnet-online.de [188.174.60.46]) (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>; Fri, 22 Jan 2021 20:58:35 +0100 (CET) Received: from thisbe.fritz.box (thisbe.fritz.box [192.168.110.24]) by hermia.goebel-consult.de (Postfix) with ESMTP id 559D560170; Fri, 22 Jan 2021 20:58:32 +0100 (CET) From: Hartmut Goebel Date: Fri, 22 Jan 2021 20:58:32 +0100 Message-Id: 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: AD2909403AC X-Spam-Score: -1.35 X-Migadu-Scanner: scn1.migadu.com X-TUID: TPMZtNVOG/rn * 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..19f029a2bf 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.3") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Genivia/ugrep") + (commit (string-append "v" version)))) + (sha256 + (base32 "0vywgpa97qw8ird3zcscvbkcjnvrj16sh9p6sm8vaklxp2q49xrz")) + (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