zsync: fix build with clang

I originally found the fix in [this HomeBrew
formula](f800f85efe/Formula/z/zsync.rb (L32)).

I tested the built binary like this:

    zsync http://cdimage.ubuntu.com/ubuntu/daily-live/current/noble-desktop-amd64.iso.zsync

Aborting the download and starting it again worked, it continued at
the same percentage mark. So I'm very certain that the compilation
error really is a mistake, and suppressing it is not an issue.
This commit is contained in:
Felix Uhl 2024-03-06 00:18:24 +01:00
parent 43d259f8d7
commit 8f41fb68ff

View File

@ -9,6 +9,12 @@ stdenv.mkDerivation rec {
sha256 = "1wjslvfy76szf0mgg2i9y9q30858xyjn6v2acc24zal76d1m778b";
};
env = lib.optionalAttrs stdenv.cc.isClang {
# Suppress error "call to undeclared library function 'strcasecmp'" during compilation.
# The function is found by the linker correctly, so this doesn't introduce any issues.
NIX_CFLAGS_COMPILE = " -Wno-implicit-function-declaration";
};
makeFlags = [ "AR=${stdenv.cc.bintools.targetPrefix}ar" ];
meta = with lib; {