Skip to content

Commit

Permalink
ollama: 0.3.12 -> 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kaleocheng committed Nov 10, 2024
1 parent b7c6785 commit e0b5432
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 58 deletions.
22 changes: 0 additions & 22 deletions pkgs/by-name/ol/ollama/disable-git.patch

This file was deleted.

26 changes: 4 additions & 22 deletions pkgs/by-name/ol/ollama/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ assert builtins.elem acceleration [
let
pname = "ollama";
# don't forget to invalidate all hashes each update
version = "0.3.12";
version = "0.4.1";

src = fetchFromGitHub {
owner = "ollama";
repo = "ollama";
rev = "v${version}";
hash = "sha256-K1FYXEP0bTZa8M+V4/SxI+Q+LWs2rsAMZ/ETJCaO7P8=";
hash = "sha256-BXRCTBc+2LmY+FIRYTwuazWAhBErITbF70ihL24tqWw=";
fetchSubmodules = true;
};

vendorHash = "sha256-hSxcREAujhvzHVNwnRTfhi0MKI3s8HNavER2VLz6SYk=";
vendorHash = "sha256-mqaWq7wYnZi+Kyj7qawhM3jBBdYH0CEO4lwZKNQkgG8=";

validateFallback = lib.warnIf (config.rocmSupport && config.cudaSupport) (lib.concatStrings [
"both `nixpkgs.config.rocmSupport` and `nixpkgs.config.cudaSupport` are enabled, "
Expand Down Expand Up @@ -151,25 +151,9 @@ goBuild {
++ lib.optionals enableCuda cudaLibs
++ lib.optionals stdenv.hostPlatform.isDarwin metalFrameworks;

patches = [
# disable uses of `git` in the `go generate` script
# ollama's build script assumes the source is a git repo, but nix removes the git directory
# this also disables necessary patches contained in `ollama/llm/patches/`
# those patches are applied in `postPatch`
./disable-git.patch

# we provide our own deps at runtime
./skip-rocm-cp.patch
];

postPatch = ''
# replace inaccurate version number with actual release version
substituteInPlace version/version.go --replace-fail 0.0.0 '${version}'
# apply ollama's patches to `llama.cpp` submodule
for diff in llm/patches/*; do
patch -p1 -d llm/llama.cpp < $diff
done
'';

overrideModAttrs = (
Expand All @@ -180,10 +164,8 @@ goBuild {
);

preBuild = ''
# disable uses of `git`, since nix removes the git directory
export OLLAMA_SKIP_PATCHING=true
# build llama.cpp libraries for ollama
go generate ./...
make -j 5
'';

postFixup =
Expand Down
14 changes: 0 additions & 14 deletions pkgs/by-name/ol/ollama/skip-rocm-cp.patch

This file was deleted.

0 comments on commit e0b5432

Please sign in to comment.