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

39 lines
1 KiB
Nix
Raw Normal View History

2015-03-26 16:41:17 +01:00
{stdenv, fetchurl}:
stdenv.mkDerivation rec {
name = "libsvm-${version}";
version = "3.20";
src = fetchurl {
url = "http://www.csie.ntu.edu.tw/~cjlin/libsvm/libsvm-${version}.tar.gz";
sha256 = "1gj5v5zp1qnsnv0iwxq0ikhf8262d3s5dq6syr6yqkglps0284hg";
};
buildPhase = ''
make
make lib
'';
installPhase = let
2017-09-12 21:36:41 +02:00
libSuff = stdenv.hostPlatform.extensions.sharedLibrary;
2015-03-26 16:41:17 +01:00
in ''
mkdir -p $out/lib $out/bin $out/include;
2017-09-12 21:36:41 +02:00
cp libsvm.so.2 $out/lib/libsvm.2${libSuff};
ln -s $out/lib/libsvm.2${libSuff} $out/lib/libsvm${libSuff};
2015-03-26 16:41:17 +01: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";
homepage = http://www.csie.ntu.edu.tw/~cjlin/libsvm/;
2015-03-26 16:41:17 +01:00
license = licenses.bsd3;
maintainers = [ maintainers.spwhitt ];
platforms = platforms.unix;
};
}