From c37f53ed56d4d7eb24ff2159c1bb5afcdbebb087 Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Thu, 26 Mar 2015 11:41:17 -0400 Subject: [PATCH] libsvm: New package --- pkgs/development/libraries/libsvm/default.nix | 38 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 40 insertions(+) create mode 100644 pkgs/development/libraries/libsvm/default.nix diff --git a/pkgs/development/libraries/libsvm/default.nix b/pkgs/development/libraries/libsvm/default.nix new file mode 100644 index 000000000000..9b6e87bd57e6 --- /dev/null +++ b/pkgs/development/libraries/libsvm/default.nix @@ -0,0 +1,38 @@ +{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 + libSuff = if stdenv.isDarwin then "dylib" else "so"; + in '' + mkdir -p $out/lib $out/bin $out/include; + cp libsvm.so.2 $out/lib/libsvm.2.${libSuff}; + ln -s $out/lib/libsvm.2.${libSuff} $out/lib/libsvm.${libSuff}; + 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/"; + license = licenses.bsd3; + maintainers = [ maintainers.spwhitt ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index db1d42c1614d..0b095ded2414 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6694,6 +6694,8 @@ let libstatgrab = callPackage ../development/libraries/libstatgrab { }; + libsvm = callPackage ../development/libraries/libsvm { }; + libtar = callPackage ../development/libraries/libtar { }; libtasn1 = callPackage ../development/libraries/libtasn1 { };