~ruther/guix-exprs

guix-exprs/modules/ruther/packages/ripgrep-all.scm -rw-r--r-- 3.4 KiB
df9107c8 — Rutherther guix-shared-cache-service-type: Fix unbound variable 30 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
(define-module (ruther packages ripgrep-all)
  #:use-module (srfi srfi-26)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix utils)

  #:use-module (guix gexp)
  #:use-module (guix packages)

  #:use-module (guix git-download)
  #:use-module (guix download)

  #:use-module (gnu packages video)
  #:use-module (gnu packages haskell-xyz)
  #:use-module (gnu packages pdf)
  #:use-module (gnu packages rust-apps)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages terminals)
  #:use-module (gnu packages pkg-config)

  #:use-module (guix build-system cargo)
  #:use-module (ruther packages rust-crates))

(define-public ripgrep-all
  (let ((wrap-paths-packages
         (list ffmpeg
               pandoc
               poppler
               ripgrep
               zip
               fzf))
        (wrap-paths
         (list "ffmpeg"
               "pandoc"
               "poppler"
               "ripgrep"
               "zip"
               "fzf")))
    (package
      (name "ripgrep-all")
      (version "0.10.6")
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/phiresky/ripgrep-all")
               (commit (string-append "v" version))))
         (file-name (string-append name "-" version "-checkout"))
         (sha256
          (base32 "0ws0shf0y5z8wxaanlwjrpq604saffj1gr5jsfmvs6r2p4px3kly"))))
      (build-system cargo-build-system)
      (native-inputs
       (list
        pkg-config
        xz))
      (inputs
       `((,zstd "lib")
        ,@wrap-paths-packages
        ,@(my-cargo-inputs 'ripgrep-all)))
      (arguments
       (list
        #:install-source? #f
        #:phases
        #~(modify-phases %standard-phases
            (add-after 'configure 'use-guix-vendored-dependencies
              (lambda _
                (substitute* "Cargo.toml"
                  (("git.*}")
                   "version = \"*\" }"))
                (let ((git-managed-dep #$(this-package-input "rust-tokio-tar-0.3.1.87338a7-checkout")))
                  (copy-recursively git-managed-dep
                                    (string-append "guix-vendor/" (strip-store-file-name git-managed-dep))))))
            (add-after 'install 'wrap-with-paths
              (lambda* _
                (let* ((bin-dir (string-append #$output "/bin/"))
                       (wrap-bin-folders
                        (map (lambda (pkg) (string-append pkg "/bin"))
                             '#$(map (cut this-package-input <>) wrap-paths)))
                       (wrap-bin-path (string-join wrap-bin-folders ":")))
                  (for-each (lambda (bin)
                              (wrap-program bin
                                `("PATH" ":" prefix
                                  (,wrap-bin-path)))) (find-files bin-dir)))))
            )
        #:cargo-test-flags
        `(list
          "--release" "--"
          "--skip=adapters::mbox::tests::mail_simple"
          "--skip=adapters::mbox::tests::mbox_simple"
          "--skip=adapters::mbox::tests::mbox_attachment")))
      (home-page "https://github.com/phiresky/ripgrep-all")
      (synopsis
       "rga: ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc")
      (description
       "This package provides rga: ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz,
etc.")
      (license license:agpl3+))))
Do not follow this link