PageRenderTime 42ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/pkgs/tools/text/ripgrep/default.nix

https://codeberg.org/matthiasbeyer/nixpkgs
Nix | 46 lines | 39 code | 7 blank | 0 comment | 0 complexity | 9971bc62c1da835fa22b4a9399b592fa MD5 | raw file
  1. { stdenv
  2. , fetchFromGitHub
  3. , rustPlatform
  4. , asciidoc
  5. , docbook_xsl
  6. , libxslt
  7. , installShellFiles
  8. , Security
  9. , withPCRE2 ? true
  10. , pcre2 ? null
  11. }:
  12. rustPlatform.buildRustPackage rec {
  13. pname = "ripgrep";
  14. version = "12.0.1";
  15. src = fetchFromGitHub {
  16. owner = "BurntSushi";
  17. repo = pname;
  18. rev = version;
  19. sha256 = "1c0v51s05kbg9825n6mvpizhkkgz38wl7hp8f3vzbjfg4i8l8wb0";
  20. };
  21. cargoSha256 = "0i8x2xgri8f8mzrlkc8l2yzcgczl35nw4bmwg09d343mjkmk6d8y";
  22. cargoBuildFlags = stdenv.lib.optional withPCRE2 "--features pcre2";
  23. nativeBuildInputs = [ asciidoc docbook_xsl libxslt installShellFiles ];
  24. buildInputs = (stdenv.lib.optional withPCRE2 pcre2)
  25. ++ (stdenv.lib.optional stdenv.isDarwin Security);
  26. preFixup = ''
  27. (cd target/release/build/ripgrep-*/out
  28. installManPage rg.1
  29. installShellCompletion rg.{bash,fish})
  30. installShellCompletion --zsh "$src/complete/_rg"
  31. '';
  32. meta = with stdenv.lib; {
  33. description = "A utility that combines the usability of The Silver Searcher with the raw speed of grep";
  34. homepage = "https://github.com/BurntSushi/ripgrep";
  35. license = with licenses; [ unlicense /* or */ mit ];
  36. maintainers = with maintainers; [ tailhook globin ma27 ];
  37. platforms = platforms.all;
  38. };
  39. }