Add headers to nix packages
Previously it was only copying the libs and binaries. This change should allow anyone using the flake to include the headers in their project.
This commit is contained in:
parent
25d43e0eb5
commit
20b8ff5064
1 changed files with 13 additions and 2 deletions
15
flake.nix
15
flake.nix
|
@ -38,6 +38,16 @@
|
|||
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
|
||||
cp $src/llama-util.h $out/include
|
||||
cp $src/ggml.h $out/include
|
||||
cp $src/ggml-alloc.h $out/include
|
||||
|
||||
cp $src/k_quants.h $out/include
|
||||
cp $src/ggml-mpi.h $out/include
|
||||
'';
|
||||
cmakeFlags = [ "-DLLAMA_BUILD_SERVER=ON" "-DLLAMA_MPI=ON" "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_SKIP_BUILD_RPATH=ON" ];
|
||||
in {
|
||||
|
@ -55,7 +65,8 @@
|
|||
"-DLLAMA_BLAS=ON"
|
||||
"-DLLAMA_BLAS_VENDOR=OpenBLAS"
|
||||
]);
|
||||
postInstall = postInstall;
|
||||
postInstall = (if isAarch64 && isDarwin then
|
||||
nixpkgs.lib.concatLines [postInstall "cp $src/ggml-metal.h $out/include"] else postInstall);
|
||||
meta.mainProgram = "llama";
|
||||
};
|
||||
packages.opencl = pkgs.stdenv.mkDerivation {
|
||||
|
@ -67,7 +78,7 @@
|
|||
cmakeFlags = cmakeFlags ++ [
|
||||
"-DLLAMA_CLBLAST=ON"
|
||||
];
|
||||
postInstall = postInstall;
|
||||
postInstall = nixpkgs.lib.concatLines [postInstall "cp $src/ggml-opencl.h $out/include"];
|
||||
meta.mainProgram = "llama";
|
||||
};
|
||||
apps.llama-server = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue