From efb7e1b9db96aeec279c801e270e13fe59e67f23 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Fri, 25 Dec 2020 00:00:00 +0000 Subject: [PATCH] xxHash: fix static build Patch upstream Makefile to not attempt to build dynamic library if host platform is static only (pkgsStatic). --- pkgs/development/libraries/xxHash/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/libraries/xxHash/default.nix b/pkgs/development/libraries/xxHash/default.nix index e572e8bb31ff..a5e6bfb11a68 100644 --- a/pkgs/development/libraries/xxHash/default.nix +++ b/pkgs/development/libraries/xxHash/default.nix @@ -11,6 +11,13 @@ stdenv.mkDerivation rec { sha256 = "0hpbzdd6kfki5f61g103vp7pfczqkdj0js63avl0ss552jfb8h96"; }; + # Upstream Makefile does not anticipate that user may not want to + # build .so library. + postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isStatic '' + sed -i 's/lib: libxxhash.a libxxhash/lib: libxxhash.a/' Makefile + sed -i '/LIBXXH) $(DESTDIR/ d' Makefile + ''; + outputs = [ "out" "dev" ]; makeFlags = [ "PREFIX=$(dev)" "EXEC_PREFIX=$(out)" ];