anchor.diff:    };
   
     cudatoolkit8 = common {
  -    version = "8.0.61";
  +    version = "8.0.61.2";
       url = "https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run";
       sha256 = "1i4xrsqbad283qffvysn88w2pmxzxbbby41lw0j1113z771akv4w";
  +    runPatches = [
  +      (fetchurl {
  +        url = "https://developer.nvidia.com/compute/cuda/8.0/Prod2/patches/2/cuda_8.0.61.2_linux-run";
  +        sha256 = "1iaz5rrsnsb1p99qiqvxn6j3ksc7ry8xlr397kqcjzxqbljbqn9d";
  +      })
  +    ];
       gcc = gcc5;
     };
   
  
positive.code:     , name ? ""
      , developerProgram ? false
      , python ? python27
      }:
  
      stdenv.mkDerivation rec {
        name = "cudatoolkit-${version}";
        inherit (args) version;
  
        dontPatchELF = true;
        dontStrip = true;
  
negative.code: 
        rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc.lib}/lib64";
  
        phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
  
        unpackPhase = ''
          sh $src --keep --noexec
  
          cd pkg/run_files
          sh cuda-linux*.run --keep --noexec
          sh cuda-samples*.run --keep --noexec
          mv pkg ../../$(basename $src)
          cd ../..
          rm -rf pkg
  
          for patch in $runPatches; do
            sh $patch --keep --noexec
            mv pkg $(basename $patch)
          done
        '';
  
        installPhase = ''
          mkdir $out
          cd $(basename $src)
          perl ./install-linux.pl --prefix="$out"
          cd ..
          for patch in $runPatches; do
            cd $(basename $patch)
            perl ./install_patch.pl --silent --accept-eula --installdir="$out"
            cd ..
          done
  
          rm $out/tools/CUDA_Occupancy_Calculator.xls # FIXME: why?
  
          # let's remove the 32-bit libraries, they confuse the lib64->lib mover
          rm -rf $out/lib
  
          # Remove some cruft.
          rm $out/bin/uninstall*
  
          # Fixup path to samples (needed for cuda 6.5 or else nsight will not find them)
          if [ -d "$out"/cuda-samples ]; then
              mv "$out"/cuda-samples "$out"/samples
          fi
  
          # Change the #error on GCC > 4.9 to a #warning.
          sed -i $out/include/host_config.h -e 's/#error\(.*unsupported GNU version\)/#warning\1/'
  
          # Fix builds with newer glibc version
          sed -i "1 i#define _BITS_FLOATN_H" "$out/include/host_defines.h"
  
          # Ensure that cmake can find CUDA.
          mkdir -p $out/nix-support
          echo "cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out'" >> $out/nix-support/setup-hook
  
          # Move some libraries to the lib output so that programs that
          # depend on them don't pull in this entire monstrosity.
          mkdir -p $lib/lib
          mv -v $out/lib64/libcudart* $lib/lib/
  
          # Remove OpenCL libraries as they are provided by ocl-icd and driver.
          rm -f $out/lib64/libOpenCL*
  
          # Set compiler for NVCC.
          wrapProgram $out/bin/nvcc \
            --prefix PATH : ${gcc}/bin
        '' + lib.optionalString (lib.versionOlder version "8.0") ''
          # Hack to fix building against recent Glibc/GCC.
          echo "NIX_CFLAGS_COMPILE+=' -D_FORCE_INLINES'" >> $out/nix-support/setup-hook
        '';
  
        preFixup = ''
          while IFS= read -r -d ''$'\0' i; do
            if ! isELF "$i"; then continue; fi
            echo "patching $i..."
  