nixpkgs/pkgs/development/libraries/xsimd/default.nix

42 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, cmake, gtest }:
2022-08-19 03:24:50 +00:00
stdenv.mkDerivation rec {
pname = "xsimd";
2022-10-01 06:04:37 +00:00
version = "9.0.1";
src = fetchFromGitHub {
owner = "xtensor-stack";
repo = "xsimd";
rev = version;
2022-10-01 06:04:37 +00:00
sha256 = "sha256-onALN6agtrHWigtFlCeefD9CiRZI4Y690XTzy2UDnrk=";
};
nativeBuildInputs = [ cmake ];
cmakeFlags = [ "-DBUILD_TESTS=ON" ];
doCheck = true;
nativeCheckInputs = [ gtest ];
checkTarget = "xtest";
2022-08-19 03:24:50 +00:00
GTEST_FILTER =
let
# Upstream Issue: https://github.com/xtensor-stack/xsimd/issues/456
filteredTests = lib.optionals stdenv.hostPlatform.isDarwin [
2022-08-19 03:24:50 +00:00
"error_gamma_test/*"
];
2022-08-19 03:24:50 +00:00
in
"-${builtins.concatStringsSep ":" filteredTests}";
2022-05-19 13:48:12 +00:00
# https://github.com/xtensor-stack/xsimd/issues/748
postPatch = ''
substituteInPlace xsimd.pc.in \
--replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
'';
meta = with lib; {
description = "C++ wrappers for SIMD intrinsics";
homepage = "https://github.com/xtensor-stack/xsimd";
license = licenses.bsd3;
maintainers = with maintainers; [ tobim ];
platforms = platforms.all;
};
}