Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub }: 2 3let 4 soVersion = "5"; 5in stdenv.mkDerivation rec { 6 pname = "liblinear"; 7 version = "2.46"; 8 9 src = fetchFromGitHub { 10 owner = "cjlin1"; 11 repo = "liblinear"; 12 rev = "v${builtins.replaceStrings ["."] [""] version}"; 13 sha256 = "sha256-mKd6idfr6mIIDEie8DCS+drtfpgKoS/5UXI0JenTxlA="; 14 }; 15 16 makeFlags = [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" ]; 17 18 outputs = [ "bin" "dev" "out" ]; 19 20 buildFlags = [ "lib" "predict" "train" ]; 21 22 installPhase = '' 23 ${if stdenv.isDarwin then '' 24 install -D liblinear.so.${soVersion} $out/lib/liblinear.${soVersion}.dylib 25 ln -s $out/lib/liblinear.${soVersion}.dylib $out/lib/liblinear.dylib 26 '' else '' 27 install -Dt $out/lib liblinear.so.${soVersion} 28 ln -s $out/lib/liblinear.so.${soVersion} $out/lib/liblinear.so 29 ''} 30 install -D train $bin/bin/liblinear-train 31 install -D predict $bin/bin/liblinear-predict 32 install -Dm444 -t $dev/include linear.h 33 ''; 34 35 meta = with lib; { 36 description = "A library for large linear classification"; 37 homepage = "https://www.csie.ntu.edu.tw/~cjlin/liblinear/"; 38 license = licenses.bsd3; 39 maintainers = [ ]; 40 platforms = platforms.unix; 41 }; 42}