git.iko.soy/typeable/nixpkgs
on master help sign in
vowpal-wabbit: fix Darwin build.

- Follow the same logic for finding boost-python as for Linux. - Set DYLD_LIBRARY_PATH so that ctypes find_library can find boost-python. - Do not use '-mt' suffix when linking against boost-serialization and boost-program_options on Darwin.

commitfe7e89ba3b57b6d3a75fd0b7d08f13ba98f79700 authorDaniël de Kok <me@danieldk.eu> dateMon 3 Sep 2018, 21:48 (8 years ago) parent875bb6b
2 files changed+30−7
pkgs/development/python-modules/vowpalwabbit/default.nix+7−2 pkgs/development/python-modules/vowpalwabbit/vowpal-wabbit-find-boost.diff+23−5
pkgs/development/python-modules/vowpalwabbit/default.nix+7−2
@@ -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";
@@ -25,6 +25,11 @@ buildPythonPackage rec {
2525 buildInputs = [ python.pkgs.boost zlib.dev clang ncurses pytest docutils pygments ];
2626 propagatedBuildInputs = [ numpy scipy scikitlearn ];
2727
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+
2833 checkPhase = ''
2934 # check-manifest requires a git clone, not a tarball
3035 # check-manifest --ignore "Makefile,PACKAGE.rst,*.cc,tox.ini,tests*,examples*,src*"
pkgs/development/python-modules/vowpalwabbit/vowpal-wabbit-find-boost.diff+23−5
@@ -1,8 +1,11 @@
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 @@
1+--- vowpalwabbit-8.5.0.orig/setup.py 2018-09-03 20:32:39.000000000 +0200
2++++ vowpalwabbit-8.5.0/setup.py 2018-09-03 20:34:09.000000000 +0200
3+@@ -23,18 +23,11 @@
4+
5+ def find_boost():
46 """Find correct boost-python library information """
5− if system == 'Linux':
7+- if system == 'Linux':
8++ if system == 'Linux' or system == 'Darwin':
69 # use version suffix if present
710- boost_lib = 'boost_python-py{v[0]}{v[1]}'.format(v=sys.version_info)
811- if sys.version_info.major == 3:
@@ -13,4 +16,19 @@
1316+ boost_lib = 'boost_python{v[0]}{v[1]}'.format(v=sys.version_info)
1417 if not find_library(boost_lib):
1518 boost_lib = "boost_python"
16− elif system == 'Darwin':
19+- elif system == 'Darwin':
20+- boost_lib = 'boost_python-mt' if sys.version_info[0] == 2 else 'boost_python3-mt'
21+ elif system == 'Cygwin':
22+ boost_lib = 'boost_python-mt' if sys.version_info[0] == 2 else 'boost_python3-mt'
23+ else:
24+--- vowpalwabbit-8.5.0.orig/src/Makefile 2018-09-03 20:32:40.000000000 +0200
25++++ vowpalwabbit-8.5.0/src/Makefile 2018-09-03 21:42:30.000000000 +0200
26+@@ -37,7 +37,7 @@
27+ NPROCS:=$(shell grep -c ^processor /proc/cpuinfo)
28+ endif
29+ ifeq ($(UNAME), Darwin)
30+- LIBS = -lboost_program_options-mt -lboost_serialization-mt -l pthread -l z
31++ LIBS = -lboost_program_options -lboost_serialization -l pthread -l z
32+ # On Macs, the location isn't always clear
33+ # brew uses /usr/local
34+ # but /opt/local seems to be preferred by some users