#!/usr/bin/env modbuild # Download happens in the default prep via urls: in files/config.yaml. # unpacker: none because BINARY.setup patches paths relative to its final # location — we untar once, directly into $PREFIX, instead of unpacking # ~20 GB into the build tmp and copying it over. pbuild::configure() { : } pbuild::compile() { : } pbuild::install() { cd "${PREFIX}" # modbuild has no errexit in hooks — without the die-guards a failed step # still ends in a "done" build with a broken PREFIX (happened 2026-08-18 # with a truncated cached tarball). tar -xzf "${SRC_DIR}/ccp4-${V}-shelx-arp-x86_64.tar.gz" || \ std::die 42 "ccp4: untar failed — cached tarball likely truncated; rm it from the distfiles dir and re-run (fetch a fresh sid link if the download fails)" # the 9-series tarball unpacks to ccp4-9 (NOT ccp4-9.0 as the install doc # implies) — glob instead of guessing the name local -a top=( ccp4-*/ ) [[ -x "${top[0]}BINARY.setup" ]] || \ std::die 42 "ccp4: ${top[0]}BINARY.setup not found — vendor layout changed, inspect ${PREFIX}" # Pre-agree the CCP4 licence so BINARY.setup skips its interactive prompt # (downloading from ccp4.ac.uk already required accepting it). The printf # answers any prompt a newer BINARY.setup might still ask; printf instead # of `yes` because modbuild runs with pipefail and yes dies by SIGPIPE. touch "${PREFIX}/.agree2ccp4v6" "${HOME}/.agree2ccp4v6" printf 'y\ny\ny\n' | "./${top[0]}BINARY.setup" || \ std::die 42 "ccp4: BINARY.setup failed" # version-independent symlink so the modulefile survives 9.x updates ln -sfn "${top[0]%/}" ccp4 [[ -r ccp4/bin/ccp4.setup-sh ]] || \ std::die 42 "ccp4: ccp4/bin/ccp4.setup-sh missing after setup — the modulefile would be broken" }