2020-02-25 16:31:53 +01:00
|
|
|
{ stdenv, fetchurl, fixDarwinDylibNames }:
|
2018-07-31 23:52:04 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "liblinear";
|
2019-05-01 15:51:44 +02:00
|
|
|
version = "2.30";
|
2018-07-31 23:52:04 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.csie.ntu.edu.tw/~cjlin/liblinear/liblinear-${version}.tar.gz";
|
2019-05-01 15:51:44 +02:00
|
|
|
sha256 = "1b66jpg9fdwsq7r52fccr8z7nqcivrin5d8zg2f134ygqqwp0748";
|
2018-07-31 23:52:04 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make
|
|
|
|
make lib
|
|
|
|
'';
|
|
|
|
|
2020-02-25 16:31:53 +01:00
|
|
|
installPhase = ''
|
2018-07-31 23:52:04 +02:00
|
|
|
mkdir -p $out/lib $out/bin $out/include
|
2020-01-15 12:47:40 +01:00
|
|
|
${if stdenv.isDarwin then ''
|
|
|
|
cp liblinear.so.3 $out/lib/liblinear.3.dylib
|
|
|
|
ln -s $out/lib/liblinear.3.dylib $out/lib/liblinear.dylib
|
|
|
|
'' else ''
|
|
|
|
cp liblinear.so.3 $out/lib/liblinear.so.3
|
|
|
|
ln -s $out/lib/liblinear.so.3 $out/lib/liblinear.so
|
|
|
|
''}
|
2018-07-31 23:52:04 +02:00
|
|
|
cp train $out/bin/liblinear-train
|
|
|
|
cp predict $out/bin/liblinear-predict
|
|
|
|
cp linear.h $out/include
|
|
|
|
'';
|
|
|
|
|
2020-02-25 16:31:53 +01:00
|
|
|
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin [ fixDarwinDylibNames ];
|
|
|
|
|
2018-07-31 23:52:04 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A library for large linear classification";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.csie.ntu.edu.tw/~cjlin/liblinear/";
|
2018-07-31 23:52:04 +02:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.danieldk ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|