blob: cb488fce9dd05846dda811f980090a10c5d1a788 (
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
|
# Maintainer: Xavier Francisco <echo moc.liamg@ocsicnarf.n.reivax | rev>
pkgname=headroom-ai
pkgver=0.37.0
pkgrel=1
pkgdesc="Context optimization layer for LLM applications - cut token costs by 50-90%"
arch=('x86_64')
url="https://github.com/chopratejas/headroom"
license=('Apache-2.0')
depends=(
'python>=3.10'
'python-tiktoken'
'python-pydantic'
'python-click'
'python-rich'
'python-opentelemetry-api'
'ast-grep'
'litellm'
)
makedepends=('rust' 'maturin' 'python-installer')
# The abi3 wheel's stripped _core.abi3.so leaves a dangling build-id debug
# symlink (named after the cpython-314 .so that never gets installed).
options=('!debug')
optdepends=(
'python-fastapi: proxy server support'
'uvicorn: proxy server support'
'python-httpx: proxy server with HTTP/2'
'python-openai: OpenAI API format support'
'python-tree-sitter-language-pack: AST-based code compression'
'python-numpy: relevance scoring, evals, and memory adapters'
'python-datasets: evaluation and voice training datasets'
'python-huggingface-hub: Kompress model downloads'
'python-transformers: HuggingFace tokenizers and Kompress compression'
'python-hnswlib: HNSW vector memory adapter'
)
source=("https://files.pythonhosted.org/packages/source/h/$pkgname/${pkgname//-/_}-$pkgver.tar.gz")
sha256sums=('7ffdecba91ce44dd02f1601499f6c935c47374b7cb6ec61e569b816a4bb78a26')
build() {
cd "${pkgname//-/_}-$pkgver"
# ring 0.17.14 fails to link under Arch's default LTO settings (undefined
# references to ring_core_0_17_14__* symbols); disable LTO for the C/C++
# bits it pulls in via cc-rs.
# PYO3_USE_ABI3_FORWARD_COMPATIBILITY: the bundled PyO3 0.22 supports up to
# cp313, but Arch ships Python 3.14; this flag suppresses the cap check.
CFLAGS+=" -fno-lto" CXXFLAGS+=" -fno-lto" \
PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 \
maturin build --release --strip --interpreter python3
}
package() {
cd "${pkgname//-/_}-$pkgver"
python -m installer --destdir="$pkgdir" target/wheels/*.whl
}
|