liblinear: use absolute install name on Darwin (#81015)

nixpkgs prefers absolute install names. Replace the manually specified
relative install name with the standard hook.
This commit is contained in:
Andrew Childs 2020-02-26 00:31:53 +09:00 committed by GitHub
parent b9ee6cd85c
commit 1a73b69e20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{stdenv, fetchurl}:
{ stdenv, fetchurl, fixDarwinDylibNames }:
stdenv.mkDerivation rec {
pname = "liblinear";
@ -14,14 +14,11 @@ stdenv.mkDerivation rec {
make lib
'';
installPhase = let
libSuff = stdenv.hostPlatform.extensions.sharedLibrary;
in ''
installPhase = ''
mkdir -p $out/lib $out/bin $out/include
${if stdenv.isDarwin then ''
cp liblinear.so.3 $out/lib/liblinear.3.dylib
ln -s $out/lib/liblinear.3.dylib $out/lib/liblinear.dylib
install_name_tool -id liblinear.3.dylib $out/lib/liblinear.3.dylib
'' else ''
cp liblinear.so.3 $out/lib/liblinear.so.3
ln -s $out/lib/liblinear.so.3 $out/lib/liblinear.so
@ -31,6 +28,8 @@ stdenv.mkDerivation rec {
cp linear.h $out/include
'';
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin [ fixDarwinDylibNames ];
meta = with stdenv.lib; {
description = "A library for large linear classification";
homepage = https://www.csie.ntu.edu.tw/~cjlin/liblinear/;