Files
MX_Pmodule/careless-gpu/build
T
duan_jandClaude Fable 5 b55d6c1d91 Split careless into CPU module and careless-gpu using cuda/12.8.1 module
careless installs plain careless (CPU). careless-gpu also installs plain
careless but declares cuda/12.8.1 as build_requires/runtime_deps
(jfjoch_viewer pattern) instead of pip-bundling CUDA via the [cuda] extra.
Both builds honor UV_CACHE_DIR to share one download cache.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 11:07:12 +02:00

27 lines
784 B
Python
Executable File

#!/usr/bin/env modbuild
pbuild::prep() {
:
}
pbuild::configure() {
# same uv pattern as the careless (CPU) module; see that build for the whys
UV="${UV:-$HOME/.local/bin/uv}"
export UV_CACHE_DIR="${UV_CACHE_DIR:-$PREFIX/.uv-cache}"
export UV_PYTHON_INSTALL_DIR="$PREFIX/python"
"$UV" venv --python 3.12 "$PREFIX/venv"
}
pbuild::compile() {
:
}
pbuild::install() {
UV="${UV:-$HOME/.local/bin/uv}"
export UV_CACHE_DIR="${UV_CACHE_DIR:-$PREFIX/.uv-cache}"
# no [cuda] extra: CUDA comes from the cuda/12.8.1 module
# (build_requires/runtime_deps in files/config.yaml), not from pip wheels
"$UV" pip install --python "$PREFIX/venv/bin/python" "careless==${V_PKG}"
[[ "$UV_CACHE_DIR" == "$PREFIX"* ]] && rm -rf "$UV_CACHE_DIR" || :
}