mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 07:42:17 +00:00
build: add option of html manual
This commit is contained in:
parent
a655432bbe
commit
d0cd7fa31b
6
wscript
6
wscript
@ -54,6 +54,11 @@ build_options = [
|
|||||||
'name': '--manpage-build',
|
'name': '--manpage-build',
|
||||||
'desc': 'manpage generation',
|
'desc': 'manpage generation',
|
||||||
'func': check_ctx_vars('RST2MAN')
|
'func': check_ctx_vars('RST2MAN')
|
||||||
|
}, {
|
||||||
|
'name': '--html-build',
|
||||||
|
'desc': 'html manual generation',
|
||||||
|
'func': check_ctx_vars('RST2HTML'),
|
||||||
|
'default': 'disable',
|
||||||
}, {
|
}, {
|
||||||
'name': '--pdf-build',
|
'name': '--pdf-build',
|
||||||
'desc': 'pdf manual generation',
|
'desc': 'pdf manual generation',
|
||||||
@ -924,6 +929,7 @@ def configure(ctx):
|
|||||||
ctx.find_program(pkg_config, var='PKG_CONFIG')
|
ctx.find_program(pkg_config, var='PKG_CONFIG')
|
||||||
ctx.find_program(ar, var='AR')
|
ctx.find_program(ar, var='AR')
|
||||||
ctx.find_program('perl', var='BIN_PERL')
|
ctx.find_program('perl', var='BIN_PERL')
|
||||||
|
ctx.find_program('rst2html', var='RST2HTML', mandatory=False)
|
||||||
ctx.find_program('rst2man', var='RST2MAN', mandatory=False)
|
ctx.find_program('rst2man', var='RST2MAN', mandatory=False)
|
||||||
ctx.find_program('rst2pdf', var='RST2PDF', mandatory=False)
|
ctx.find_program('rst2pdf', var='RST2PDF', mandatory=False)
|
||||||
ctx.find_program(windres, var='WINDRES', mandatory=False)
|
ctx.find_program(windres, var='WINDRES', mandatory=False)
|
||||||
|
@ -13,6 +13,16 @@ def _add_rst_manual_dependencies(ctx):
|
|||||||
ctx.path.find_node('DOCS/man/mpv.rst'),
|
ctx.path.find_node('DOCS/man/mpv.rst'),
|
||||||
ctx.path.find_node(manpage_source))
|
ctx.path.find_node(manpage_source))
|
||||||
|
|
||||||
|
def _build_html(ctx):
|
||||||
|
ctx(
|
||||||
|
name = 'rst2html',
|
||||||
|
target = 'DOCS/man/mpv.html',
|
||||||
|
source = 'DOCS/man/mpv.rst',
|
||||||
|
rule = '${RST2HTML} ${SRC} ${TGT}',
|
||||||
|
install_path = ctx.env.DOCDIR)
|
||||||
|
|
||||||
|
_add_rst_manual_dependencies(ctx)
|
||||||
|
|
||||||
def _build_man(ctx):
|
def _build_man(ctx):
|
||||||
ctx(
|
ctx(
|
||||||
name = 'rst2man',
|
name = 'rst2man',
|
||||||
@ -530,6 +540,9 @@ def build(ctx):
|
|||||||
features = 'c cshlib',
|
features = 'c cshlib',
|
||||||
install_path = ctx.env.LIBDIR + '/mpv' )
|
install_path = ctx.env.LIBDIR + '/mpv' )
|
||||||
|
|
||||||
|
if ctx.dependency_satisfied('html-build'):
|
||||||
|
_build_html(ctx)
|
||||||
|
|
||||||
if ctx.dependency_satisfied('manpage-build'):
|
if ctx.dependency_satisfied('manpage-build'):
|
||||||
_build_man(ctx)
|
_build_man(ctx)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user