From 88da0982d10dc12ecebfdecdba197e17869311a5 Mon Sep 17 00:00:00 2001 From: figsoda Date: Thu, 1 Jun 2023 11:17:16 -0400 Subject: [PATCH] repgrep: init at 0.12.4 https://github.com/acheronfail/repgrep --- pkgs/tools/text/repgrep/default.nix | 46 +++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 48 insertions(+) create mode 100644 pkgs/tools/text/repgrep/default.nix diff --git a/pkgs/tools/text/repgrep/default.nix b/pkgs/tools/text/repgrep/default.nix new file mode 100644 index 000000000000..f876366e458e --- /dev/null +++ b/pkgs/tools/text/repgrep/default.nix @@ -0,0 +1,46 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, asciidoctor +, installShellFiles +, makeWrapper +, ripgrep +}: + +rustPlatform.buildRustPackage rec { + pname = "repgrep"; + version = "0.12.4"; + + src = fetchFromGitHub { + owner = "acheronfail"; + repo = "repgrep"; + rev = version; + hash = "sha256-tMv0MdFlDEYx8lNINfnhX6WgcpVLm1fTlaUddej5KRc="; + }; + + cargoHash = "sha256-NjPFoVPHjwG74ZNStYaNMzwdX488xDjGJu92+UWC2z8="; + + nativeBuildInputs = [ + asciidoctor + installShellFiles + makeWrapper + ]; + + postInstall = '' + wrapProgram $out/bin/rgr \ + --prefix PATH : ${lib.makeBinPath [ ripgrep ]} + + pushd "$(dirname "$(find -path '**/repgrep-stamp' | head -n 1)")" + installManPage rgr.1 + installShellCompletion rgr.{bash,fish} _rgr + popd + ''; + + meta = with lib; { + description = "An interactive replacer for ripgrep that makes it easy to find and replace across files on the command line"; + homepage = "https://github.com/acheronfail/repgrep"; + changelog = "https://github.com/acheronfail/repgrep/blob/${src.rev}/CHANGELOG.md"; + license = with licenses; [ mit asl20 unlicense ]; + maintainers = with maintainers; [ figsoda ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2486412b5c6d..4be2becd5ca2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11925,6 +11925,8 @@ with pkgs; renderdoc = libsForQt5.callPackage ../development/tools/renderdoc { }; + repgrep = callPackage ../tools/text/repgrep { }; + replace = callPackage ../tools/text/replace { }; resvg = callPackage ../tools/graphics/resvg { };