From 91e812f0698997c1d6449af2896439efe65ec2a5 Mon Sep 17 00:00:00 2001 From: K900 Date: Sun, 15 Feb 2026 14:20:11 +0300 Subject: [PATCH] yarn-berry: fix fetcher with latest zlib-ng This sucks. This SUCKS. I have no better fix. --- .../by-name/ya/yarn-berry/fetcher/default.nix | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ya/yarn-berry/fetcher/default.nix b/pkgs/by-name/ya/yarn-berry/fetcher/default.nix index a9e3b920fe04..5392c6450ccd 100644 --- a/pkgs/by-name/ya/yarn-berry/fetcher/default.nix +++ b/pkgs/by-name/ya/yarn-berry/fetcher/default.nix @@ -8,6 +8,7 @@ zlib-ng, makeScopeWithSplicing', generateSplicesForMkScope, + fetchpatch, }: let @@ -46,9 +47,22 @@ let libzip = (libzip.override { # Known good version: 2.2.4 - zlib = zlib-ng.override { - withZlibCompat = true; - }; + zlib = + (zlib-ng.overrideAttrs (old: { + patches = old.patches or [ ] ++ [ + # Yarn hashes the output of libzip(untar(tarball)), so the output of libzip + # needs to be an exact match across versions, and this commit changes the + # exact output. This is ridiculous, but such is life. + (fetchpatch { + url = "https://github.com/zlib-ng/zlib-ng/commit/be819413be8a284b1827437006c0859644d0c367.patch"; + revert = true; + hash = "sha256-rwRcNKpA2dMWkC6WRATDOCYCDDqqPvFJkQ6DLDohQd8="; + }) + ]; + })).override + { + withZlibCompat = true; + }; }).overrideAttrs (old: { patches = (old.patches or [ ]) ++ [