Allow for metal development in nix package

This commit is contained in:
William Behrens 2023-08-11 20:45:33 -05:00 committed by GitHub
parent 23e0eba66b
commit a2b16d6172
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,7 +38,7 @@
postInstall = ''
mv $out/bin/main $out/bin/llama
mv $out/bin/server $out/bin/llama-server
mkdir $out/include
cp $src/llama.h $out/include
@ -67,7 +67,11 @@
"-DLLAMA_BLAS_VENDOR=OpenBLAS"
]);
postInstall = (if isAarch64 && isDarwin then
nixpkgs.lib.concatLines [postInstall "cp $src/ggml-metal.h $out/include"] else postInstall);
nixpkgs.lib.concatLines [
postInstall
"cp $src/ggml-metal.h $out/include"
"cp $src/ggml-metal.metal $out/bin"
] else postInstall);
meta.mainProgram = "llama";
};
packages.opencl = pkgs.stdenv.mkDerivation {