blob: 3d618aecb952585a997c48240fbd1b654191c8ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# Maintainer: envolution
# Contributor: Wu Zhenyu <wuzhenyu@ustc.edu>
# shellcheck shell=bash disable=SC2034,SC2154
_pkgname=llama-cpp-python
pkgname=python-llama-cpp
pkgver=0.3.8
pkgrel=1
pkgdesc="Python bindings for llama.cpp"
arch=(any)
options=(!debug)
url=https://github.com/abetlen/llama-cpp-python
license=(GPL-3.0-or-later)
depends=(
python-typing_extensions
python-numpy
python-diskcache
)
optdepends=(
uvicorn # python-uvicorn
python-fastapi
python-pydantic-settings
python-sse-starlette
python-pyaml
)
makedepends=(
python-scikit-build
python-installer
python-build
python-wheel
python-scikit-build-core
)
checkdepends=(
python-pytest
python-huggingface-hub
python-scipy
python-httpx
python-fastapi
python-sse-starlette
#python-sse-starlette-context #missing but tests don't seem to require it
python-pydantic-settings
)
source=("https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/${_pkgname//-/_}-$pkgver.tar.gz")
sha256sums=('31c91323b555c025a76a30923cead9f5695da103dd68c15cdbb4509b17f0ed77')
_srcdir="llama_cpp_python-${pkgver}"
build() {
cd $_srcdir
export PREFIX=/usr
python -m build --wheel --no-isolation
}
check() {
cd $_srcdir
python -m pytest
}
package() {
local _sys_site=$(python -c "import sysconfig; print(sysconfig.get_paths()['purelib'])")
cd $_srcdir
python -m installer --destdir="$pkgdir" dist/*.whl
rm -r "$pkgdir/$_sys_site"/{lib,bin,include}
}
# vim:set ts=2 sw=2 et:
|