git.iko.soy/typeable/nixpkgs
on master help sign in
vowpalwabbit: fix build against boost-python.

Patch setup.py to look for libboost_python{Major}{Minor}.

commit875bb6bcb98de45bcc54c50cf4428ca9e3b1f7b5 authorDaniël de Kok <me@danieldk.eu> dateMon 3 Sep 2018, 15:47 (8 years ago) parent252c0d4
2 files changed+24−1
pkgs/development/python-modules/vowpalwabbit/default.nix+8−1 pkgs/development/python-modules/vowpalwabbit/vowpal-wabbit-find-boost.diff+16
pkgs/development/python-modules/vowpalwabbit/default.nix+8−1
@@ -9,13 +9,20 @@ 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
2128 checkPhase = ''
pkgs/development/python-modules/vowpalwabbit/vowpal-wabbit-find-boost.diffnew file+16
@@ -0,0 +1,16 @@
1+--- vowpalwabbit-8.5.0.orig/setup.py 2018-09-03 14:27:22.833621339 +0200
2++++ vowpalwabbit-8.5.0/setup.py 2018-09-03 14:37:18.076127914 +0200
3+@@ -25,12 +25,7 @@
4+ """Find correct boost-python library information """
5+ if system == 'Linux':
6+ # use version suffix if present
7+- boost_lib = 'boost_python-py{v[0]}{v[1]}'.format(v=sys.version_info)
8+- if sys.version_info.major == 3:
9+- for candidate in ['-py36', '-py35', '-py34', '3']:
10+- boost_lib = 'boost_python{}'.format(candidate)
11+- if find_library(boost_lib):
12+- exit
13++ boost_lib = 'boost_python{v[0]}{v[1]}'.format(v=sys.version_info)
14+ if not find_library(boost_lib):
15+ boost_lib = "boost_python"
16+ elif system == 'Darwin':