lol
at 23.05-pre 52 lines 1.6 kB view raw
1{ lib, stdenv, cmake, ninja, gtest, fetchpatch, fetchFromGitHub }: 2 3stdenv.mkDerivation rec { 4 pname = "libhwy"; 5 version = "0.15.0"; 6 7 src = fetchFromGitHub { 8 owner = "google"; 9 repo = "highway"; 10 rev = version; 11 sha256 = "sha256-v2HyyHtBydr7QiI83DW1yRv2kWjUOGxFT6mmdrN9XPo="; 12 }; 13 14 patches = [ 15 # Remove on next release 16 # https://github.com/google/highway/issues/460 17 (fetchpatch { 18 name = "hwy-add-missing-includes.patch"; 19 url = "https://github.com/google/highway/commit/8ccab40c2f931aca6004d175eec342cc60f6baec.patch"; 20 sha256 = "sha256-wlp5gIvK2+OlKtsZwxq/pXTbESkUtimHXaYDjcBzmQ0="; 21 }) 22 ]; 23 24 nativeBuildInputs = [ cmake ninja ]; 25 26 # Required for case-insensitive filesystems ("BUILD" exists) 27 dontUseCmakeBuildDir = true; 28 29 cmakeFlags = let 30 libExt = stdenv.hostPlatform.extensions.library; 31 in [ 32 "-GNinja" 33 "-DCMAKE_INSTALL_LIBDIR=lib" 34 "-DCMAKE_INSTALL_INCLUDEDIR=include" 35 ] ++ lib.optionals doCheck [ 36 "-DHWY_SYSTEM_GTEST:BOOL=ON" 37 "-DGTEST_INCLUDE_DIR=${lib.getDev gtest}/include" 38 "-DGTEST_LIBRARY=${lib.getLib gtest}/lib/libgtest${libExt}" 39 "-DGTEST_MAIN_LIBRARY=${lib.getLib gtest}/lib/libgtest_main${libExt}" 40 ]; 41 42 # hydra's darwin machines run into https://github.com/libjxl/libjxl/issues/408 43 doCheck = !stdenv.hostPlatform.isDarwin; 44 45 meta = with lib; { 46 description = "Performance-portable, length-agnostic SIMD with runtime dispatch"; 47 homepage = "https://github.com/google/highway"; 48 license = licenses.asl20; 49 platforms = platforms.unix; 50 maintainers = with maintainers; [ zhaofengli ]; 51 }; 52}