summaryrefslogtreecommitdiff
path: root/libre/glib2-static/0001-docs-Fix-building-with-meson.patch
blob: 02f69b70068f4ffcf2a2f2cb064725dffb03bdc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
From a7cbd565aad04f92cbd9ac36696a9d033ae6bcc0 Mon Sep 17 00:00:00 2001
From: Armin K <krejzi@email.com>
Date: Fri, 25 Aug 2017 13:36:23 +0200
Subject: [PATCH] docs: Fix building with meson

This fixes {gio,gobject}-doc ninja targets as well as
install process when gtk-doc is enabled
---
 docs/reference/gio/meson.build     | 15 ++++++++++++++-
 docs/reference/gobject/meson.build | 13 ++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/docs/reference/gio/meson.build b/docs/reference/gio/meson.build
index 7f0467726..8f8dc7ce5 100644
--- a/docs/reference/gio/meson.build
+++ b/docs/reference/gio/meson.build
@@ -52,9 +52,12 @@ if get_option('with-docs') != 'no'
     'gnetworkmonitorbase.h',
     'gnetworkmonitornetlink.h',
     'gnetworkmonitornm.h',
+    'gnetworkmonitorportal.h',
     'gnotificationbackend.h',
     'gnotification-private.h',
+    'gosxappinfo.h',
     'gpollfilemonitor.h',
+    'gproxyresolverportal.h',
     'gregistrysettingsbackend.h',
     'gresourcefile.h',
     'gsettingsbackendinternal.h',
@@ -95,12 +98,22 @@ if get_option('with-docs') != 'no'
     configuration: version_conf
   )
 
+  # Meson uses paths relative to meson.source_root() in dependencies,
+  # which is invalid relative to current_source_dir(), so the compile
+  # process fails to find glib headers
+  top_build_dir = meson.build_root()
+  top_source_dir = meson.source_root()
+  glib_top_build_dir = join_paths(top_build_dir, 'glib')
+  glib_top_source_dir = join_paths(top_source_dir, 'glib')
+
+  scan_dep = declare_dependency(include_directories : [ top_source_dir, glib_top_build_dir, glib_top_source_dir ])
+
   gnome.gtkdoc('gio',
     main_xml : 'gio-docs.xml',
     namespace : 'g',
     gobject_typesfile : 'gio.types',
     mode : 'none',
-    dependencies : [libgio_dep, libgobject_dep, libglib_dep],
+    dependencies : [libgio_dep, libgobject_dep, libglib_dep, scan_dep],
     src_dir : 'gio',
     scan_args : [
       '--rebuild-types',
diff --git a/docs/reference/gobject/meson.build b/docs/reference/gobject/meson.build
index 1025e174f..9ec1f9123 100644
--- a/docs/reference/gobject/meson.build
+++ b/docs/reference/gobject/meson.build
@@ -17,12 +17,23 @@ if get_option('with-docs') != 'no'
     configuration: version_conf
   )
 
+  # Meson uses paths relative to meson.source_root() in dependencies,
+  # which is invalid relative to current_source_dir(), so the compile
+  # process fails to find glib headers
+  doc_source_dir = meson.current_source_dir()
+  top_build_dir = meson.build_root()
+  top_source_dir = meson.source_root()
+  glib_top_build_dir = join_paths(top_build_dir, 'glib')
+  glib_top_source_dir = join_paths(top_source_dir, 'glib')
+
+  scan_dep = declare_dependency(include_directories : [ doc_source_dir, top_source_dir, glib_top_build_dir, glib_top_source_dir ])
+
   gnome.gtkdoc('gobject',
     main_xml : 'gobject-docs.xml',
     namespace : 'g',
     gobject_typesfile : join_paths(meson.current_source_dir(), 'gobject.types'),
     mode : 'none',
-    dependencies : [libgobject_dep, libglib_dep],
+    dependencies : [libgobject_dep, libglib_dep, scan_dep],
     src_dir : 'gobject',
     scan_args : [
       '--deprecated-guards=G_DISABLE_DEPRECATED',
-- 
2.14.1