storj-uplink: 1.119.15 -> 1.120.4 (#375732)
[NixPkgs.git] / pkgs / by-name / li / liblinear / package.nix
blob75ff37996e75ea995be2238647677a4c09af1898
2   lib,
3   stdenv,
4   fetchFromGitHub,
5 }:
7 let
8   soVersion = "5";
9 in
10 stdenv.mkDerivation rec {
11   pname = "liblinear";
12   version = "2.47";
14   src = fetchFromGitHub {
15     owner = "cjlin1";
16     repo = "liblinear";
17     rev = "v${builtins.replaceStrings [ "." ] [ "" ] version}";
18     sha256 = "sha256-so7uCc/52NdN0V2Ska8EUdw/wSegaudX5AF+c0xe5jk=";
19   };
21   makeFlags = [
22     "AR=${stdenv.cc.targetPrefix}ar"
23     "RANLIB=${stdenv.cc.targetPrefix}ranlib"
24   ];
26   outputs = [
27     "bin"
28     "dev"
29     "out"
30   ];
32   buildFlags = [
33     "lib"
34     "predict"
35     "train"
36   ];
38   installPhase = ''
39     ${
40       if stdenv.hostPlatform.isDarwin then
41         ''
42           install -D liblinear.so.${soVersion} $out/lib/liblinear.${soVersion}.dylib
43           ln -s $out/lib/liblinear.${soVersion}.dylib $out/lib/liblinear.dylib
44         ''
45       else
46         ''
47           install -Dt $out/lib liblinear.so.${soVersion}
48           ln -s $out/lib/liblinear.so.${soVersion} $out/lib/liblinear.so
49         ''
50     }
51     install -D train $bin/bin/liblinear-train
52     install -D predict $bin/bin/liblinear-predict
53     install -Dm444 -t $dev/include linear.h
54   '';
56   meta = with lib; {
57     description = "Library for large linear classification";
58     homepage = "https://www.csie.ntu.edu.tw/~cjlin/liblinear/";
59     license = licenses.bsd3;
60     maintainers = [ ];
61     platforms = platforms.unix;
62   };