xxHash: Build with cmake and allow all platforms (#163279)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Co-authored-by: Jan Tojnar <jtojnar@gmail.com>

authored by Rasmus Rendal Sandro Jan Tojnar and committed by GitHub 85be5352 ec684216

+25 -14
+25 -14
pkgs/development/libraries/xxHash/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub }: 2 3 stdenv.mkDerivation rec { 4 pname = "xxHash"; ··· 11 sha256 = "sha256-2WoYCO6QRHWrbGP2mK04/sLNTyQLOuL3urVktilAwMA="; 12 }; 13 14 - # Upstream Makefile does not anticipate that user may not want to 15 - # build .so library. 16 - postPatch = lib.optionalString stdenv.hostPlatform.isStatic '' 17 - sed -i 's/lib: libxxhash.a libxxhash/lib: libxxhash.a/' Makefile 18 - sed -i '/LIBXXH) $(DESTDIR/ d' Makefile 19 - ''; 20 21 - outputs = [ "out" "dev" ]; 22 23 - makeFlags = [ "PREFIX=$(dev)" "EXEC_PREFIX=$(out)" ]; 24 25 - # pkgs/build-support/setup-hooks/compress-man-pages.sh hook fails 26 - # to compress symlinked manpages. Avoid compressing manpages until 27 - # it's fixed. 28 - dontGzipMan = true; 29 30 meta = with lib; { 31 description = "Extremely fast hash algorithm"; ··· 39 homepage = "https://github.com/Cyan4973/xxHash"; 40 license = with licenses; [ bsd2 gpl2 ]; 41 maintainers = with maintainers; [ orivej ]; 42 - platforms = platforms.unix; 43 }; 44 }
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , cmake 5 + , fetchurl 6 + }: 7 8 stdenv.mkDerivation rec { 9 pname = "xxHash"; ··· 16 sha256 = "sha256-2WoYCO6QRHWrbGP2mK04/sLNTyQLOuL3urVktilAwMA="; 17 }; 18 19 + patches = [ 20 + # Merged in https://github.com/Cyan4973/xxHash/pull/649 21 + # Should be present in next release 22 + (fetchurl { 23 + name = "cmakeinstallfix.patch"; 24 + url = "https://github.com/Cyan4973/xxHash/commit/636f966ecc713c84ddd3b7ccfde2bfb2cc7492a0.patch"; 25 + hash = "sha256-fj+5V5mDhFgWGvrG1E4fEekL4eh7as0ouVvY4wnIHjs="; 26 + }) 27 + ]; 28 + 29 30 + nativeBuildInputs = [ 31 + cmake 32 + ]; 33 34 + # Using unofficial CMake build script to install CMake module files. 35 + cmakeDir = "../cmake_unofficial"; 36 37 + cmakeFlags = [ 38 + "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" 39 + ]; 40 41 meta = with lib; { 42 description = "Extremely fast hash algorithm"; ··· 50 homepage = "https://github.com/Cyan4973/xxHash"; 51 license = with licenses; [ bsd2 gpl2 ]; 52 maintainers = with maintainers; [ orivej ]; 53 + platforms = platforms.all; 54 }; 55 }