From 8f41fb68ff7443836f280323674a6a4a5e7fa0a3 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Wed, 6 Mar 2024 00:18:24 +0100 Subject: [PATCH 1/2] zsync: fix build with clang I originally found the fix in [this HomeBrew formula](https://github.com/Homebrew/homebrew-core/blob/f800f85efed9312a1abc5fcf7f1269576a3f2d95/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. --- pkgs/tools/compression/zsync/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/tools/compression/zsync/default.nix b/pkgs/tools/compression/zsync/default.nix index 0de21cb9c736..94aa7acce2e0 100644 --- a/pkgs/tools/compression/zsync/default.nix +++ b/pkgs/tools/compression/zsync/default.nix @@ -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; { From 2f2224456a3d498e92d9cb49738ed79b3b182f56 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Wed, 6 Mar 2024 00:23:22 +0100 Subject: [PATCH 2/2] zsync: migrate to by-name --- .../zsync/default.nix => by-name/zs/zsync/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{tools/compression/zsync/default.nix => by-name/zs/zsync/package.nix} (100%) diff --git a/pkgs/tools/compression/zsync/default.nix b/pkgs/by-name/zs/zsync/package.nix similarity index 100% rename from pkgs/tools/compression/zsync/default.nix rename to pkgs/by-name/zs/zsync/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4a57d44e72b5..d6703eeba536 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15219,8 +15219,6 @@ with pkgs; zsv = callPackage ../development/tools/zsv { }; - zsync = callPackage ../tools/compression/zsync { }; - zxing = callPackage ../tools/graphics/zxing { }; zkar = callPackage ../tools/security/zkar { };