Blame 0005-gnome.gtkdoc-Handle-absolute-install_dirs-correctly.patch

Kalev Lember 05cd86
From b9caaf94bc918dc8831889e1c6de5bbc9ad2a481 Mon Sep 17 00:00:00 2001
Kalev Lember 05cd86
From: Nirbheek Chauhan <nirbheek@centricular.com>
Kalev Lember 05cd86
Date: Mon, 17 Jul 2017 12:40:09 +0530
Kalev Lember 05cd86
Subject: [PATCH 5/6] gnome.gtkdoc: Handle absolute install_dirs correctly
Kalev Lember 05cd86
Kalev Lember 05cd86
Must prepend DESTDIR in case it's absolute. Also document that by
Kalev Lember 05cd86
default it is relative to the gtk-doc html directory.
Kalev Lember 05cd86
---
Kalev Lember 05cd86
 docs/markdown/Gnome-module.md      | 4 ++--
Kalev Lember 05cd86
 mesonbuild/scripts/gtkdochelper.py | 8 +++++---
Kalev Lember 05cd86
 2 files changed, 7 insertions(+), 5 deletions(-)
Kalev Lember 05cd86
Kalev Lember 05cd86
diff --git a/docs/markdown/Gnome-module.md b/docs/markdown/Gnome-module.md
Kalev Lember 05cd86
index 61b88ada..098f030f 100644
Kalev Lember 05cd86
--- a/docs/markdown/Gnome-module.md
Kalev Lember 05cd86
+++ b/docs/markdown/Gnome-module.md
Kalev Lember 05cd86
@@ -134,14 +134,14 @@ This also creates two targets for translations `help-$project-update-po` and `he
Kalev Lember 05cd86
 
Kalev Lember 05cd86
 ### gnome.gtkdoc()
Kalev Lember 05cd86
 
Kalev Lember 05cd86
-Compiles and installs gtkdoc documentation. Takes one positional arguments; The name of the module.
Kalev Lember 05cd86
+Compiles and installs gtkdoc documentation into `prefix/share/gtk-doc/html`. Takes one positional argument: The name of the module.
Kalev Lember 05cd86
 
Kalev Lember 05cd86
 * `main_xml`: specifies the main XML file
Kalev Lember 05cd86
 * `main_sgml`: equal to `main_xml`
Kalev Lember 05cd86
 * `src_dir`: include_directories to include
Kalev Lember 05cd86
 * `dependencies`: a list of dependencies
Kalev Lember 05cd86
 * `install`: if true, installs the generated docs
Kalev Lember 05cd86
-* `install_dir`: the directory to install the generated docs
Kalev Lember 05cd86
+* `install_dir`: the directory to install the generated docs relative to the gtk-doc html dir or an absolute path (default: module name)
Kalev Lember 05cd86
 * `scan_args`: a list of arguments to pass to `gtkdoc-scan`
Kalev Lember 05cd86
 * `scanobjs_args`: a list of arguments to pass to `gtkdoc-scangobj`
Kalev Lember 05cd86
 * `gobject_typesfile`: a list of type files
Kalev Lember 05cd86
diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py
Kalev Lember 05cd86
index a2cbf5a5..45ed96bc 100644
Kalev Lember 05cd86
--- a/mesonbuild/scripts/gtkdochelper.py
Kalev Lember 05cd86
+++ b/mesonbuild/scripts/gtkdochelper.py
Kalev Lember 05cd86
@@ -218,12 +218,14 @@ def run(args):
Kalev Lember 05cd86
         options.mode)
Kalev Lember 05cd86
 
Kalev Lember 05cd86
     if 'MESON_INSTALL_PREFIX' in os.environ:
Kalev Lember 05cd86
-        install_dir = options.install_dir if options.install_dir else options.modulename
Kalev Lember 05cd86
         destdir = os.environ.get('DESTDIR', '')
Kalev Lember 05cd86
-        installdir = destdir_join(destdir, os.environ['MESON_INSTALL_PREFIX'])
Kalev Lember 05cd86
+        install_prefix = destdir_join(destdir, os.environ['MESON_INSTALL_PREFIX'])
Kalev Lember 05cd86
+        install_dir = options.install_dir if options.install_dir else options.modulename
Kalev Lember 05cd86
+        if os.path.isabs(install_dir):
Kalev Lember 05cd86
+            install_dir = destdir_join(destdir, install_dir)
Kalev Lember 05cd86
         install_gtkdoc(options.builddir,
Kalev Lember 05cd86
                        options.subdir,
Kalev Lember 05cd86
-                       installdir,
Kalev Lember 05cd86
+                       install_prefix,
Kalev Lember 05cd86
                        'share/gtk-doc/html',
Kalev Lember 05cd86
                        install_dir)
Kalev Lember 05cd86
     return 0
Kalev Lember 05cd86
-- 
Kalev Lember 05cd86
2.13.0
Kalev Lember 05cd86