From 47fd767531f60d5e8703597da62fd95df82924be Mon Sep 17 00:00:00 2001 From: Pamplemousse Date: Mon, 16 Aug 2021 17:52:13 -0700 Subject: [PATCH] zstd: Fix static build --- pkgs/tools/compression/zstd/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/tools/compression/zstd/default.nix b/pkgs/tools/compression/zstd/default.nix index f87a144f7cc9..1f9b4a505ac4 100644 --- a/pkgs/tools/compression/zstd/default.nix +++ b/pkgs/tools/compression/zstd/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, fetchFromGitHub, cmake, bash, gnugrep , fixDarwinDylibNames , file +, fetchpatch , legacySupport ? false , static ? stdenv.hostPlatform.isStatic # these need to be ran on the host, thus disable when cross-compiling @@ -27,6 +28,12 @@ stdenv.mkDerivation rec { # This patches makes sure we do not attempt to use the MD5 implementation # of the host platform when running the tests ./playtests-darwin.patch + + # Fixes linking for static builds + (fetchpatch { + url = "https://github.com/facebook/zstd/pull/2724/commits/e1f85dbca3a0ed5ef06c8396912a0914db8dea6a.patch"; + sha256 = "sha256-PuYAqnJWAE+L9bsroOnnBGJhERW8LHrGSLtIEkKU9vg="; + }) ]; postPatch = lib.optionalString (!static) ''