2015-03-26 15:41:17 +00:00
|
|
|
{stdenv, fetchurl}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "libsvm";
|
2018-07-18 19:28:23 +01:00
|
|
|
version = "3.23";
|
2015-03-26 15:41:17 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-01-05 19:42:46 +00:00
|
|
|
url = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/libsvm-${version}.tar.gz";
|
2018-07-18 19:28:23 +01:00
|
|
|
sha256 = "0jpaq0rr92x38p4nk3gjan79ip67m6p80anb28z1d8601miysyi5";
|
2015-03-26 15:41:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make
|
|
|
|
make lib
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = let
|
2017-09-12 20:36:41 +01:00
|
|
|
libSuff = stdenv.hostPlatform.extensions.sharedLibrary;
|
2015-03-26 15:41:17 +00:00
|
|
|
in ''
|
|
|
|
mkdir -p $out/lib $out/bin $out/include;
|
2017-09-12 20:36:41 +01:00
|
|
|
cp libsvm.so.2 $out/lib/libsvm.2${libSuff};
|
|
|
|
ln -s $out/lib/libsvm.2${libSuff} $out/lib/libsvm${libSuff};
|
2015-03-26 15:41:17 +00:00
|
|
|
cp svm-scale svm-train svm-predict $out/bin;
|
|
|
|
cp svm.h $out/include;
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
install_name_tool -id libsvm.2.dylib $out/lib/libsvm.2.dylib;
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A library for support vector machines";
|
2018-01-05 19:42:46 +00:00
|
|
|
homepage = https://www.csie.ntu.edu.tw/~cjlin/libsvm/;
|
2015-03-26 15:41:17 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.spwhitt ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|