diff --git a/pkgs/development/libraries/xgboost/default.nix b/pkgs/development/libraries/xgboost/default.nix new file mode 100644 index 000000000000..0006792ed2aa --- /dev/null +++ b/pkgs/development/libraries/xgboost/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchgit }: + +stdenv.mkDerivation rec { + name = "xgboost-${version}"; + version = "2016-05-14"; + + # needs submodules + src = fetchgit { + url = "https://github.com/dmlc/xgboost"; + rev = "9c26566eb09733423f821f139938ff4105c3775d"; + sha256 = "0nmhgl70mnc2igkfppdw2in66zdczzsqxrlsb4bknrglpp3axnm1"; + }; + + enableParallelBuilding = true; + + installPhase = '' + mkdir -p $out + cp -r include $out + install -Dm755 lib/libxgboost.so $out/lib/libxgboost.so + install -Dm755 xgboost $out/bin/xgboost + ''; + + meta = with stdenv.lib; { + description = "Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library"; + homepage = "https://github.com/dmlc/xgboost"; + license = licenses.apl20; + platforms = platforms.linux; + maintainers = with maintainers; [ abbradar ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b31b2b8c8fdb..690dab41d413 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9297,6 +9297,8 @@ in xalanc = callPackage ../development/libraries/xalanc {}; + xgboost = callPackage ../development/libraries/xgboost { }; + # Avoid using this. It isn't really a wrapper anymore, but we keep the name. xlibsWrapper = callPackage ../development/libraries/xlibs-wrapper { packages = [ diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c2eec6d9d2e8..1df9397f33e0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -26610,6 +26610,28 @@ in modules // { }; }; + xgboost = buildPythonPackage rec { + name = "xgboost-${version}"; + + inherit (pkgs.xgboost) version src meta; + + propagatedBuildInputs = with self; [ scipy ]; + buildInputs = with self; [ nose ]; + + postPatch = '' + cd python-package + + cat <xgboost/libpath.py + def find_lib_path(): + return ["${pkgs.xgboost}/lib/libxgboost.so"] + EOF + ''; + + postInstall = '' + rm -rf $out/xgboost + ''; + }; + xkcdpass = buildPythonPackage rec { name = "xkcdpass-${version}"; version = "1.4.2";