···11{ lib, stdenv, fetchFromGitHub, cmake, bash, gnugrep
22, fixDarwinDylibNames
33, file
44+, fetchpatch
45, legacySupport ? false
56, static ? stdenv.hostPlatform.isStatic
67# these need to be ran on the host, thus disable when cross-compiling
···2728 # This patches makes sure we do not attempt to use the MD5 implementation
2829 # of the host platform when running the tests
2930 ./playtests-darwin.patch
3131+3232+ # Fixes linking for static builds
3333+ (fetchpatch {
3434+ url = "https://github.com/facebook/zstd/pull/2724/commits/e1f85dbca3a0ed5ef06c8396912a0914db8dea6a.patch";
3535+ sha256 = "sha256-PuYAqnJWAE+L9bsroOnnBGJhERW8LHrGSLtIEkKU9vg=";
3636+ })
3037 ];
31383239 postPatch = lib.optionalString (!static) ''