From c40323558599a4762b9caa7b2d8482f409cf7938 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sat, 14 May 2016 02:03:54 +0300 Subject: [PATCH] xgboost: init at 2016-05-14 --- .../development/libraries/xgboost/default.nix | 30 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ pkgs/top-level/python-packages.nix | 22 ++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 pkgs/development/libraries/xgboost/default.nix diff --git a/pkgs/development/libraries/xgboost/default.nix b/pkgs/development/libraries/xgboost/default.nix new file mode 100644 index 00000000000..0006792ed2a --- /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 b31b2b8c8fd..690dab41d41 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 c2eec6d9d2e..1df9397f33e 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";