at 23.11-beta 1.1 kB view raw
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.12.1"; 13 14 src = fetchFromGitHub { 15 owner = "dpilger26"; 16 repo = "NumCpp"; 17 rev = "Version_${finalAttrs.version}"; 18 hash = "sha256-1LGyDvT+PiGRXn7NorcYUjSPzNuRv/YXhQWIaOa7xdo="; 19 }; 20 21 nativeCheckInputs = [gtest python3]; 22 23 nativeBuildInputs = [cmake]; 24 25 buildInputs = [boost]; 26 27 cmakeFlags = lib.optionals finalAttrs.finalPackage.doCheck [ 28 "-DBUILD_TESTS=ON" 29 "-DBUILD_MULTIPLE_TEST=ON" 30 ]; 31 32 doCheck = !stdenv.isDarwin && !stdenv.hostPlatform.isStatic; 33 34 postInstall = '' 35 substituteInPlace $out/share/NumCpp/cmake/NumCppConfig.cmake \ 36 --replace "\''${PACKAGE_PREFIX_DIR}/" "" 37 ''; 38 39 NIX_CFLAGS_COMPILE="-Wno-error"; 40 41 meta = with lib; { 42 description = "A Templatized Header Only C++ Implementation of the Python NumPy Library"; 43 homepage = "https://github.com/dpilger26/NumCpp"; 44 license = licenses.mit; 45 maintainers = with maintainers; [spalf]; 46 platforms = platforms.unix; 47 }; 48})