aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-05-25 22:55:02 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2016-05-25 22:55:02 +0300
commitd8e08224da6045460879068fd07cc3f6c6d3fc51 (patch)
treed5cb144b21038aefa3f51943eb6b2b77853dea49
parentf3fa6c02a7cb7bdbe391ad85a6f87b8cfb4ee6b6 (diff)
downloadmeson-d8e08224da6045460879068fd07cc3f6c6d3fc51.zip
meson-d8e08224da6045460879068fd07cc3f6c6d3fc51.tar.gz
meson-d8e08224da6045460879068fd07cc3f6c6d3fc51.tar.bz2
Helper function to get the install dir of a gtkdoc module. Closes #551.
-rw-r--r--mesonbuild/modules/gnome.py9
-rw-r--r--test cases/frameworks/10 gtk-doc/doc/meson.build2
-rw-r--r--test cases/frameworks/10 gtk-doc/meson.build4
3 files changed, 13 insertions, 2 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 718d07a..2c37655 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -295,6 +295,15 @@ class GnomeModule:
res.append(build.InstallScript(command + args))
return res
+ def gtkdoc_html_dir(self, state, args, kwarga):
+ if len(args) != 1:
+ raise MesonException('Must have exactly one argument.')
+ modulename = args[0]
+ if not isinstance(modulename, str):
+ raise MesonException('Argument must be a string')
+ return os.path.join('share/gtkdoc/html', modulename)
+
+
def unpack_args(self, arg, kwarg_name, kwargs):
try:
new_args = kwargs[kwarg_name]
diff --git a/test cases/frameworks/10 gtk-doc/doc/meson.build b/test cases/frameworks/10 gtk-doc/doc/meson.build
index 3172b42..5f08e89 100644
--- a/test cases/frameworks/10 gtk-doc/doc/meson.build
+++ b/test cases/frameworks/10 gtk-doc/doc/meson.build
@@ -1,5 +1,3 @@
-gnome = import('gnome')
-
cdata = configuration_data()
cdata.set('VERSION', '1.0')
configure_file(input : 'version.xml.in',
diff --git a/test cases/frameworks/10 gtk-doc/meson.build b/test cases/frameworks/10 gtk-doc/meson.build
index 9712f21..c6881ab 100644
--- a/test cases/frameworks/10 gtk-doc/meson.build
+++ b/test cases/frameworks/10 gtk-doc/meson.build
@@ -1,5 +1,9 @@
project('gtkdoctest', 'c')
+gnome = import('gnome')
+
+assert(gnome.gtkdoc_html_dir('foobar') == 'share/gtkdoc/html/foobar', 'Gtkdoc install dir is incorrect.')
+
inc = include_directories('include')
# We have to disable this test until this bug fix has landed to