anchor.diff:      qtbase
       libXt
     ]
  -  ++ lib.optionals stdenv.isDarwin [ Cocoa AGL ];
  +  ++ lib.optionals stdenv.isDarwin [ Cocoa AGL ]
  +  ++ lib.optionals withCuda [ cudatoolkit ];
   
     cmakeFlags = lib.optionals stdenv.isDarwin [
       "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks"
  -  ];
  +  ] ++ lib.optionals withCuda [ "-DWITH_CUDA=true" ];
   
     meta = {
       homepage = "https://pointclouds.org/";
  
positive.code: { lib
  , stdenv
  , fetchFromGitHub
  , fetchpatch
  , wrapQtAppsHook
  , cmake
  , qhull
  
negative.code: , Cocoa
  , AGL
  , OpenGL
  , withCuda ? false, cudatoolkit
  }:
  
  stdenv.mkDerivation rec {
    pname = "pcl";
    version = "1.12.0";
  
    src = fetchFromGitHub {
      owner = "PointCloudLibrary";
      repo = "pcl";
      rev = "${pname}-${version}";
      sha256 = "0jhvciaw43y6iqqk7hyxnfhn1b4bsw5fpy04s01r5pkcsjjbdbqc";
    };
  
    nativeBuildInputs = [ pkg-config cmake wrapQtAppsHook ];
    buildInputs = [
  