patch dylib

This commit is contained in:
Torsten Scholak 2021-04-11 19:34:57 -04:00
parent 35abed54f7
commit d96a1ae974
No known key found for this signature in database
GPG Key ID: EF135E6C40866D80
2 changed files with 14 additions and 2 deletions

View File

@ -1,6 +1,7 @@
pkgs: _: with pkgs; {
tokenizersPackages = import ./rust.nix {
inherit
stdenv
pkgs
;
};

View File

@ -1,11 +1,21 @@
{ pkgs
{ stdenv
, pkgs
}:
with pkgs;
let
self = rec {
patchLibs =
if stdenv.isDarwin
then ''
install_name_tool -id $out/lib/libtokenizers_haskell.dylib $out/lib/libtokenizers_haskell.dylib
''
else ''
patchelf --set-rpath "${rpath}:$out/lib" $out/lib/libtokenizers_haskell.so
'';
self = {
tokenizers = naersk.buildPackage {
src = ../.;
buildInputs = [ libiconv pkgconfig ];
@ -26,6 +36,7 @@ let
copyBins = false;
copyLibs = true;
copyTarget = false;
overrideMain = x: x // { postInstall = patchLibs; };
};
};