1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 boost,
7 python3,
8 gtest,
9}:
10stdenv.mkDerivation (finalAttrs: {
11 pname = "numcpp";
12 version = "2.14.2";
13
14 src = fetchFromGitHub {
15 owner = "dpilger26";
16 repo = "NumCpp";
17 tag = "Version_${finalAttrs.version}";
18 hash = "sha256-A2x7Ar/Ihk4iGb7J93hGULtfoI8xidkGtpkVWgicSFI=";
19 };
20
21 patches = [ ./pytest-CMakeLists.patch ];
22
23 nativeCheckInputs = [
24 gtest
25 python3
26 ];
27
28 nativeBuildInputs = [ cmake ];
29
30 buildInputs = [ boost ];
31
32 cmakeFlags = lib.optionals finalAttrs.finalPackage.doCheck [
33 "-DBUILD_TESTS=ON"
34 "-DBUILD_MULTIPLE_TEST=ON"
35 ];
36
37 doCheck = !stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isStatic;
38
39 postInstall = ''
40 substituteInPlace $out/share/NumCpp/cmake/NumCppConfig.cmake \
41 --replace-fail "\''${PACKAGE_PREFIX_DIR}/" ""
42 '';
43
44 NIX_CFLAGS_COMPILE = "-Wno-error";
45
46 meta = {
47 description = "Templatized Header Only C++ Implementation of the Python NumPy Library";
48 homepage = "https://github.com/dpilger26/NumCpp";
49 license = lib.licenses.mit;
50 maintainers = with lib.maintainers; [ spalf ];
51 platforms = lib.platforms.unix;
52 };
53})