nixpkgs/pkgs/development/libraries/libsvm/default.nix

40 lines
1.1 KiB
Nix
Raw Normal View History

{lib, stdenv, fetchurl}:
2015-03-26 15:41:17 +00:00
stdenv.mkDerivation rec {
pname = "libsvm";
2021-04-30 21:01:45 +01:00
version = "3.25";
2015-03-26 15:41:17 +00:00
src = fetchurl {
url = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/libsvm-${version}.tar.gz";
2021-04-30 21:01:45 +01:00
sha256 = "sha256-UjUOiqdAsXbh13Pp3AjxNAIYw34BvsN6uQ2wEn5LteU=";
2015-03-26 15:41:17 +00:00
};
buildPhase = ''
make
make lib
2015-03-26 15:41:17 +00:00
'';
installPhase = let
2017-09-12 20:36:41 +01:00
libSuff = stdenv.hostPlatform.extensions.sharedLibrary;
2015-03-26 15:41:17 +00:00
in ''
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 15:41:17 +00:00
'';
postFixup = lib.optionalString stdenv.isDarwin ''
2015-03-26 15:41:17 +00:00
install_name_tool -id libsvm.2.dylib $out/lib/libsvm.2.dylib;
'';
meta = with lib; {
2015-03-26 15:41:17 +00:00
description = "A library for support vector machines";
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;
};
}