Archived
1
0
Fork 0

gnu: ripgrep: Update to 14.0.3.

* gnu/packages/rust-apps.scm (ripgrep): Update to 14.0.3.
[cargo-inputs]: Add rust-anyhow-1, rust-lexopt-0.3, rust-textwrap-0.16.
Replace rust-bstr-0.2 with 1, rust-grep-0.2 with 0.3,
rust-jemallocator-0.3 with 0.5.  Remove rust-clap-2, rust-lazy-static-1,
rust-num-cpus-1, rust-regex-1.
[arguments]: Replace custom 'install-manpage with 'install-extras and
install shell completions.  Remove extra modules.
[native-inputs]: Remove asciidoc.  Add ripgrep when cross-compiling.
[synopsis, description]: Expand.
Change-Id: Iedf371a36d704072f4f3a9a3765c77dd22ea6642
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>

Change-Id: Ie99687ad5d7d7a9178dba08e1e7f100f96854336
This commit is contained in:
Jaeme Sifat 2023-12-12 13:10:24 -05:00 committed by Efraim Flashner
parent fe60fe4fe0
commit 33313d57b9
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -1149,61 +1149,78 @@ more.")
(define-public ripgrep (define-public ripgrep
(package (package
(name "ripgrep") (name "ripgrep")
(version "13.0.0") (version "14.0.3")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (crate-uri "ripgrep" version)) (uri (crate-uri "ripgrep" version))
(file-name (file-name (string-append name "-" version ".tar.gz"))
(string-append name "-" version ".tar.gz"))
(sha256 (sha256
(base32 (base32 "192n1lih9vzhf7r2ak985fap23x608qjdq9pqjcf43h3g9mjzjh0"))))
"1gv4imhjgxmyxaa996yshcjlakmrjw9pf4rycp90pq675cn9sz7k"))))
(build-system cargo-build-system) (build-system cargo-build-system)
(arguments (arguments
`(#:cargo-inputs (list
(("rust-bstr" ,rust-bstr-0.2) #:cargo-inputs `(("rust-anyhow" ,rust-anyhow-1)
("rust-clap" ,rust-clap-2) ("rust-bstr" ,rust-bstr-1)
("rust-grep" ,rust-grep-0.2) ("rust-grep" ,rust-grep-0.3)
("rust-ignore" ,rust-ignore-0.4) ("rust-ignore" ,rust-ignore-0.4)
("rust-jemallocator" ,rust-jemallocator-0.3) ("rust-jemallocator" ,rust-jemallocator-0.5)
("rust-lazy-static" ,rust-lazy-static-1) ("rust-lexopt" ,rust-lexopt-0.3)
("rust-log" ,rust-log-0.4) ("rust-log" ,rust-log-0.4)
("rust-num-cpus" ,rust-num-cpus-1) ("rust-serde-json" ,rust-serde-json-1)
("rust-regex" ,rust-regex-1) ("rust-termcolor" ,rust-termcolor-1)
("rust-serde-json" ,rust-serde-json-1) ("rust-textwrap" ,rust-textwrap-0.16))
("rust-termcolor" ,rust-termcolor-1)) #:cargo-development-inputs `(("rust-serde" ,rust-serde-1)
#:cargo-development-inputs ("rust-serde-derive" ,rust-serde-derive-1)
(("rust-serde" ,rust-serde-1) ("rust-walkdir" ,rust-walkdir-2))
("rust-serde-derive" ,rust-serde-derive-1) #:install-source? #f
("rust-walkdir" ,rust-walkdir-2)) ;; Note: the built target 'rg' binary is required for 'install-extras
#:modules ((ice-9 match) #:phases #~(modify-phases %standard-phases
(guix build cargo-build-system) (add-after 'install 'install-extras
(guix build utils)) (lambda* (#:key native-inputs outputs #:allow-other-keys)
#:install-source? #f (let* ((out (assoc-ref outputs "out"))
#:phases (share (string-append out "/share"))
(modify-phases %standard-phases (bash-completions-dir
(add-after 'build 'install-manpage (string-append share "/bash-completion/completions"))
;; NOTE: This is done before 'check so that there's only one output (zsh-completions-dir
;; directory with the man page. (string-append share "/zsh/site-functions"))
(lambda* (#:key outputs #:allow-other-keys) (fish-completions-dir
(match (find-files "target" "^rg\\.1$") (string-append share "/fish/vendor_completions.d"))
((manpage) (man1 (string-append share "/man/man1"))
(install-file manpage (string-append (rg (if #$(%current-target-system)
(assoc-ref outputs "out") (search-input-file native-inputs "/bin/rg")
"/share/man/man1")))) (string-append out "/bin/rg"))))
#t))) (mkdir-p man1)
#:features '("pcre2"))) (with-output-to-file (string-append man1 "/rg.1")
(inputs (lambda _
(list pcre2)) (invoke rg "--generate" "man")))
(native-inputs (mkdir-p bash-completions-dir)
(list asciidoc pkg-config)) (with-output-to-file (string-append
bash-completions-dir "/rg")
(lambda _
(invoke rg "--generate" "complete-bash")))
(mkdir-p zsh-completions-dir)
(with-output-to-file (string-append
zsh-completions-dir "/_rg")
(lambda _
(invoke rg "--generate" "complete-zsh")))
(mkdir-p fish-completions-dir)
(with-output-to-file
(string-append fish-completions-dir "/rg.fish")
(lambda _
(invoke rg "--generate" "complete-fish")))))))
#:features '(list "pcre2")))
(inputs (list pcre2))
(native-inputs (cons* pkg-config (if (%current-target-system)
(list this-package)
'())))
(home-page "https://github.com/BurntSushi/ripgrep") (home-page "https://github.com/BurntSushi/ripgrep")
(synopsis "Line-oriented search tool") (synopsis "Line-oriented search tool and Rust successor to @command{grep}")
(description (description
"ripgrep is a line-oriented search tool that recursively searches "@code{ripgrep} (@command{rg}) is a line-oriented search tool that
your current directory for a regex pattern while respecting your recursively searches your current directory for a regex pattern while
gitignore rules.") respecting your gitignore rules. @code{ripgrep} is similar to other popular
search tools like The Silver Searcher, @command{ack} and @command{grep}.")
(license (list license:unlicense license:expat)))) (license (list license:unlicense license:expat))))
(define-public rot8 (define-public rot8