1 {lib, stdenv, fetchurl}:
3 stdenv.mkDerivation rec {
8 url = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/libsvm-${version}.tar.gz";
9 sha256 = "sha256-UjUOiqdAsXbh13Pp3AjxNAIYw34BvsN6uQ2wEn5LteU=";
18 libSuff = stdenv.hostPlatform.extensions.sharedLibrary;
20 install -D libsvm.so.2 $out/lib/libsvm.2${libSuff}
21 ln -s $out/lib/libsvm.2${libSuff} $out/lib/libsvm${libSuff}
22 install -Dt $out/bin/ svm-scale svm-train svm-predict
23 install -Dm644 -t $out/include svm.h
24 mkdir $out/include/libsvm
25 ln -s $out/include/svm.h $out/include/libsvm/svm.h
28 postFixup = lib.optionalString stdenv.isDarwin ''
29 install_name_tool -id libsvm.2.dylib $out/lib/libsvm.2.dylib;
33 description = "A library for support vector machines";
34 homepage = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/";
35 license = licenses.bsd3;
36 maintainers = [ maintainers.spwhitt ];
37 platforms = platforms.unix;