about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/xgboost/default.nix
blob: 81a8d05f5bf0cb94c0b48dce1c38729d13af9fc7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ buildPythonPackage
, pytest
, nose
, scipy
, scikitlearn
, stdenv
, xgboost
, substituteAll
, pandas
, matplotlib
, graphviz
, datatable
}:

buildPythonPackage {
  pname = "xgboost";
  inherit (xgboost) version src meta;

  patches = [
    (substituteAll {
      src = ./lib-path-for-python.patch;
      libpath = "${xgboost}/lib";
      extention = stdenv.hostPlatform.extensions.sharedLibrary;
    })
  ];

  postPatch = "cd python-package";

  propagatedBuildInputs = [ scipy ];
  buildInputs = [ xgboost ];
  checkInputs = [ nose pytest scikitlearn pandas matplotlib graphviz datatable ];

  checkPhase = ''
    ln -sf ../demo .
    nosetests ../tests/python
  '';
}