blob: f5f84ee1546363356ccd08e0844c7f55f5a648a7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
{ lib, stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig, xorg, mesa_glu, mesa_noglu, glew
, cudaSupport ? false, cudatoolkit
}:
stdenv.mkDerivation {
name = "opensubdiv-3.0.5";
src = fetchFromGitHub {
owner = "PixarAnimationStudios";
repo = "OpenSubdiv";
rev = "v3_0_5";
sha256 = "16xv4cw1k75wgd4ddr0sa87wd46ygbn2k2avh9c1mfd405p80d92";
};
outputs = [ "out" "dev" ];
patches =
[ # Fix for building with cudatoolkit 7.
(fetchurl {
url = "https://github.com/opeca64/OpenSubdiv/commit/c3c258d00feaeffe1123f6077179c155e71febfb.patch";
sha256 = "0vazhp35v8vsgnvprkzwvfkbalr0kzcwlin9ygyfb77cz7mwicnf";
})
];
buildInputs =
[ cmake pkgconfig mesa_glu mesa_noglu
# FIXME: these are not actually needed, but the configure script wants them.
glew xorg.libX11 xorg.libXrandr xorg.libXxf86vm xorg.libXcursor xorg.libXinerama
]
++ lib.optional cudaSupport cudatoolkit;
cmakeFlags =
[ "-DNO_TUTORIALS=1"
"-DNO_REGRESSION=1"
"-DNO_EXAMPLES=1"
"-DGLEW_INCLUDE_DIR=${glew}/include"
"-DGLEW_LIBRARY=${glew}/lib"
];
enableParallelBuilding = true;
postInstall =
''
rm $out/lib/*.a
'' + lib.optionalString cudaSupport ''
# Drop cudatoolkit reference from the closure. We'll get
# libOpenCL from /run/opengl-driver.
s=${cudatoolkit}/lib
t=$(for ((i = 0; i < ''${#s}; i++)); do echo -n X; done)
sed -i $out/lib/libosdGPU.so.* -e "s|$s|$t|g"
'';
meta = {
description = "An Open-Source subdivision surface library";
homepage = http://graphics.pixar.com/opensubdiv;
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.eelco ];
license = lib.licenses.asl20;
};
}
|