1{ 2 stdenv, 3 lib, 4 fetchPypi, 5 buildPythonPackage, 6 cmake, 7 python, 8 zlib, 9 ncurses, 10 docutils, 11 pygments, 12 numpy, 13 scipy, 14 scikit-learn, 15 spdlog, 16 fmt, 17 rapidjson, 18}: 19 20buildPythonPackage rec { 21 pname = "vowpalwabbit"; 22 version = "9.10.0"; 23 format = "setuptools"; 24 25 src = fetchPypi { 26 inherit pname version; 27 hash = "sha256-Yyqm3MlW6UL+bCufFfzWg9mBBQNhLxR+g++ZrQ6qM/E="; 28 }; 29 30 nativeBuildInputs = [ cmake ]; 31 32 buildInputs = [ 33 docutils 34 ncurses 35 pygments 36 python.pkgs.boost 37 zlib.dev 38 spdlog 39 fmt 40 rapidjson 41 ]; 42 43 # As we disable configure via cmake, pass explicit global options to enable 44 # spdlog and fmt packages 45 setupPyGlobalFlags = [ "--cmake-options=-DSPDLOG_SYS_DEP=ON;-DFMT_SYS_DEP=ON" ]; 46 47 propagatedBuildInputs = [ 48 numpy 49 scikit-learn 50 scipy 51 ]; 52 53 # Python build script uses CMake, but we don't want CMake to do the 54 # configuration. 55 dontUseCmakeConfigure = true; 56 57 # Python ctypes.find_library uses DYLD_LIBRARY_PATH. 58 preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin '' 59 export DYLD_LIBRARY_PATH="${python.pkgs.boost}/lib" 60 ''; 61 62 checkPhase = '' 63 # check-manifest requires a git clone, not a tarball 64 # check-manifest --ignore "Makefile,PACKAGE.rst,*.cc,tox.ini,tests*,examples*,src*" 65 ${python.interpreter} setup.py check -ms 66 ''; 67 68 meta = with lib; { 69 description = "Vowpal Wabbit is a fast machine learning library for online learning, and this is the python wrapper for the project"; 70 homepage = "https://github.com/JohnLangford/vowpal_wabbit"; 71 license = licenses.bsd3; 72 maintainers = with maintainers; [ teh ]; 73 # Test again when new version is released 74 broken = stdenv.hostPlatform.isLinux; 75 }; 76}