nixpkgs/pkgs/by-name/li/liblinear/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

43 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub }:
let
soVersion = "5";
in stdenv.mkDerivation rec {
pname = "liblinear";
version = "2.47";
src = fetchFromGitHub {
owner = "cjlin1";
repo = "liblinear";
rev = "v${builtins.replaceStrings ["."] [""] version}";
sha256 = "sha256-so7uCc/52NdN0V2Ska8EUdw/wSegaudX5AF+c0xe5jk=";
};
makeFlags = [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" ];
outputs = [ "bin" "dev" "out" ];
buildFlags = [ "lib" "predict" "train" ];
installPhase = ''
${if stdenv.hostPlatform.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 = "Library for large linear classification";
homepage = "https://www.csie.ntu.edu.tw/~cjlin/liblinear/";
license = licenses.bsd3;
maintainers = [ ];
platforms = platforms.unix;
};
}