diff mbox series

[bug#44762,37/37] gnu: Add ripgrep-all.

Message ID 20201120142716.41949-37-joseph@lafreniere.xyz
State New
Headers show
Series gnu: Add ripgrep-all. | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Joseph LaFreniere Nov. 20, 2020, 2:27 p.m. UTC
* gnu/packages/rust-apps.scm (ripgrep-all): New variable.
---
 gnu/packages/rust-apps.scm | 80 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 79 insertions(+), 1 deletion(-)

Comments

Efraim Flashner Dec. 12, 2020, 8:19 p.m. UTC | #1
I've had reviewing these patches on my TODO for a while, finally made it
around to it.

On Fri, Nov 20, 2020 at 08:27:16AM -0600, Joseph LaFreniere wrote:
> * gnu/packages/rust-apps.scm (ripgrep-all): New variable.
> ---
>  gnu/packages/rust-apps.scm | 80 +++++++++++++++++++++++++++++++++++++-
>  1 file changed, 79 insertions(+), 1 deletion(-)
> 
> diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
> +         (add-after 'unpack 'enable-unstable-features
> +           (lambda _
> +             (setenv "RUSTC_BOOTSTRAP" "1")
> +             #t)))))

Is this necessary, or is it because we were using an older version of
rust for building packages?

> +    (native-inputs
> +     `(("pkg-config" ,pkg-config)
> +       ("xz" ,xz)))
> +    (propagated-inputs
> +     `(("ffmpeg" ,ffmpeg)
> +       ("pandoc" ,pandoc)
> +       ("poppler" ,poppler)
> +       ("ripgrep" ,ripgrep)
> +       ("sqlite" ,sqlite)
> +       ("tar" ,tar)
> +       ("unzip" ,unzip)
> +       ("zip" ,zip)))

We prefer to not propagate packages, and in particular I try not to use
pandoc as an input because it limits the package to architectures that
can build haskell programs. Looking through the code a bit it looks like
it shells out to the commands. So it'd be better to substitute the
commands to the full path name of the package (what I'd suggest for
ripgrep) and/or adding a note to the description suggesting that people
also install some of the other packages for more features.

> +    (home-page "https://github.com/phiresky/ripgrep-all")
> +    (synopsis "Wrapper around @code{ripgrep} with support for rich file types")
> +    (description
> +     "ripgrep-all (rga) is a line-oriented search tool that allows you to look
> +for a regex in a multitude of file types.  rga wraps @code{ripgrep} and
> +enables it to search in @file{pdf}, @file{docx}, @file{sqlite}, @file{jpg},
> +movie subtitles (@file{mkv}, @file{mp4}), etc.")
> +    (license license:agpl3+)))
> +
>  (define-public rust-cbindgen
>    (package
>      (name "rust-cbindgen")
> -- 
> 2.29.1
> 
> 
> 
>
diff mbox series

Patch

diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index fabb4e0380..e25c858c8f 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -27,15 +27,20 @@ 
   #:use-module (guix build-system cargo)
   #:use-module (guix download)
   #:use-module (guix packages)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crates-io)
   #:use-module (gnu packages crates-graphics)
   #:use-module (gnu packages documentation)
+  #:use-module (gnu packages haskell-xyz)
   #:use-module (gnu packages jemalloc)
   #:use-module (gnu packages pcre)
+  #:use-module (gnu packages pdf)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tls)
-  #:use-module (gnu packages version-control))
+  #:use-module (gnu packages version-control)
+  #:use-module (gnu packages video))
 
 (define-public exa
   (package
@@ -293,6 +298,79 @@  your current directory for a regex pattern while respecting your
 gitignore rules.")
     (license (list license:unlicense license:expat))))
 
+(define-public ripgrep-all
+  (package
+    (name "ripgrep-all")
+    (version "0.9.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri name version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1ppci77wdyxz21mn7qd3pphl3pcl2q9kf1ravc9a9zmv2r9n5gk1"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-bincode" ,rust-bincode-1)
+        ("rust-bzip2" ,rust-bzip2-0.4)
+        ("rust-cachedir" ,rust-cachedir-0.1)
+        ("rust-chrono" ,rust-chrono-0.4)
+        ("rust-clap" ,rust-clap-2)
+        ("rust-crossbeam" ,rust-crossbeam-0.7)
+        ("rust-encoding-rs" ,rust-encoding-rs-0.8)
+        ("rust-encoding-rs-io" ,rust-encoding-rs-io-0.1)
+        ("rust-env-logger" ,rust-env-logger-0.7)
+        ("rust-exitfailure" ,rust-exitfailure-0.5)
+        ("rust-failure" ,rust-failure-0.1)
+        ("rust-flate2" ,rust-flate2-1)
+        ("rust-glob" ,rust-glob-0.3)
+        ("rust-lazy-static" ,rust-lazy-static-1.4)
+        ("rust-log" ,rust-log-0.4)
+        ("rust-paste" ,rust-paste-0.1)
+        ("rust-path-clean" ,rust-path-clean-0.1)
+        ("rust-regex" ,rust-regex-1)
+        ("rust-rkv" ,rust-rkv-0.10)
+        ("rust-ruskqlite" ,rust-rusqlite-0.23)
+        ("rust-serde" ,rust-serde-1)
+        ("rust-serde-json" ,rust-serde-json-1)
+        ("rust-size-format" ,rust-size-format-1)
+        ("rust-structopt" ,rust-structopt-0.3)
+        ("rust-tar" ,rust-tar-0.4)
+        ("rust-tempfile" ,rust-tempfile-3)
+        ("rust-tree-magic-fork" ,rust-tree-magic-fork-0.2)
+        ("rust-xz2" ,rust-xz2-0.1)
+        ("rust-zip" ,rust-zip-0.5)
+        ("rust-zstd" ,rust-zstd-0.5))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'enable-unstable-features
+           (lambda _
+             (setenv "RUSTC_BOOTSTRAP" "1")
+             #t)))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("xz" ,xz)))
+    (propagated-inputs
+     `(("ffmpeg" ,ffmpeg)
+       ("pandoc" ,pandoc)
+       ("poppler" ,poppler)
+       ("ripgrep" ,ripgrep)
+       ("sqlite" ,sqlite)
+       ("tar" ,tar)
+       ("unzip" ,unzip)
+       ("zip" ,zip)))
+    (home-page "https://github.com/phiresky/ripgrep-all")
+    (synopsis "Wrapper around @code{ripgrep} with support for rich file types")
+    (description
+     "ripgrep-all (rga) is a line-oriented search tool that allows you to look
+for a regex in a multitude of file types.  rga wraps @code{ripgrep} and
+enables it to search in @file{pdf}, @file{docx}, @file{sqlite}, @file{jpg},
+movie subtitles (@file{mkv}, @file{mp4}), etc.")
+    (license license:agpl3+)))
+
 (define-public rust-cbindgen
   (package
     (name "rust-cbindgen")