Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 910278
Collapse All | Expand All

(-)a/eclass/docs.eclass (-27 / +33 lines)
Lines 186-206 initialize_git_repo() { Link Here
186
	fi
186
	fi
187
}
187
}
188
188
189
# @FUNCTION: python_append_deps
189
# @FUNCTION: _docs_set_python_deps
190
# @INTERNAL
190
# @INTERNAL
191
# @DESCRIPTION:
191
# @DESCRIPTION:
192
# Appends [\${PYTHON_USEDEP}] to all dependencies
192
# Add python_gen_any_dep or python_gen_cond_dep
193
# for python based DOCS_BUILDERs such as mkdocs or
193
# to DOCS_DEPEND and define python_check_deps
194
# sphinx.
194
_docs_set_python_deps() {
195
python_append_deps() {
196
	debug-print-function ${FUNCNAME}
195
	debug-print-function ${FUNCNAME}
197
196
198
	local temp
197
	local deps=${@}
198
	python_check_deps() {
199
		use doc || return 0
200
201
		local dep
202
		for dep in ${deps[@]}; do
203
			python_has_version "${dep}[${PYTHON_USEDEP}]" ||
204
				return 1
205
		done
206
	}
207
208
	local deps_appended
199
	local dep
209
	local dep
200
	for dep in ${DOCS_DEPEND[@]}; do
210
	for dep in ${deps[@]}; do
201
		temp+=" ${dep}[\${PYTHON_USEDEP}]"
211
		deps_appended+=" ${dep}[\${PYTHON_USEDEP}]"
202
	done
212
	done
203
	DOCS_DEPEND=${temp}
213
214
	if [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
215
		DOCS_DEPEND=$(python_gen_cond_dep "${deps_appended}")
216
	else
217
		DOCS_DEPEND=$(python_gen_any_dep "${deps_appended}")
218
	fi
204
}
219
}
205
220
206
# @FUNCTION: sphinx_deps
221
# @FUNCTION: sphinx_deps
Lines 212-219 sphinx_deps() { Link Here
212
227
213
	: "${DOCS_AUTODOC:=1}"
228
	: "${DOCS_AUTODOC:=1}"
214
229
215
	deps="dev-python/sphinx[\${PYTHON_USEDEP}]
230
	deps="dev-python/sphinx
216
			${DOCS_DEPEND}"
231
		${DOCS_DEPEND}"
217
	if [[ ${DOCS_AUTODOC} == 0 ]]; then
232
	if [[ ${DOCS_AUTODOC} == 0 ]]; then
218
		if [[ -n "${DOCS_DEPEND}" ]]; then
233
		if [[ -n "${DOCS_DEPEND}" ]]; then
219
			die "${FUNCNAME}: do not set DOCS_AUTODOC to 0 if external plugins are used"
234
			die "${FUNCNAME}: do not set DOCS_AUTODOC to 0 if external plugins are used"
Lines 221-231 sphinx_deps() { Link Here
221
	elif [[ ${DOCS_AUTODOC} != 0 && ${DOCS_AUTODOC} != 1 ]]; then
236
	elif [[ ${DOCS_AUTODOC} != 0 && ${DOCS_AUTODOC} != 1 ]]; then
222
		die "${FUNCNAME}: DOCS_AUTODOC should be set to 0 or 1"
237
		die "${FUNCNAME}: DOCS_AUTODOC should be set to 0 or 1"
223
	fi
238
	fi
224
	if [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
239
225
		DOCS_DEPEND="$(python_gen_cond_dep "${deps}")"
240
	_docs_set_python_deps ${deps}
226
	else
227
		DOCS_DEPEND="$(python_gen_any_dep "${deps}")"
228
	fi
229
}
241
}
230
242
231
# @FUNCTION: sphinx_compile
243
# @FUNCTION: sphinx_compile
Lines 276-294 mkdocs_deps() { Link Here
276
288
277
	: "${DOCS_AUTODOC:=0}"
289
	: "${DOCS_AUTODOC:=0}"
278
290
279
	deps="dev-python/mkdocs[\${PYTHON_USEDEP}]
291
	deps="dev-python/mkdocs
280
			${DOCS_DEPEND}"
292
		${DOCS_DEPEND}"
281
	if [[ ${DOCS_AUTODOC} == 1 ]]; then
293
	if [[ ${DOCS_AUTODOC} == 1 ]]; then
282
		deps="dev-python/mkautodoc[\${PYTHON_USEDEP}]
294
		deps="dev-python/mkautodoc
283
				${deps}"
295
				${deps}"
284
	elif [[ ${DOCS_AUTODOC} != 0 && ${DOCS_AUTODOC} != 1 ]]; then
296
	elif [[ ${DOCS_AUTODOC} != 0 && ${DOCS_AUTODOC} != 1 ]]; then
285
		die "${FUNCNAME}: DOCS_AUTODOC should be set to 0 or 1"
297
		die "${FUNCNAME}: DOCS_AUTODOC should be set to 0 or 1"
286
	fi
298
	fi
287
	if [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
299
288
		DOCS_DEPEND="$(python_gen_cond_dep "${deps}")"
300
	_docs_set_python_deps ${deps}
289
	else
290
		DOCS_DEPEND="$(python_gen_any_dep "${deps}")"
291
	fi
292
}
301
}
293
302
294
# @FUNCTION: mkdocs_compile
303
# @FUNCTION: mkdocs_compile
Lines 404-414 IUSE+=" doc" Link Here
404
# Call the correct setup function
413
# Call the correct setup function
405
case ${DOCS_BUILDER} in
414
case ${DOCS_BUILDER} in
406
	"sphinx")
415
	"sphinx")
407
		python_append_deps
408
		sphinx_deps
416
		sphinx_deps
409
		;;
417
		;;
410
	"mkdocs")
418
	"mkdocs")
411
		python_append_deps
412
		mkdocs_deps
419
		mkdocs_deps
413
		;;
420
		;;
414
	"doxygen")
421
	"doxygen")
415
- 

Return to bug 910278