@@ -1,5 +1,5 @@
1−{ lib, buildPythonPackage, fetchPypi, python, boost, zlib, clang, ncurses
2−, pytest, docutils, pygments, numpy, scipy, scikitlearn }:
1+{ stdenv, lib, buildPythonPackage, fetchPypi, python, boost, zlib, clang
2+, ncurses, pytest, docutils, pygments, numpy, scipy, scikitlearn }:
33
44buildPythonPackage rec {
55 pname = "vowpalwabbit";
@@ -9,15 +9,27 @@ buildPythonPackage rec {
99 inherit pname version;
1010 sha256 = "0b517371fc64f1c728a0af42a31fa93def27306e9b4d25d6e5fd01bcff1b7304";
1111 };
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+
1219 # vw tries to write some explicit things to home
1320 # python installed: The directory '/homeless-shelter/.cache/pip/http'
1421 preInstall = ''
1522 export HOME=$PWD
1623 '';
1724
18− buildInputs = [ boost.dev zlib.dev clang ncurses pytest docutils pygments ];
25+ buildInputs = [ python.pkgs.boost zlib.dev clang ncurses pytest docutils pygments ];
1926 propagatedBuildInputs = [ numpy scipy scikitlearn ];
2027
28+ # Python ctypes.find_library uses DYLD_LIBRARY_PATH.
29+ preConfigure = lib.optionalString stdenv.isDarwin ''
30+ export DYLD_LIBRARY_PATH="${python.pkgs.boost}/lib"
31+ '';
32+
2133 checkPhase = ''
2234 # check-manifest requires a git clone, not a tarball
2335 # check-manifest --ignore "Makefile,PACKAGE.rst,*.cc,tox.ini,tests*,examples*,src*"
@@ -28,6 +40,7 @@ buildPythonPackage rec {
2840 description = "Vowpal Wabbit is a fast machine learning library for online learning, and this is the python wrapper for the project.";
2941 homepage = https://github.com/JohnLangford/vowpal_wabbit;
3042 license = licenses.bsd3;
43+ broken = stdenv.isAarch64;
3144 maintainers = with maintainers; [ teh ];
3245 };
3346}