2021-01-21 18:00:13 +01:00
|
|
|
{lib, stdenv, fetchurl}:
|
2015-03-26 16:41:17 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "libsvm";
|
2021-04-30 22:01:45 +02:00
|
|
|
version = "3.25";
|
2015-03-26 16:41:17 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-01-05 20:42:46 +01:00
|
|
|
url = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/libsvm-${version}.tar.gz";
|
2021-04-30 22:01:45 +02:00
|
|
|
sha256 = "sha256-UjUOiqdAsXbh13Pp3AjxNAIYw34BvsN6uQ2wEn5LteU=";
|
2015-03-26 16:41:17 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ''
|
2020-08-03 19:22:12 +02:00
|
|
|
make
|
|
|
|
make lib
|
2015-03-26 16:41:17 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = let
|
2017-09-12 21:36:41 +02:00
|
|
|
libSuff = stdenv.hostPlatform.extensions.sharedLibrary;
|
2015-03-26 16:41:17 +01:00
|
|
|
in ''
|
2020-08-03 19:22:12 +02:00
|
|
|
install -D libsvm.so.2 $out/lib/libsvm.2${libSuff}
|
|
|
|
ln -s $out/lib/libsvm.2${libSuff} $out/lib/libsvm${libSuff}
|
|
|
|
install -Dt $out/bin/ svm-scale svm-train svm-predict
|
|
|
|
install -Dm644 -t $out/include svm.h
|
|
|
|
mkdir $out/include/libsvm
|
|
|
|
ln -s $out/include/svm.h $out/include/libsvm/svm.h
|
2015-03-26 16:41:17 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
postFixup = lib.optionalString stdenv.isDarwin ''
|
2015-03-26 16:41:17 +01:00
|
|
|
install_name_tool -id libsvm.2.dylib $out/lib/libsvm.2.dylib;
|
|
|
|
'';
|
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2015-03-26 16:41:17 +01:00
|
|
|
description = "A library for support vector machines";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/";
|
2015-03-26 16:41:17 +01:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.spwhitt ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|