From c4310727a342cf1b4ad2f05d15c941b7bdb5c116 Mon Sep 17 00:00:00 2001 From: IFoundSilentHouse Date: Wed, 1 May 2024 01:35:33 +0600 Subject: [PATCH] New package: ollama reworked @ezag PR: https://github.com/void-linux/void-packages/pull/48199 --- srcpkgs/ollama/files/ollama/run | 4 ++++ srcpkgs/ollama/template | 37 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 srcpkgs/ollama/files/ollama/run create mode 100644 srcpkgs/ollama/template diff --git a/srcpkgs/ollama/files/ollama/run b/srcpkgs/ollama/files/ollama/run new file mode 100644 index 00000000000000..d74b1845a35fee --- /dev/null +++ b/srcpkgs/ollama/files/ollama/run @@ -0,0 +1,4 @@ +#!/bin/sh +exec 2>&1 +export USER=ollama +exec chpst -u ollama:ollama ollama serve 2>&1 diff --git a/srcpkgs/ollama/template b/srcpkgs/ollama/template new file mode 100644 index 00000000000000..d1cbaf323153f6 --- /dev/null +++ b/srcpkgs/ollama/template @@ -0,0 +1,37 @@ +# Template file for 'ollama' +pkgname=ollama +version=0.1.32 +revision=1 +_llama_cpp_hash=7593639ce335e8d7f89aa9a54d616951f273af60 +archs="i686 x86_64* aarch64*" +build_style=go +go_import_path="github.com/ollama/ollama" +hostmakedepends="cmake git" +short_desc="Get up and running with large language models, locally" +maintainer="IFoundSilentHouse " +license="MIT" +homepage="https://ollama.com/" +distfiles="https://github.com/ollama/ollama/archive/refs/tags/v${version}.tar.gz + https://github.com/ggerganov/llama.cpp/archive/${_llama_cpp_hash}.tar.gz>llama.cpp-${_llama_cpp_hash}.tgz" +checksum="b8f43a9ce7731c8e19d801e6c08145e779ee607bf22864e495041e4440c5c283 + 3183900a2825281df1bd6825b183f8df7febe9dfa666d3197ad6df44007678e1" + +system_accounts=_ollama + +skip_extraction=llama.cpp-${_llama_cpp_hash}.tgz + +post_extract() { + vsrcextract -C llm/llama.cpp llama.cpp-${_llama_cpp_hash}.tgz +} + +pre_build() { + # "go generate" script uses "git submodule" command + git init + git add . + go generate ./... +} + +post_install() { + vlicense LICENSE + vsv ollama +}