2024-01-25 14:12:00 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, boost, jemalloc, c-blosc, tbb, zlib }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec
|
|
|
|
{
|
|
|
|
pname = "openvdb";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "11.0.0";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-01-11 07:51:40 +00:00
|
|
|
owner = "AcademySoftwareFoundation";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "openvdb";
|
|
|
|
rev = "v${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
sha256 = "sha256-wDDjX0nKZ4/DIbEX33PoxR43dJDj2NF3fm+Egug62GQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
buildInputs = [ boost tbb jemalloc c-blosc zlib ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
cmakeFlags = [ "-DOPENVDB_CORE_STATIC=OFF" "-DOPENVDB_BUILD_NANOVDB=ON"];
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
# error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on macOS 10.13 or newer
|
|
|
|
env = lib.optionalAttrs (stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13" && lib.versionAtLeast tbb.version "2021.8.0") {
|
|
|
|
NIX_CFLAGS_COMPILE = "-faligned-allocation";
|
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
postFixup = ''
|
|
|
|
substituteInPlace $dev/lib/cmake/OpenVDB/FindOpenVDB.cmake \
|
|
|
|
--replace \''${OPENVDB_LIBRARYDIR} $out/lib \
|
|
|
|
--replace \''${OPENVDB_INCLUDEDIR} $dev/include
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An open framework for voxel";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "vdb_print";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.openvdb.org";
|
|
|
|
maintainers = [ maintainers.guibou ];
|
2022-07-14 12:49:19 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mpl20;
|
|
|
|
};
|
|
|
|
}
|