37 lines
1.6 KiB
Python
Executable File
37 lines
1.6 KiB
Python
Executable File
#!/usr/bin/env modbuild
|
|
|
|
# qFit (multiconformer model building), uv route from the sha-pinned GitHub
|
|
# tarball. Three upstream traps handled here:
|
|
# - use_scm_version needs git metadata the tarball lacks -> SETUPTOOLS_SCM_PRETEND_VERSION
|
|
# - numpy pinned <1.22 -> newest CPython with wheels is 3.10
|
|
# - MIQP solvers (cvxopt, cplex) are only in environment.yml, not
|
|
# install_requires -> pip them explicitly or qfit dies at runtime
|
|
|
|
pbuild::configure() {
|
|
# modbuild's shell strips ~/.local/bin from PATH; override with UV=/path/to/uv if needed
|
|
UV="${UV:-$HOME/.local/bin/uv}"
|
|
export UV_CACHE_DIR="/opt/psi/MX/.uv-cache"
|
|
export UV_PYTHON_INSTALL_DIR="$PREFIX/python"
|
|
"$UV" venv --python 3.10 "$PREFIX/venv" || std::die 42 "uv venv failed - is uv at \$UV?"
|
|
}
|
|
|
|
pbuild::compile() {
|
|
:
|
|
}
|
|
|
|
pbuild::install() {
|
|
UV="${UV:-$HOME/.local/bin/uv}"
|
|
export UV_CACHE_DIR="/opt/psi/MX/.uv-cache"
|
|
export CC=gcc
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION="${V_PKG}"
|
|
# cplex is the IBM Community Edition pip wheel (problem-size limited);
|
|
# full CPLEX needs an academic license, see README.
|
|
# setuptools<81: qfit's logtools.py imports pkg_resources at RUNTIME; uv venvs
|
|
# don't ship setuptools, and setuptools >=81 removed pkg_resources entirely
|
|
# (verified: the 84.0.0 wheel has zero pkg_resources files, 80.9.0 has them)
|
|
"$UV" pip install --python "$PREFIX/venv/bin/python" \
|
|
'setuptools<81' cvxopt cplex "$SRC_DIR" || \
|
|
std::die 42 "qfit install failed - check build log above"
|
|
[[ -x "$PREFIX/venv/bin/qfit_protein" ]] || std::die 42 "qfit_protein missing from venv"
|
|
}
|