1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 boost,
7 jemalloc,
8 c-blosc,
9 tbb,
10 zlib,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "openvdb";
15 version = "12.0.1";
16
17 outputs = [
18 "out"
19 "dev"
20 ];
21
22 src = fetchFromGitHub {
23 owner = "AcademySoftwareFoundation";
24 repo = "openvdb";
25 tag = "v${version}";
26 hash = "sha256-ofVhwULBDzjA+bfhkW12tgTMnFB/Mku2P2jDm74rutY=";
27 };
28
29 nativeBuildInputs = [ cmake ];
30
31 buildInputs = [
32 boost
33 tbb
34 jemalloc
35 c-blosc
36 zlib
37 ];
38
39 cmakeFlags = [
40 "-DOPENVDB_CORE_STATIC=OFF"
41 "-DOPENVDB_BUILD_NANOVDB=ON"
42 ];
43
44 postFixup = ''
45 substituteInPlace $dev/lib/cmake/OpenVDB/FindOpenVDB.cmake \
46 --replace \''${OPENVDB_LIBRARYDIR} $out/lib \
47 --replace \''${OPENVDB_INCLUDEDIR} $dev/include
48 '';
49
50 meta = with lib; {
51 description = "Open framework for voxel";
52 mainProgram = "vdb_print";
53 homepage = "https://www.openvdb.org";
54 maintainers = [ maintainers.guibou ];
55 platforms = platforms.unix;
56 license = licenses.asl20;
57 };
58}