1{ stdenv, lib, buildPythonPackage, fetchPypi, python, boost, zlib, clang
2, ncurses, pytest, docutils, pygments, numpy, scipy, scikitlearn }:
3
4buildPythonPackage rec {
5 pname = "vowpalwabbit";
6 version = "8.5.0";
7
8 src = fetchPypi{
9 inherit pname version;
10 sha256 = "0b517371fc64f1c728a0af42a31fa93def27306e9b4d25d6e5fd01bcff1b7304";
11 };
12
13 # Should be fixed in next Python release after 8.5.0:
14 # https://github.com/JohnLangford/vowpal_wabbit/pull/1533
15 patches = [
16 ./vowpal-wabbit-find-boost.diff
17 ];
18
19 # vw tries to write some explicit things to home
20 # python installed: The directory '/homeless-shelter/.cache/pip/http'
21 preInstall = ''
22 export HOME=$PWD
23 '';
24
25 nativeBuildInputs = [ clang ];
26 buildInputs = [ python.pkgs.boost zlib.dev ncurses pytest docutils pygments ];
27 propagatedBuildInputs = [ numpy scipy scikitlearn ];
28
29 # Python ctypes.find_library uses DYLD_LIBRARY_PATH.
30 preConfigure = lib.optionalString stdenv.isDarwin ''
31 export DYLD_LIBRARY_PATH="${python.pkgs.boost}/lib"
32 '';
33
34 checkPhase = ''
35 # check-manifest requires a git clone, not a tarball
36 # check-manifest --ignore "Makefile,PACKAGE.rst,*.cc,tox.ini,tests*,examples*,src*"
37 ${python.interpreter} setup.py check -mrs
38 '';
39
40 meta = with lib; {
41 description = "Vowpal Wabbit is a fast machine learning library for online learning, and this is the python wrapper for the project.";
42 homepage = https://github.com/JohnLangford/vowpal_wabbit;
43 license = licenses.bsd3;
44 broken = stdenv.isAarch64;
45 maintainers = with maintainers; [ teh ];
46 };
47}