Debian Codegraph @

debian/patches/update-meson-config

raw symbols SCIP
1 Description: Update upstream meson config
2 Add some structure to the configuration file and add additional information
3 in the build summary
4 Author: Nick Morrott <[email protected]>
5 Forwarded: not-needed
6 Last-Update: 2022-02-11
7 ---
8 --- a/meson.build
9 +++ b/meson.build
10 @@ -1,74 +1,135 @@
11 -project('connman-gtk', 'c',
12 - version : '1.1.1',
13 - license: [
14 - 'GPL-2.0',
15 - ],
16 - default_options: [
17 - 'c_std=c11',
18 - ])
19 -
20 +project(
21 + 'connman-gtk', 'c',
22 + version: '1.1.1',
23 + license: 'GPL2',
24 + default_options: 'c_std=c11',
25 +)
26 +
27 +connman_gtk_name = meson.project_name()
28 +
29 +connman_gtk_version = meson.project_version()
30 +connman_gtk_version_array = connman_gtk_version.split('.')
31 +connman_gtk_major_version = connman_gtk_version_array[0].to_int()
32 +connman_gtk_minor_version = connman_gtk_version_array[1].to_int()
33 +connman_gtk_patch_version = connman_gtk_version_array[2].to_int()
34 +
35 +connman_gtk_prefix = get_option('prefix')
36 +connman_gtk_bindir = get_option('bindir')
37 +connman_gtk_datadir = get_option('datadir')
38 +connman_gtk_includedir = get_option('includedir')
39 +connman_gtk_localedir = get_option('localedir')
40 +connman_gtk_mandir = get_option('mandir')
41 +
42 +#*******************************************************************************
43 +# Compiler flags
44 +#*******************************************************************************
45
46 am_cflags = [
47 - '-fstack-protector',
48 - '-pedantic',
49 - '-Wstrict-prototypes',
50 - '-Wundef',
51 - '-Werror-implicit-function-declaration',
52 - '-Wformat',
53 - '-Wformat-security',
54 - '-Werror=format-security',
55 - '-Wconversion',
56 - '-Wno-unused-parameter',
57 - '-Wunreachable-code',
58 - '-Wall',
59 - '-W',
60 + '-fstack-protector',
61 + '-pedantic',
62 + '-Wstrict-prototypes',
63 + '-Wundef',
64 + '-Werror-implicit-function-declaration',
65 + '-Wformat',
66 + '-Wformat-security',
67 + '-Werror=format-security',
68 + '-Wconversion',
69 + '-Wno-unused-parameter',
70 + '-Wunreachable-code',
71 + '-Wall',
72 + '-W',
73 ]
74 add_global_arguments(am_cflags, language: 'c')
75
76 +#*******************************************************************************
77 +# Dependencies
78 +#*******************************************************************************
79 +
80 gtk = dependency('gtk+-3.0', version: '>=3.22')
81 glib = dependency('glib-2.0', version: '>=2.50')
82
83 +#*******************************************************************************
84 +# i18n
85 +#*******************************************************************************
86 +
87 i18n = import('i18n')
88
89 +source_root = meson.current_source_dir()
90 +po_dir = source_root / 'po'
91 +
92 +#*******************************************************************************
93 +# Configuration Data
94 +#*******************************************************************************
95 +
96 conf_data = configuration_data()
97 +
98 openconnect = disabler()
99 cc = meson.get_compiler('c')
100 dl = cc.find_library('dl', required: false)
101
102 use_openconnect = get_option('use_openconnect')
103 if(use_openconnect == 'yes')
104 - openconnect = dependency('openconnect', version: '>=5.99')
105 + openconnect = dependency('openconnect', version: '>=5.99')
106 endif
107 if(use_openconnect == 'dynamic' and dl.found())
108 - openconnect = dependency('openconnect', version: '>=5.99')
109 - conf_data.set('USE_OPENCONNECT_DYNAMIC', true)
110 + openconnect = dependency('openconnect', version: '>=5.99')
111 + conf_data.set('USE_OPENCONNECT_DYNAMIC', true)
112 endif
113 if (use_openconnect == 'check')
114 - openconnect = dependency('openconnect', version: '>=5.99', required : false)
115 + openconnect = dependency('openconnect', version: '>=5.99', required : false)
116 endif
117
118 conf_data.set('USE_OPENCONNECT', openconnect.found())
119 conf_data.set('USE_STATUS_ICON', get_option('use_status_icon'))
120 -conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
121 -conf_data.set_quoted('CONNMAN_GTK_LOCALEDIR', get_option('prefix') + '/' + get_option('localedir') + '/')
122
123 -conf_data.set('version', meson.project_version())
124 -configure_file(input : 'config.h.in',
125 - output : 'config.h',
126 - configuration : conf_data)
127 +conf_data.set_quoted('GETTEXT_PACKAGE', connman_gtk_name)
128 +conf_data.set_quoted('CONNMAN_GTK_LOCALEDIR', connman_gtk_prefix + '/' + connman_gtk_localedir + '/')
129 +
130 +conf_data.set('version', connman_gtk_version)
131 +configure_file(
132 + input: 'config.h.in',
133 + output: 'config.h',
134 + configuration: conf_data
135 +)
136
137 extra_includes = [
138 - include_directories('.'),
139 + include_directories('.'),
140 ]
141
142 readmes = [
143 - 'CHANGELOG.md',
144 - 'README.md'
145 + 'CHANGELOG.md',
146 + 'README.md'
147 ]
148
149 -
150 # install_data(readmes, install_dir : join_paths(get_option('datadir'), meson.project_name(), 'doc'))
151 -subdir('po')
152 -subdir('src')
153 +
154 +#*******************************************************************************
155 +# Source directories
156 +#*******************************************************************************
157 +
158 subdir('data')
159 +subdir('src')
160 +subdir('po')
161
162 +#*******************************************************************************
163 +# Summary
164 +#*******************************************************************************
165 +
166 +summary(
167 + {
168 + 'Building connman_gtk with prefix': connman_gtk_prefix,
169 + }, section: 'Directories'
170 +)
171 +
172 +summary(
173 + {
174 + 'openconnect' : get_option('use_openconnect'),
175 + 'status icon' : get_option('use_status_icon'),
176 + }, section: 'Optional features'
177 +)
178 +
179 +summary(
180 + {
181 + 'openconnect' : openconnect.found(),
182 + }, section: 'Optional dependencies'
183 +)