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