3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/science/machine-learning/shogun/default.nix

58 lines
1.7 KiB
Nix
Raw Normal View History

2017-12-03 11:27:45 +00:00
{ stdenv, lib, fetchFromGitHub, fetchpatch, ccache, cmake, ctags, swig
2017-10-29 09:20:12 +00:00
# data, compression
, bzip2, curl, hdf5, json_c, lzma, lzo, protobuf, snappy
# maths
, blas, eigen, nlopt, lp_solve, colpack
# libraries
, libarchive, liblapack, libxml2
# extra support
, pythonSupport ? true, pythonPackages ? null
, opencvSupport ? false, opencv ? null
}:
assert pythonSupport -> pythonPackages != null;
assert opencvSupport -> opencv != null;
stdenv.mkDerivation rec {
pname = "shogun";
version = "6.0.0";
name = pname + "-" + version;
src = fetchFromGitHub {
owner = pname + "-toolbox";
repo = pname;
rev = pname + "_" + version;
sha256 = "0f2zwzvn5apvwypkfkq371xp7c5bdb4g1fwqfh8c2d57ysjxhmgf";
fetchSubmodules = true;
};
2017-12-03 11:27:45 +00:00
patches = fetchpatch {
name = "Fix-meta-example-parser-bug-in-parallel-builds.patch";
url = "https://github.com/shogun-toolbox/shogun/commit/ecd6a8f11ac52748e89d27c7fab7f43c1de39f05.patch";
sha256 = "1hrwwrj78sxhwcvgaz7n4kvh5y9snfcc4jf5xpgji5hjymnl311n";
};
2017-10-29 09:20:12 +00:00
CCACHE_DIR=".ccache";
buildInputs = with lib; [
blas bzip2 ccache cmake colpack curl ctags eigen hdf5 json_c lp_solve lzma lzo
protobuf nlopt snappy swig (libarchive.dev) liblapack libxml2
]
++ optionals (pythonSupport) (with pythonPackages; [ python ply numpy ])
++ optional (opencvSupport) opencv;
cmakeFlags = with lib; []
++ (optional (pythonSupport) "-DPythonModular=ON")
++ (optional (opencvSupport) "-DOpenCV=ON")
;
meta = with stdenv.lib; {
description = "A toolbox which offers a wide range of efficient and unified machine learning methods";
homepage = "http://shogun-toolbox.org/";
license = licenses.gpl3;
maintainers = with maintainers; [ edwtjo ];
};
}