depot/third_party/nixpkgs/pkgs/development/libraries/liblinear/default.nix
Default email 410b979fe2 Project import generated by Copybara.
GitOrigin-RevId: a64e169e396460d6b5763a1de1dd197df8421688
2023-03-24 01:07:29 +01:00

42 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub }:
let
soVersion = "5";
in stdenv.mkDerivation rec {
pname = "liblinear";
version = "2.46";
src = fetchFromGitHub {
owner = "cjlin1";
repo = "liblinear";
rev = "v${builtins.replaceStrings ["."] [""] version}";
sha256 = "sha256-mKd6idfr6mIIDEie8DCS+drtfpgKoS/5UXI0JenTxlA=";
};
makeFlags = [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" ];
outputs = [ "bin" "dev" "out" ];
buildFlags = [ "lib" "predict" "train" ];
installPhase = ''
${if stdenv.isDarwin then ''
install -D liblinear.so.${soVersion} $out/lib/liblinear.${soVersion}.dylib
ln -s $out/lib/liblinear.${soVersion}.dylib $out/lib/liblinear.dylib
'' else ''
install -Dt $out/lib liblinear.so.${soVersion}
ln -s $out/lib/liblinear.so.${soVersion} $out/lib/liblinear.so
''}
install -D train $bin/bin/liblinear-train
install -D predict $bin/bin/liblinear-predict
install -Dm444 -t $dev/include linear.h
'';
meta = with lib; {
description = "A library for large linear classification";
homepage = "https://www.csie.ntu.edu.tw/~cjlin/liblinear/";
license = licenses.bsd3;
maintainers = [ ];
platforms = platforms.unix;
};
}