Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
1.9 kB · 72 lines
Shell
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273# shellcheck shell=bashecho "Sourcing sphinx-hook"
declare -a __sphinxBuilders
buildSphinxPhase() { echo "Executing buildSphinxPhase"
local __sphinxRoot="" runHook preBuildSphinx
if [[ -n "${sphinxRoot:-}" ]]; then # explicit root if ! [[ -f "${sphinxRoot}/conf.py" ]]; then echo 2>&1 "$sphinxRoot/conf.py: no such file" exit 1 fi __sphinxRoot=$sphinxRoot else for candidate in doc docs doc/source docs/source; do if [[ -f "$candidate/conf.py" ]]; then echo "Sphinx documentation found in $candidate" __sphinxRoot=$candidate break fi done fi
if [[ -z "${__sphinxRoot}" ]]; then echo 2>&1 "Sphinx documentation not found, use 'sphinxRoot' variable" exit 1 fi
if [ -n "${sphinxBuilders-}" ]; then eval "__sphinxBuilders=($sphinxBuilders)" else __sphinxBuilders=(html) fi
for __builder in "${__sphinxBuilders[@]}"; do echo "Executing sphinx-build with ${__builder} builder" @sphinxBuild@ -M "${__builder}" "${__sphinxRoot}" ".sphinx/${__builder}" -v done
runHook postBuildSphinx}
installSphinxPhase() { echo "Executing installSphinxPhase"
local docdir="" runHook preInstallSphinx
for __builder in "${__sphinxBuilders[@]}"; do # divert output for man builder if [ "$__builder" == "man" ]; then installManPage .sphinx/man/man/*
else # shellcheck disable=2154 docdir="${doc:-$out}/share/doc/${name}"
mkdir -p "$docdir"
cp -r ".sphinx/${__builder}/${__builder}" "$docdir/" rm -fr "${docdir}/${__builder}/_sources" "${docdir}/${__builder}/.buildinfo" fi done
runHook postInstallSphinx}
appendToVar preFixupPhases buildSphinxPhase installSphinxPhase