aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-03-05 08:55:10 -0500
committerXavier Claessens <xclaesse@gmail.com>2023-03-16 10:36:33 -0400
commit340aedc0d954243e8fec59b3efea84577790135e (patch)
tree6fc3a654bfa0c0becd3e8cd192bf5e2eed65e0db
parenta5a7b29a665d1ef82fc606b5ee920e284e3ef1b7 (diff)
downloadmeson-340aedc0d954243e8fec59b3efea84577790135e.zip
meson-340aedc0d954243e8fec59b3efea84577790135e.tar.gz
meson-340aedc0d954243e8fec59b3efea84577790135e.tar.bz2
hotdoc: Install devhelp files at the right location
When devhelp is enabled, hotdoc generates a devhelp/ subdir that needs to be installed to /usr/share/devhelp/. Otherwise, the html/ subdir needs to be installed to /usr/share/doc/<project>/html/
-rw-r--r--mesonbuild/modules/hotdoc.py15
-rw-r--r--mesonbuild/scripts/hotdochelper.py10
2 files changed, 19 insertions, 6 deletions
diff --git a/mesonbuild/modules/hotdoc.py b/mesonbuild/modules/hotdoc.py
index c0a572a..ad5ae30 100644
--- a/mesonbuild/modules/hotdoc.py
+++ b/mesonbuild/modules/hotdoc.py
@@ -339,9 +339,22 @@ class HotdocTargetBuilder:
install_script = None
if install:
+ datadir = os.path.join(self.state.get_option('prefix'), self.state.get_option('datadir'))
+ devhelp = self.kwargs.get('devhelp_activate', False)
+ if not isinstance(devhelp, bool):
+ FeatureDeprecated.single_use('hotdoc.generate_doc() devhelp_activate must be boolean', '1.1.0', self.state.subproject)
+ devhelp = False
+ if devhelp:
+ install_from = os.path.join(fullname, 'devhelp')
+ install_to = os.path.join(datadir, 'devhelp')
+ else:
+ install_from = os.path.join(fullname, 'html')
+ install_to = os.path.join(datadir, 'doc', self.name, 'html')
+
install_script = self.state.backend.get_executable_serialisation(self.build_command + [
"--internal", "hotdoc",
- "--install", os.path.join(fullname, 'html'),
+ "--install", install_from,
+ "--docdir", install_to,
'--name', self.name,
'--builddir', os.path.join(self.builddir, self.subdir)] +
self.hotdoc.get_command() +
diff --git a/mesonbuild/scripts/hotdochelper.py b/mesonbuild/scripts/hotdochelper.py
index 2c3b85d..80365a0 100644
--- a/mesonbuild/scripts/hotdochelper.py
+++ b/mesonbuild/scripts/hotdochelper.py
@@ -15,14 +15,16 @@ parser.add_argument('--extra-extension-path', action="append", default=[])
parser.add_argument('--name')
parser.add_argument('--builddir')
parser.add_argument('--project-version')
+parser.add_argument('--docdir')
def run(argv: T.List[str]) -> int:
options, args = parser.parse_known_args(argv)
subenv = os.environ.copy()
- for ext_path in options.extra_extension_path:
- subenv['PYTHONPATH'] = subenv.get('PYTHONPATH', '') + ':' + ext_path
+ val = subenv.get('PYTHONPATH')
+ paths = [val] if val else []
+ subenv['PYTHONPATH'] = os.pathsep.join(paths + options.extra_extension_path)
res = subprocess.call(args, cwd=options.builddir, env=subenv)
if res != 0:
@@ -31,9 +33,7 @@ def run(argv: T.List[str]) -> int:
if options.install:
source_dir = os.path.join(options.builddir, options.install)
destdir = os.environ.get('DESTDIR', '')
- installdir = destdir_join(destdir,
- os.path.join(os.environ['MESON_INSTALL_PREFIX'],
- 'share/doc/', options.name, "html"))
+ installdir = destdir_join(destdir, options.docdir)
shutil.rmtree(installdir, ignore_errors=True)
shutil.copytree(source_dir, installdir)