python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / libsvm / default.nix
blobfbc9bc4d33143805a9e09a590ce41c25977ee131
1 {lib, stdenv, fetchurl}:
3 stdenv.mkDerivation rec {
4   pname = "libsvm";
5   version = "3.25";
7   src = fetchurl {
8     url = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/libsvm-${version}.tar.gz";
9     sha256 = "sha256-UjUOiqdAsXbh13Pp3AjxNAIYw34BvsN6uQ2wEn5LteU=";
10   };
12   buildPhase = ''
13     make
14     make lib
15   '';
17   installPhase = let
18     libSuff = stdenv.hostPlatform.extensions.sharedLibrary;
19   in ''
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
26   '';
28   postFixup = lib.optionalString stdenv.isDarwin ''
29     install_name_tool -id libsvm.2.dylib $out/lib/libsvm.2.dylib;
30   '';
32   meta = with lib; {
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;
38   };