Fix xgboost python 2.7 build.

This commit is contained in:
Amos Bird 2017-03-29 17:57:46 +08:00
parent 8b512b10c7
commit 94c61cee66

View File

@ -30681,12 +30681,11 @@ EOF
propagatedBuildInputs = with self; [ scipy ];
buildInputs = with self; [ nose ];
# Cannot be installed with Python 2.x, most likely due to the patch below.
disabled = !isPy3k;
postPatch = ''
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 ["${pkgs.xgboost}/lib/libxgboost.so"]