summaryrefslogtreecommitdiffstats
path: root/meta/recipes-gnome/libsecret/files/0001-meson-add-option-introspection.patch
blob: 51ee66f42bbece3f983a4c7f9b2568a5a88e90d9 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
meson: add option introspection

Add an option 'introspection' for meson which could control whether
build GIR files or not.

Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/libsecret/-/merge_requests/53]

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 libsecret/meson.build | 86 ++++++++++++++++++++++---------------------
 meson.build           |  1 +
 meson_options.txt     |  1 +
 3 files changed, 46 insertions(+), 42 deletions(-)

diff --git a/libsecret/meson.build b/libsecret/meson.build
index 759b5ef..2ee8850 100644
--- a/libsecret/meson.build
+++ b/libsecret/meson.build
@@ -104,50 +104,52 @@ libsecret_dep = declare_dependency(
 )
 
 # GObject Introspection
-libsecret_gir_sources = [
-  'secret-attributes.c',
-  'secret-attributes.h',
-  'secret-backend.c',
-  'secret-backend.h',
-  'secret-collection.c',
-  'secret-collection.h',
-  'secret-item.c',
-  'secret-item.h',
-  'secret-methods.c',
-  'secret-password.c',
-  'secret-password.h',
-  'secret-paths.c',
-  'secret-paths.h',
-  'secret-prompt.c',
-  'secret-prompt.h',
-  'secret-retrievable.c',
-  'secret-retrievable.h',
-  'secret-schema.c',
-  'secret-schema.h',
-  'secret-schemas.c',
-  'secret-schemas.h',
-  'secret-service.c',
-  'secret-service.h',
-  'secret-types.h',
-  'secret-value.c',
-  'secret-value.h',
-]
-libsecret_gir_sources += version_h
-libsecret_gir_sources += _enums_generated
-
-libsecret_gir = gnome.generate_gir(libsecret,
-  sources: libsecret_gir_sources,
-  namespace: 'Secret',
-  nsversion: api_version_major,
-  export_packages: 'libsecret-@0@'.format(api_version_major),
-  includes: [ 'GObject-2.0', 'Gio-2.0' ],
-  header: 'libsecret/secret.h',
-  extra_args: [ '-D SECRET_COMPILATION'],
-  install: true,
-)
+if with_gir
+  libsecret_gir_sources = [
+    'secret-attributes.c',
+    'secret-attributes.h',
+    'secret-backend.c',
+    'secret-backend.h',
+    'secret-collection.c',
+    'secret-collection.h',
+    'secret-item.c',
+    'secret-item.h',
+    'secret-methods.c',
+    'secret-password.c',
+    'secret-password.h',
+    'secret-paths.c',
+    'secret-paths.h',
+    'secret-prompt.c',
+    'secret-prompt.h',
+    'secret-retrievable.c',
+    'secret-retrievable.h',
+    'secret-schema.c',
+    'secret-schema.h',
+    'secret-schemas.c',
+    'secret-schemas.h',
+    'secret-service.c',
+    'secret-service.h',
+    'secret-types.h',
+    'secret-value.c',
+    'secret-value.h',
+  ]
+  libsecret_gir_sources += version_h
+  libsecret_gir_sources += _enums_generated
+
+  libsecret_gir = gnome.generate_gir(libsecret,
+    sources: libsecret_gir_sources,
+    namespace: 'Secret',
+    nsversion: api_version_major,
+    export_packages: 'libsecret-@0@'.format(api_version_major),
+    includes: [ 'GObject-2.0', 'Gio-2.0' ],
+    header: 'libsecret/secret.h',
+    extra_args: [ '-D SECRET_COMPILATION'],
+    install: true,
+  )
+endif
 
 # Vapi
-if with_vapi
+if with_vapi and with_gir
   libsecret_vapi = gnome.generate_vapi('libsecret-@0@'.format(api_version_major),
     sources: libsecret_gir[0],
     metadata_dirs: meson.source_root() / 'libsecret',
diff --git a/meson.build b/meson.build
index a26d046..d22e008 100644
--- a/meson.build
+++ b/meson.build
@@ -22,6 +22,7 @@ with_gcrypt = get_option('gcrypt')
 enable_debug = get_option('debugging')
 with_vapi = get_option('vapi')
 with_gtkdoc = get_option('gtk_doc')
+with_gir = get_option('introspection')
 
 # Some variables
 config_h_dir = include_directories('.')
diff --git a/meson_options.txt b/meson_options.txt
index c1fda5d..445aeb0 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -3,3 +3,4 @@ option('gcrypt', type: 'boolean', value: true, description: 'With gcrypt and tra
 option('debugging', type: 'boolean', value: false, description: 'Turn debugging on/off')
 option('vapi', type: 'boolean', value: true, description: 'Create VAPI file.')
 option('gtk_doc', type: 'boolean', value: true, description: 'Build reference documentation using gtk-doc')
+option('introspection', type: 'boolean', value: true, description: 'Create GIR file.')
-- 
2.17.1