Files
MX_Pmodule/careless-gpu/build
T

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" || :
}