libfaketime: fix build with clang

The options -Wno-nonnull-compare, -Wno-error=cast-function-type and -Wno-error=format-truncation
are unsupported by clang, letting the build fail.
This commit is contained in:
Christian Kampka
2020-11-26 08:12:31 +01:00
parent e204319c74
commit 7969848266
2 changed files with 30 additions and 2 deletions
@@ -11,7 +11,10 @@ stdenv.mkDerivation rec {
patches = [
./no-date-in-gzip-man-page.patch
];
] ++ (stdenv.lib.optionals stdenv.cc.isClang [
# https://github.com/wolfcw/libfaketime/issues/277
./0001-Remove-unsupported-clang-flags.patch
]);
postPatch = ''
patchShebangs test src
@@ -24,7 +27,7 @@ stdenv.mkDerivation rec {
PREFIX = placeholder "out";
LIBDIRNAME = "/lib";
NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type -Wno-error=format-truncation";
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=cast-function-type -Wno-error=format-truncation";
checkInputs = [ perl ];