From 1cbd07c4e6cca50e6244c2ec373d19d4d0d6a98a Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Fri, 19 Jul 2024 14:02:20 +0300 Subject: [PATCH] koboldcpp: backport old interfaces Refs: https://github.com/NixOS/nixpkgs/pull/327102#discussion_r1677136308 Refs: https://github.com/NixOS/nixpkgs/pull/327102#discussion_r1677136419 Refs: https://github.com/NixOS/nixpkgs/pull/327102#discussion_r1677137201 Co-authored-by: SomeoneSerge --- pkgs/by-name/ko/koboldcpp/package.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/by-name/ko/koboldcpp/package.nix b/pkgs/by-name/ko/koboldcpp/package.nix index 23b0f21bdac8..db7894de9b2e 100644 --- a/pkgs/by-name/ko/koboldcpp/package.nix +++ b/pkgs/by-name/ko/koboldcpp/package.nix @@ -5,6 +5,7 @@ makeWrapper, gitUpdater, python3Packages, + python311Packages ? null, # Ignored. Kept for compatibility with the release tk, addDriverRunpath, @@ -31,6 +32,8 @@ vulkan-loader, metalSupport ? stdenv.isDarwin && stdenv.isAarch64, + march ? "", + mtune ? "", }: let @@ -106,6 +109,14 @@ effectiveStdenv.mkDerivation (finalAttrs: { env.NIX_LDFLAGS = lib.concatStringsSep " " (finalAttrs.darwinLdFlags ++ finalAttrs.metalLdFlags); + env.NIX_CFLAGS_COMPILE = + lib.optionalString (march != "") ( + lib.warn "koboldcpp: the march argument is only kept for compatibility; use overrideAttrs intead" "-march=${march}" + ) + + lib.optionalString (mtune != "") ( + lib.warn "koboldcpp: the mtune argument is only kept for compatibility; use overrideAttrs intead" "-mtune=${mtune}" + ); + makeFlags = [ (makeBool "LLAMA_OPENBLAS" openblasSupport) (makeBool "LLAMA_CUBLAS" cublasSupport)