mirror of
https://github.com/hasktorch/tokenizers.git
synced 2024-09-11 05:15:46 +03:00
patch dylib
This commit is contained in:
parent
35abed54f7
commit
d96a1ae974
@ -1,6 +1,7 @@
|
||||
pkgs: _: with pkgs; {
|
||||
tokenizersPackages = import ./rust.nix {
|
||||
inherit
|
||||
stdenv
|
||||
pkgs
|
||||
;
|
||||
};
|
||||
|
15
nix/rust.nix
15
nix/rust.nix
@ -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; };
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user