llama-cpp: fix build due to openblas update

add patch so build checks for openblas64 module

https://github.com/NixOS/nixpkgs/pull/255443 updated from openblas
0.3.21 -> 0.3.24.  openblas 0.3.22 moved openblas.pc -> openblas64.pc

https://github.com/OpenMathLib/OpenBLAS/issues/3790
This commit is contained in:
annalee 2023-11-19 06:04:29 +00:00 committed by Jörg Thalheim
parent 2a85706366
commit 05967f9a2c

View File

@ -2,6 +2,7 @@
, cmake
, darwin
, fetchFromGitHub
, fetchpatch
, nix-update-script
, stdenv
, symlinkJoin
@ -46,6 +47,17 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-TYklPkqwXLt+80FSHBDA2r3xTXlmgqB7sOt2mNnVNso=";
};
patches = [
# openblas > v0.3.21 64-bit pkg-config file is now named openblas64.pc
# can remove when patch is accepted upstream
# https://github.com/ggerganov/llama.cpp/pull/4134
(fetchpatch {
name = "openblas64-pkg-config.patch";
url = "https://github.com/ggerganov/llama.cpp/commit/c885cc9f76c00557601b877136191b0f7aadc320.patch";
hash = "sha256-GBTxCiNrCazYRvcHwbqVMAALuJ+Svzf5BE7+nkxw064=";
})
];
postPatch = ''
substituteInPlace ./ggml-metal.m \
--replace '[bundle pathForResource:@"ggml-metal" ofType:@"metal"];' "@\"$out/bin/ggml-metal.metal\";"