nixpkgs/pkgs/development/libraries/libhwy/default.nix
Alyssa Ross 6a2200d338
pkgsStatic.libhwy: fix build (#230761)
This was changed in 7328b78fb5, but I don't understand why — the only
difference should be in static builds, which worked before that change
and didn't work after.

Fixes: 7328b78fb5 ("libhwy: 0.15.0 -> 1.0.2")
2023-05-09 12:16:02 +02:00

45 lines
1.3 KiB
Nix

{ lib, stdenv, cmake, ninja, gtest, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "libhwy";
version = "1.0.4";
src = fetchFromGitHub {
owner = "google";
repo = "highway";
rev = version;
hash = "sha256-bQtfye+gn7GOyzCtji4st5hsV40rPzuaYDP7N1tZ8wg=";
};
nativeBuildInputs = [ cmake ninja ];
# Required for case-insensitive filesystems ("BUILD" exists)
dontUseCmakeBuildDir = true;
cmakeFlags = let
libExt = stdenv.hostPlatform.extensions.library;
in [
"-GNinja"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
] ++ lib.optionals doCheck [
"-DHWY_SYSTEM_GTEST:BOOL=ON"
"-DGTEST_INCLUDE_DIR=${lib.getDev gtest}/include"
"-DGTEST_LIBRARY=${lib.getLib gtest}/lib/libgtest${libExt}"
"-DGTEST_MAIN_LIBRARY=${lib.getLib gtest}/lib/libgtest_main${libExt}"
] ++ lib.optionals stdenv.hostPlatform.isAarch32 [
"-DHWY_CMAKE_ARM7=ON"
];
# hydra's darwin machines run into https://github.com/libjxl/libjxl/issues/408
doCheck = !stdenv.hostPlatform.isDarwin;
meta = with lib; {
description = "Performance-portable, length-agnostic SIMD with runtime dispatch";
homepage = "https://github.com/google/highway";
license = licenses.asl20;
platforms = platforms.unix;
maintainers = with maintainers; [ zhaofengli ];
};
}