Merge pull request #24439 from amosbird/master

Fix xgboost python 2.7 build.
This commit is contained in:
Frederik Rietdijk 2017-03-29 18:20:14 +02:00 committed by GitHub
commit 30449c5e36

View File

@ -30698,12 +30698,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"]