2016-09-01 16:05:41 +01:00
|
|
|
{ lib, stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig, xorg, mesa_glu, mesa_noglu, glew
|
2015-10-07 23:53:32 +01:00
|
|
|
, cudaSupport ? false, cudatoolkit
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2016-03-22 20:33:31 +00:00
|
|
|
name = "opensubdiv-3.0.4";
|
2015-10-07 23:53:32 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PixarAnimationStudios";
|
|
|
|
repo = "OpenSubdiv";
|
2016-03-22 20:33:31 +00:00
|
|
|
rev = "v3_0_4";
|
|
|
|
sha256 = "14ylpzk4121gi3fl02dwmqjp5sbaqpkm4gd0lh6jijccdih0xsc0";
|
2015-10-07 23:53:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patches =
|
|
|
|
[ # Fix for building with cudatoolkit 7.
|
|
|
|
(fetchurl {
|
|
|
|
url = "https://github.com/opeca64/OpenSubdiv/commit/c3c258d00feaeffe1123f6077179c155e71febfb.patch";
|
|
|
|
sha256 = "0vazhp35v8vsgnvprkzwvfkbalr0kzcwlin9ygyfb77cz7mwicnf";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs =
|
2016-09-01 16:05:41 +01:00
|
|
|
[ cmake pkgconfig mesa_glu mesa_noglu
|
2015-10-07 23:53:32 +01:00
|
|
|
# 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;
|
|
|
|
|
2016-09-01 16:22:49 +01:00
|
|
|
postInstall = "rm $out/lib/*.a";
|
|
|
|
|
2015-10-07 23:53:32 +01:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|