PageRenderTime 24ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://repo.or.cz/NixPkgs.git
Nix | 46 lines | 38 code | 8 blank | 0 comment | 0 complexity | 86a04da0c7f458cbe13b61d2f73e9370 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. installManPage $releaseDir/build/ripgrep-*/out/rg.1
  28. installShellCompletion $releaseDir/build/ripgrep-*/out/rg.{bash,fish}
  29. installShellCompletion --zsh "$src/complete/_rg"
  30. '';
  31. meta = with stdenv.lib; {
  32. description = "A utility that combines the usability of The Silver Searcher with the raw speed of grep";
  33. homepage = "https://github.com/BurntSushi/ripgrep";
  34. license = with licenses; [ unlicense /* or */ mit ];
  35. maintainers = with maintainers; [ tailhook globin ma27 ];
  36. platforms = platforms.all;
  37. };
  38. }