anchor.diff:          # 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/libOpenCL* $lib/lib/
   
         '' + lib.optionalString (lib.versionOlder version "8.0") ''
           # Hack to fix building against recent Glibc/GCC.
  
positive.code:       '';
  
        buildPhase = ''
          find . -type f -executable -exec patchelf \
            --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
            '{}' \; || true
          find . -type f -exec patchelf \
            --set-rpath $rpath:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64:$(cat $NIX_CC/nix-support/orig-cc)/lib \
            --force-rpath \
            '{}' \; || true
        '';
  
        installPhase = ''
          mkdir $out $sdk
          perl ./install-linux.pl --prefix="$out"
          rm $out/tools/CUDA_Occupancy_Calculator.xls
          perl ./install-sdk-linux.pl --prefix="$sdk" --cudaprefix="$out"
  
          # let's remove the 32-bit libraries, they confuse the lib64->lib mover
          rm -rf $out/lib
  
          # Fixup path to samples (needed for cuda 6.5 or else nsight will not find them)
          if [ -d "$out"/cuda-samples ]; then
  
negative.code:           }
          else throw "cudatoolkit does not support platform ${stdenv.system}";
  
        outputs = [ "out" "lib" "doc" ];
  
        buildInputs = [ perl ];
  
  