2018-03-15 01:17:55 +00:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, nose
|
|
|
|
, scipy
|
|
|
|
, xgboost
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2018-06-23 14:27:58 +01:00
|
|
|
pname = "xgboost";
|
2018-03-15 01:17:55 +00:00
|
|
|
inherit (xgboost) version src meta;
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ scipy ];
|
|
|
|
checkInputs = [ nose ];
|
|
|
|
|
|
|
|
postPatch = let
|
2018-06-23 14:27:58 +01:00
|
|
|
libname = "libxgboost.${stdenv.hostPlatform.extensions.sharedLibrary}";
|
2018-03-15 01:17:55 +00:00
|
|
|
|
|
|
|
in ''
|
|
|
|
cd python-package
|
|
|
|
|
|
|
|
sed "s/CURRENT_DIR = os.path.dirname(__file__)/CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))/g" -i setup.py
|
|
|
|
sed "/^LIB_PATH.*/a LIB_PATH = [os.path.relpath(LIB_PATH[0], CURRENT_DIR)]" -i setup.py
|
|
|
|
cat <<EOF >xgboost/libpath.py
|
|
|
|
def find_lib_path():
|
|
|
|
return ["${xgboost}/lib/${libname}"]
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm -rf $out/xgboost
|
|
|
|
'';
|
|
|
|
}
|