Fix flake build on darwin
`flake.nix` hardcodes `lib*.so`; however, `lib*.dylib` is correct on MacOS. Moreover, one needs to perform an rpath update to ensure that lib-directory libraries can be found at runtime.
This commit is contained in:
parent
e782c9e735
commit
ad97ee3676
1 changed files with 13 additions and 1 deletions
14
flake.nix
14
flake.nix
|
@ -55,10 +55,22 @@
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
install -D bin/* -t $out/bin
|
install -D bin/* -t $out/bin
|
||||||
install -Dm644 lib*.so -t $out/lib
|
|
||||||
mv $out/bin/main $out/bin/llama
|
mv $out/bin/main $out/bin/llama
|
||||||
mv $out/bin/server $out/bin/llama-server
|
mv $out/bin/server $out/bin/llama-server
|
||||||
|
|
||||||
|
${if pkgs.stdenv.isDarwin then ''
|
||||||
|
install -Dm644 lib*.dylib -t $out/lib
|
||||||
|
for f in $out/lib/*.dylib; do
|
||||||
|
install_name_tool -id "$f" "$f"
|
||||||
|
done
|
||||||
|
for f in "$out"/bin/*; do
|
||||||
|
[[ $(${pkgs.file}/bin/file "$f") = *Mach-O* ]] || continue
|
||||||
|
install_name_tool -add_rpath "$out/lib" "$f"
|
||||||
|
done
|
||||||
|
'' else ''
|
||||||
|
install -Dm644 lib*.so -t $out/lib
|
||||||
|
''}
|
||||||
|
|
||||||
echo "#!${llama-python}/bin/python" > $out/bin/convert.py
|
echo "#!${llama-python}/bin/python" > $out/bin/convert.py
|
||||||
cat ${./convert.py} >> $out/bin/convert.py
|
cat ${./convert.py} >> $out/bin/convert.py
|
||||||
chmod +x $out/bin/convert.py
|
chmod +x $out/bin/convert.py
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue