about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorSamuel Leathers <disasm@gmail.com>2020-02-19 12:46:07 -0500
committerGitHub <noreply@github.com>2020-02-19 12:46:07 -0500
commit47ab49ac44bb114943d7f84b05ea458d6f17e4a7 (patch)
tree8eb24a1a0025f40e19ff2f4690731d84585b340b /pkgs/development
parentc82021a72b0f0d6515f720f027cbbeeb24fee70c (diff)
parent0688cba0cdc50f18e4350f3c32039334076ec476 (diff)
downloadnixlib-47ab49ac44bb114943d7f84b05ea458d6f17e4a7.tar
nixlib-47ab49ac44bb114943d7f84b05ea458d6f17e4a7.tar.gz
nixlib-47ab49ac44bb114943d7f84b05ea458d6f17e4a7.tar.bz2
nixlib-47ab49ac44bb114943d7f84b05ea458d6f17e4a7.tar.lz
nixlib-47ab49ac44bb114943d7f84b05ea458d6f17e4a7.tar.xz
nixlib-47ab49ac44bb114943d7f84b05ea458d6f17e4a7.tar.zst
nixlib-47ab49ac44bb114943d7f84b05ea458d6f17e4a7.zip
Merge pull request #80467 from danieldk/fix-python-vowpalwabbit
python3Packages.vowpalwabbit: fix build
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/vowpalwabbit/default.nix50
-rw-r--r--pkgs/development/python-modules/vowpalwabbit/vowpal-wabbit-find-boost.diff34
2 files changed, 34 insertions, 50 deletions
diff --git a/pkgs/development/python-modules/vowpalwabbit/default.nix b/pkgs/development/python-modules/vowpalwabbit/default.nix
index d23f45b122f5..65dbce862a46 100644
--- a/pkgs/development/python-modules/vowpalwabbit/default.nix
+++ b/pkgs/development/python-modules/vowpalwabbit/default.nix
@@ -1,5 +1,17 @@
-{ stdenv, lib, buildPythonPackage, fetchPypi, python, zlib, clang
-, ncurses, pytest, docutils, pygments, numpy, scipy, scikitlearn }:
+{ stdenv
+, lib
+, fetchPypi
+, buildPythonPackage
+, cmake
+, python
+, zlib
+, ncurses
+, pytest
+, docutils
+, pygments
+, numpy
+, scipy
+, scikitlearn }:
 
 buildPythonPackage rec {
   pname = "vowpalwabbit";
@@ -10,21 +22,27 @@ buildPythonPackage rec {
     sha256 = "bd4c7e49a6ddaa1afedf97b22b822c7322328d686d45151b47a5127fc409c2af";
   };
 
-  # Should be fixed in next Python release after 8.5.0:
-  # https://github.com/JohnLangford/vowpal_wabbit/pull/1533
-  patches = [
-    ./vowpal-wabbit-find-boost.diff
+  nativeBuildInputs = [
+    cmake
   ];
 
-  # vw tries to write some explicit things to home
-  # python installed: The directory '/homeless-shelter/.cache/pip/http'
-  preInstall = ''
-    export HOME=$PWD
-  '';
+  buildInputs = [
+    docutils
+    ncurses
+    pygments
+    python.pkgs.boost
+    zlib.dev
+  ];
+
+  propagatedBuildInputs = [
+    numpy
+    scikitlearn
+    scipy
+  ];
 
-  nativeBuildInputs = [ clang ];
-  buildInputs = [ python.pkgs.boost zlib.dev ncurses pytest docutils pygments ];
-  propagatedBuildInputs = [ numpy scipy scikitlearn ];
+  # Python build script uses CMake, but we don't want CMake to do the
+  # configuration.
+  dontUseCmakeConfigure = true;
 
   # Python ctypes.find_library uses DYLD_LIBRARY_PATH.
   preConfigure = lib.optionalString stdenv.isDarwin ''
@@ -34,12 +52,12 @@ buildPythonPackage rec {
   checkPhase = ''
     # check-manifest requires a git clone, not a tarball
     # check-manifest --ignore "Makefile,PACKAGE.rst,*.cc,tox.ini,tests*,examples*,src*"
-    ${python.interpreter} setup.py check -mrs
+    ${python.interpreter} setup.py check -ms
   '';
 
   meta = with lib; {
     description = "Vowpal Wabbit is a fast machine learning library for online learning, and this is the python wrapper for the project.";
-    homepage    = https://github.com/JohnLangford/vowpal_wabbit;
+    homepage    = "https://github.com/JohnLangford/vowpal_wabbit";
     license     = licenses.bsd3;
     broken      = stdenv.isAarch64;
     maintainers = with maintainers; [ teh ];
diff --git a/pkgs/development/python-modules/vowpalwabbit/vowpal-wabbit-find-boost.diff b/pkgs/development/python-modules/vowpalwabbit/vowpal-wabbit-find-boost.diff
deleted file mode 100644
index 645956594bf6..000000000000
--- a/pkgs/development/python-modules/vowpalwabbit/vowpal-wabbit-find-boost.diff
+++ /dev/null
@@ -1,34 +0,0 @@
---- vowpalwabbit-8.5.0.orig/setup.py	2018-09-03 20:32:39.000000000 +0200
-+++ vowpalwabbit-8.5.0/setup.py	2018-09-03 20:34:09.000000000 +0200
-@@ -23,18 +23,11 @@
- 
- def find_boost():
-     """Find correct boost-python library information """
--    if system == 'Linux':
-+    if system == 'Linux' or system == 'Darwin':
-         # use version suffix if present
--        boost_lib = 'boost_python-py{v[0]}{v[1]}'.format(v=sys.version_info)
--        if sys.version_info.major == 3:
--            for candidate in ['-py36', '-py35', '-py34', '3']:
--                boost_lib = 'boost_python{}'.format(candidate)
--                if find_library(boost_lib):
--                    exit
-+        boost_lib = 'boost_python{v[0]}{v[1]}'.format(v=sys.version_info)
-         if not find_library(boost_lib):
-             boost_lib = "boost_python"
--    elif system == 'Darwin':
--        boost_lib = 'boost_python-mt' if sys.version_info[0] == 2 else 'boost_python3-mt'
-     elif system == 'Cygwin':
-         boost_lib = 'boost_python-mt' if sys.version_info[0] == 2 else 'boost_python3-mt'
-     else:
---- vowpalwabbit-8.5.0.orig/src/Makefile	2018-09-03 20:32:40.000000000 +0200
-+++ vowpalwabbit-8.5.0/src/Makefile	2018-09-03 21:42:30.000000000 +0200
-@@ -37,7 +37,7 @@
-   NPROCS:=$(shell grep -c ^processor /proc/cpuinfo)
- endif
- ifeq ($(UNAME), Darwin)
--  LIBS = -lboost_program_options-mt -lboost_serialization-mt -l pthread -l z
-+  LIBS = -lboost_program_options -lboost_serialization -l pthread -l z
-   # On Macs, the location isn't always clear
-   #	brew uses /usr/local
-   #	but /opt/local seems to be preferred by some users