1{ stdenv, fetchFromGitHub, rustPlatform, asciidoc, docbook_xsl, libxslt }:
2
3rustPlatform.buildRustPackage rec {
4 name = "ripgrep-${version}";
5 version = "0.9.0";
6
7 src = fetchFromGitHub {
8 owner = "BurntSushi";
9 repo = "ripgrep";
10 rev = version;
11 sha256 = "089xffrqi4wm0w1lhy5iqxrcb82ca44bxl8qps4ilv0ih91vxwfj";
12 };
13
14 cargoSha256 = "1wsw7s1bc1gnpq4kjzkas5zf2snhpx9f6cyrrf6g5jr8l0hcbyih";
15
16 nativeBuildInputs = [ asciidoc docbook_xsl libxslt ];
17
18 preFixup = ''
19 mkdir -p "$out/man/man1"
20 cp target/release/build/ripgrep-*/out/rg.1 "$out/man/man1/"
21
22 mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
23 cp target/release/build/ripgrep-*/out/rg.bash "$out/share/bash-completion/completions/"
24 cp target/release/build/ripgrep-*/out/rg.fish "$out/share/fish/vendor_completions.d/"
25 cp "$src/complete/_rg" "$out/share/zsh/site-functions/"
26 '';
27
28 meta = with stdenv.lib; {
29 description = "A utility that combines the usability of The Silver Searcher with the raw speed of grep";
30 homepage = https://github.com/BurntSushi/ripgrep;
31 license = with licenses; [ unlicense /* or */ mit ];
32 maintainers = [ maintainers.tailhook ];
33 platforms = platforms.all;
34 };
35}