blender: Fix CUDA support

CUDA toolkit 8 doesn't support gcc 6, so we have to build opensubdiv
and blender with gcc 5.
This commit is contained in:
Eelco Dolstra 2017-09-16 22:38:31 +02:00
parent bb1c9b027d
commit afc0218ecd
3 changed files with 10 additions and 4 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, boost, cmake, ffmpeg, gettext, glew
{ stdenv, stdenv_gcc5, lib, fetchurl, boost, cmake, ffmpeg, gettext, glew
, ilmbase, libXi, libX11, libXext, libXrender
, libjpeg, libpng, libsamplerate, libsndfile
, libtiff, mesa, openal, opencolorio, openexr, openimageio, openjpeg_1, python
@ -10,7 +10,7 @@
with lib;
stdenv.mkDerivation rec {
(if cudaSupport then stdenv_gcc5 else stdenv).mkDerivation rec {
name = "blender-2.79";
src = fetchurl {
@ -65,6 +65,10 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}m";
# Since some dependencies are built with gcc 6, we need gcc 6's
# libstdc++ in our RPATH. Sigh.
NIX_LDFLAGS = optionalString cudaSupport "-rpath ${stdenv.cc.cc.lib}/lib";
enableParallelBuilding = true;
meta = with stdenv.lib; {

View File

@ -1,9 +1,9 @@
{ lib, stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig, xorg, mesa_glu
{ lib, stdenv, stdenv_gcc5, fetchurl, fetchFromGitHub, cmake, pkgconfig, xorg, mesa_glu
, mesa_noglu, glew, ocl-icd, python3
, cudaSupport ? false, cudatoolkit
}:
stdenv.mkDerivation rec {
(if cudaSupport then stdenv_gcc5 else stdenv).mkDerivation rec {
name = "opensubdiv-${version}";
version = "3.2.0";

View File

@ -9912,6 +9912,7 @@ with pkgs;
};
opensubdiv = callPackage ../development/libraries/opensubdiv {
stdenv_gcc5 = overrideCC stdenv gcc5;
cmake = cmake_2_8;
};
@ -13619,6 +13620,7 @@ with pkgs;
bleachbit = callPackage ../applications/misc/bleachbit { };
blender = callPackage ../applications/misc/blender {
stdenv_gcc5 = overrideCC stdenv gcc5;
python = python35;
};