mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
agrep: unbreak
Starting with gcc14, implicit declaration are now a compiler error. By patching the package we successfully fix the build
This commit is contained in:
parent
e5b5b2af6f
commit
787a995b17
1 changed files with 25 additions and 1 deletions
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
stdenv,
|
||||
}:
|
||||
let
|
||||
# This repository has numbered versions, but not Git tags.
|
||||
|
@ -18,6 +19,29 @@ stdenv.mkDerivation {
|
|||
hash = "sha256-2J4bw5BVZgTEcIn9IuD5Q8/L+8tldDbToDefuxDf85g=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Implicit declaration of functions & implicit int
|
||||
# https://github.com/Wikinaut/agrep/pull/31
|
||||
(fetchpatch {
|
||||
url = "https://patch-diff.githubusercontent.com/raw/Wikinaut/agrep/pull/31.patch";
|
||||
hash = "sha256-9ik2RANq12T/1vCUYTBNomzw+aJVa/LU2RsZovu3r3E=";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# agrep only doesn't includes <sys/stat.h> for Linux
|
||||
# Starting from gcc14, this is a compiler error
|
||||
substituteInPlace checkfil.c recursiv.c \
|
||||
--replace-fail '#ifdef __APPLE__
|
||||
#include <sys/stat.h>
|
||||
#endif' '#include <sys/stat.h>'
|
||||
|
||||
substituteInPlace newmgrep.c \
|
||||
--replace-fail '#if defined(_WIN32) || defined(__APPLE__)
|
||||
#include <sys/stat.h>
|
||||
#endif' '#include <sys/stat.h>'
|
||||
'';
|
||||
|
||||
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-std=c89";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue