{ pkgs
, pythonPackages
, thundersvm
, ...
}:

pythonPackages.buildPythonPackage rec {
  pname = "thundersvm-python";
  version = "0.3.4";

  src = pkgs.fetchFromGitHub {
    owner = "Xtra-Computing";
    repo = "thundersvm";
    rev = "5c6a056ac7f474b085d5415c81c5d48a1419642a";
    sha256 = "sha256-58YtOC8FK1d3ATETmwrEBc+/SQx0Pzlx5L1MgxXPQDE=";
  };

  #sourceRoot = "${src.name}/python";

  buildInputs = [
    pkgs.cudaPackages.cudatoolkit
    thundersvm
  ];

  dependencies = [
    pythonPackages.scikit-learn
  ];

  preBuild = ''
    ln -s ${thundersvm} build
    cd python
  '';

  doCheck = false;

  nativeBuildInputs = [
    pkgs.autoPatchelfHook
  ];

  meta = with pkgs.lib; {
    description = "Python bindings for ThunderSVM, with CUDA support";
    homepage = "https://github.com/Xtra-Computing/thundersvm";
    license = licenses.asl20;
    maintainers = [];
    platforms = platforms.linux;
  };
}

