3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #196866 from ivan/init-sorted-grep

sorted-grep: init at 1.0
This commit is contained in:
Anderson Torres 2022-10-22 18:30:25 -03:00 committed by GitHub
commit a751bdc56b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,56 @@
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
pname = "sorted-grep";
version = "1.0";
src = fetchurl {
url = "mirror://sourceforge/sgrep/sgrep-${version}.tgz";
hash = "sha256-3F7cXrZnB38YwE1sHYm/CIGKmG+1c0QU+Pk3Y53a0T4=";
};
postPatch = ''
# Its Makefile is missing compiler flags and an install step
rm -f Makefile
'';
buildPhase = ''
runHook preBuild
${stdenv.cc.targetPrefix}cc -Wall -O2 -o sgrep sgrep.c
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -D sgrep "$out/bin/sgrep"
runHook postInstall
'';
installCheckPhase = ''
runHook preInstallCheck
set +o pipefail
$out/bin/sgrep 2>&1 | grep ^Usage:
runHook postInstallCheck
'';
doInstallCheck = true;
meta = with lib; {
homepage = "https://sgrep.sourceforge.net/";
description = "Sgrep (sorted grep) searches sorted input files for lines that match a search key";
longDescription = ''
Sgrep (sorted grep) searches sorted input files for lines that match a search
key and outputs the matching lines. When searching large files sgrep is much
faster than traditional Unix grep, but with significant restrictions.
'';
platforms = platforms.unix;
license = licenses.gpl3Plus;
maintainers = with maintainers; [ ivan ];
};
}

View file

@ -1397,6 +1397,8 @@ with pkgs;
sgrep = callPackage ../tools/text/sgrep { };
sorted-grep = callPackage ../tools/text/sorted-grep { };
smbscan = callPackage ../tools/security/smbscan { };
spectre-cli = callPackage ../tools/security/spectre-cli { };