xxHash: fix static build

Patch upstream Makefile to not attempt to build dynamic library if host
platform is static only (pkgsStatic).
This commit is contained in:
Dmitry Bogatov 2020-12-25 00:00:00 +00:00 committed by Frederik Rietdijk
parent 8121c9badb
commit efb7e1b9db

View file

@ -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)" ];