2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub }:
|
2016-11-05 08:51:49 +00:00
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "agrep";
|
2016-11-05 08:51:49 +00:00
|
|
|
version = "3.41.5";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Wikinaut";
|
|
|
|
repo = "agrep";
|
|
|
|
# This repository has numbered versions, but not Git tags.
|
|
|
|
rev = "eef20411d605d9d17ead07a0ade75046f2728e21";
|
|
|
|
sha256 = "14addnwspdf2mxpqyrw8b84bb2257y43g5ccy4ipgrr91fmxq2sk";
|
|
|
|
};
|
|
|
|
|
2018-01-13 19:34:27 +00:00
|
|
|
# Related: https://github.com/Wikinaut/agrep/pull/11
|
2021-01-15 09:19:50 +00:00
|
|
|
prePatch = lib.optionalString (stdenv.hostPlatform.isMusl || stdenv.isDarwin) ''
|
2018-01-13 19:34:27 +00:00
|
|
|
sed -i '1i#include <sys/stat.h>' checkfil.c newmgrep.c recursiv.c
|
|
|
|
'';
|
2016-11-05 08:51:49 +00:00
|
|
|
installPhase = ''
|
|
|
|
install -Dm 555 agrep -t "$out/bin"
|
|
|
|
install -Dm 444 docs/* -t "$out/doc"
|
|
|
|
'';
|
|
|
|
|
2020-06-10 06:36:00 +00:00
|
|
|
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-11-05 08:51:49 +00:00
|
|
|
description = "Approximate grep for fast fuzzy string searching";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.tgries.de/agrep/";
|
2020-06-10 06:36:00 +00:00
|
|
|
license = licenses.isc;
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
2016-11-05 08:51:49 +00:00
|
|
|
};
|
|
|
|
}
|