8a5d306878
Without the change the build fails as:
$ nix build --no-link -f. numcpp
error: hash mismatch in fixed-output derivation '/nix/store/400wj7x27ipf7jwljr3p70d8hafrps77-source.drv':
specified: sha256-+i4vUtd+UDP1e0Y+2Y31ldIWQenbtzssNrDazcU+tkQ=
got: sha256-5HWemgBhTUvoeommFOChWOplfEZPOXwQktkCeO5FnSU=
54 lines
1.1 KiB
Nix
54 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
cmake,
|
|
boost,
|
|
python3,
|
|
gtest,
|
|
}:
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "numcpp";
|
|
version = "2.15.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "dpilger26";
|
|
repo = "NumCpp";
|
|
tag = "Version_${finalAttrs.version}";
|
|
hash = "sha256-5HWemgBhTUvoeommFOChWOplfEZPOXwQktkCeO5FnSU=";
|
|
};
|
|
|
|
patches = [ ./pytest-CMakeLists.patch ];
|
|
|
|
nativeCheckInputs = [
|
|
gtest
|
|
python3
|
|
];
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ boost ];
|
|
|
|
cmakeFlags = lib.optionals finalAttrs.finalPackage.doCheck [
|
|
"-DBUILD_TESTS=ON"
|
|
"-DBUILD_MULTIPLE_TEST=ON"
|
|
];
|
|
|
|
doCheck = !stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isStatic;
|
|
|
|
postInstall = ''
|
|
substituteInPlace $out/share/NumCpp/cmake/NumCppConfig.cmake \
|
|
--replace-fail "\''${PACKAGE_PREFIX_DIR}/" ""
|
|
'';
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-error";
|
|
|
|
meta = {
|
|
description = "Templatized Header Only C++ Implementation of the Python NumPy Library";
|
|
homepage = "https://github.com/dpilger26/NumCpp";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ spalf ];
|
|
platforms = lib.platforms.unix;
|
|
};
|
|
})
|