2020-12-15 13:23:14 -05:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import os
|
|
|
|
from pathlib import PurePath
|
2021-05-25 10:31:29 -04:00
|
|
|
import subprocess
|
2020-12-15 13:23:14 -05:00
|
|
|
|
|
|
|
man_pages = [
|
|
|
|
'man/gnome-shell.1',
|
|
|
|
'subprojects/extensions-tool/man/gnome-extensions.1',
|
|
|
|
]
|
|
|
|
|
|
|
|
sourceroot = os.environ.get('MESON_SOURCE_ROOT')
|
|
|
|
distroot = os.environ.get('MESON_DIST_ROOT')
|
|
|
|
|
|
|
|
for man_page in man_pages:
|
|
|
|
page_path = PurePath(man_page)
|
|
|
|
src = PurePath(sourceroot, page_path.with_suffix('.txt'))
|
|
|
|
dst = PurePath(distroot, page_path)
|
|
|
|
stylesheet = src.with_name('stylesheet.xsl')
|
|
|
|
|
2021-05-25 10:31:29 -04:00
|
|
|
subprocess.call(['a2x', '--xsl-file', os.fspath(stylesheet),
|
|
|
|
'--format', 'manpage', '--destination-dir', os.fspath(dst.parent),
|
|
|
|
os.fspath(src)])
|