agrep: unbreak

Starting with gcc14, implicit declaration are now a compiler error. By
patching the package we successfully fix the build

authored by Clément and committed by Masum Reza 787a995b e5b5b2af

+25 -1
+25 -1
pkgs/by-name/ag/agrep/package.nix
··· 1 { 2 lib, 3 stdenv, 4 - fetchFromGitHub, 5 }: 6 let 7 # This repository has numbered versions, but not Git tags. ··· 17 repo = "agrep"; 18 hash = "sha256-2J4bw5BVZgTEcIn9IuD5Q8/L+8tldDbToDefuxDf85g="; 19 }; 20 21 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; 22
··· 1 { 2 lib, 3 + fetchFromGitHub, 4 + fetchpatch, 5 stdenv, 6 }: 7 let 8 # This repository has numbered versions, but not Git tags. ··· 18 repo = "agrep"; 19 hash = "sha256-2J4bw5BVZgTEcIn9IuD5Q8/L+8tldDbToDefuxDf85g="; 20 }; 21 + 22 + patches = [ 23 + # Implicit declaration of functions & implicit int 24 + # https://github.com/Wikinaut/agrep/pull/31 25 + (fetchpatch { 26 + url = "https://patch-diff.githubusercontent.com/raw/Wikinaut/agrep/pull/31.patch"; 27 + hash = "sha256-9ik2RANq12T/1vCUYTBNomzw+aJVa/LU2RsZovu3r3E="; 28 + }) 29 + ]; 30 + 31 + postPatch = '' 32 + # agrep only doesn't includes <sys/stat.h> for Linux 33 + # Starting from gcc14, this is a compiler error 34 + substituteInPlace checkfil.c recursiv.c \ 35 + --replace-fail '#ifdef __APPLE__ 36 + #include <sys/stat.h> 37 + #endif' '#include <sys/stat.h>' 38 + 39 + substituteInPlace newmgrep.c \ 40 + --replace-fail '#if defined(_WIN32) || defined(__APPLE__) 41 + #include <sys/stat.h> 42 + #endif' '#include <sys/stat.h>' 43 + ''; 44 45 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; 46