agrep: fix build failure
changed to compile option '-ansi' and patched Makefile
This commit is contained in:
parent
9f5db4665f
commit
6cb3a29b13
@ -1,33 +1,43 @@
|
|||||||
{ lib, stdenv, fetchFromGitHub }:
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
fetchFromGitHub,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
# This repository has numbered versions, but not Git tags.
|
||||||
|
rev = "b7d180fe73636740f694ec60c1ffab52b06e7150";
|
||||||
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
pname = "agrep";
|
pname = "agrep";
|
||||||
version = "3.41.5";
|
version = "3.41.5-unstable-2022-03-23";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
|
inherit rev;
|
||||||
owner = "Wikinaut";
|
owner = "Wikinaut";
|
||||||
repo = "agrep";
|
repo = "agrep";
|
||||||
# This repository has numbered versions, but not Git tags.
|
hash = "sha256-2J4bw5BVZgTEcIn9IuD5Q8/L+8tldDbToDefuxDf85g=";
|
||||||
rev = "eef20411d605d9d17ead07a0ade75046f2728e21";
|
|
||||||
sha256 = "14addnwspdf2mxpqyrw8b84bb2257y43g5ccy4ipgrr91fmxq2sk";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Related: https://github.com/Wikinaut/agrep/pull/11
|
|
||||||
prePatch = lib.optionalString (stdenv.hostPlatform.isMusl || stdenv.isDarwin) ''
|
|
||||||
sed -i '1i#include <sys/stat.h>' checkfil.c newmgrep.c recursiv.c
|
|
||||||
'';
|
|
||||||
installPhase = ''
|
|
||||||
install -Dm 555 agrep -t "$out/bin"
|
|
||||||
install -Dm 444 docs/* -t "$out/doc"
|
|
||||||
'';
|
|
||||||
|
|
||||||
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
|
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
|
||||||
|
|
||||||
meta = with lib; {
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-std=c89";
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
install -Dm 555 agrep -t "$out/bin"
|
||||||
|
install -Dm 444 docs/* -t "$out/doc"
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
description = "Approximate grep for fast fuzzy string searching";
|
description = "Approximate grep for fast fuzzy string searching";
|
||||||
mainProgram = "agrep";
|
mainProgram = "agrep";
|
||||||
homepage = "https://www.tgries.de/agrep/";
|
homepage = "https://www.tgries.de/agrep/";
|
||||||
license = licenses.isc;
|
maintainers = with lib.maintainers; [ momeemt ];
|
||||||
platforms = with platforms; linux ++ darwin;
|
changelog = "https://github.com/Wikinaut/agrep/blob/${rev}/CHANGES";
|
||||||
|
license = lib.licenses.isc;
|
||||||
|
platforms = lib.platforms.unix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user