aboutsummaryrefslogtreecommitdiffstats
path: root/community/libgnome-games-support/meson-support.patch
blob: 01ef09e60d38ce30499938d590a7e10cafff9e2c (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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
From eb0f326381f1d3dca219d2140643d05db9af537e Mon Sep 17 00:00:00 2001
From: Arnaud B <arnaud.bonatti@gmail.com>
Date: Thu, 31 Oct 2019 20:48:04 +0000
Subject: [PATCH] Add Meson support

https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting

https://gitlab.gnome.org/GNOME/libgnome-games-support/merge_requests/2

Co-Authored-By: Jan Tojnar <jtojnar@gmail.com>
Co-Authored-By: Michael Catanzaro <mcatanzaro@gnome.org>
---
 games/meson.build | 56 +++++++++++++++++++++++++++++++++++++++++++++++
 meson.build       | 46 ++++++++++++++++++++++++++++++++++++++
 po/meson.build    |  1 +
 tests/meson.build | 18 +++++++++++++++
 4 files changed, 121 insertions(+)
 create mode 100644 games/meson.build
 create mode 100644 meson.build
 create mode 100644 po/meson.build
 create mode 100644 tests/meson.build

diff --git a/games/meson.build b/games/meson.build
new file mode 100644
index 0000000..bb551ab
--- /dev/null
+++ b/games/meson.build
@@ -0,0 +1,56 @@
+includesubdir = 'gnome-games-support-1'
+
+lggs_interface_deps = [
+    gee_dependency,
+    gio_dependency,
+    glib_dependency,
+    gtk_dependency,
+]
+
+lggs = library('gnome-games-support-1',
+    [
+        'config.vapi',
+        'gridframe.vala',
+        'scores/category.vala',
+        'scores/context.vala',
+        'scores/dialog.vala',
+        'scores/directory-importer.vala',
+        'scores/history-file-importer.vala',
+        'scores/importer.vala',
+        'scores/score.vala',
+    ],
+    install: true,
+    install_dir: [
+        true, # default libdir
+        join_paths(includedir, includesubdir), # headers
+        true, # default vapidir
+    ],
+    c_args: [
+        # https://github.com/mesonbuild/meson/issues/4763
+        '-include', 'config.h'
+    ],
+    vala_header: 'libgnome-games-support.h',
+    vala_vapi: 'libgnome-games-support-1.vapi',
+    vala_args: [
+        '--abi-stability',
+        '--target-glib=2.44',
+    ],
+    soversion: soversion,
+    version: library_version,
+    dependencies: lggs_interface_deps,
+)
+
+lggs_dependency = declare_dependency(
+    link_with: lggs,
+    include_directories: include_directories('.'),
+)
+
+pkg = import('pkgconfig')
+pkg.generate(
+    lggs,
+    filebase: 'libgnome-games-support-1',
+    requires: lggs_interface_deps,
+    name: meson.project_name(),
+    description: 'Useful functionality shared among GNOME games',
+    subdirs: includesubdir,
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..8aad65e
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,46 @@
+project(
+    'libgnome-games-support', ['vala', 'c'],
+    version: '1.4.4',
+    license: 'LGPLv3+',
+    meson_version: '>= 0.50.0',
+)
+
+# Before making a release, the library_version string should be modified.
+#
+#  * Bump the first component if binary compatibility has been broken; or
+#  * Bump the second component if new APIs are added; or
+#  * Bump the third component otherwise.
+#
+# When bumping the first component version, set the second and third components
+# to 0. When bumping the second version, set the third one to zero.
+#
+# A lot easier than libtool, right?
+library_version = '3.0.1'
+soversion = library_version.split('.')[0]
+
+# used to install help
+gnome = import('gnome')
+# used for internationalization
+i18n = import('i18n')
+
+cc = meson.get_compiler('c')
+valac = meson.get_compiler('vala')  # TODO 0.39.6 min
+
+gee_dependency = dependency('gee-0.8', version: '>= 0.14.0')
+gio_dependency = dependency('gio-2.0', version: '>= 2.40.0')
+glib_dependency = dependency('glib-2.0', version: '>= 2.40.0')
+gtk_dependency = dependency('gtk+-3.0', version: '>= 3.19.2')
+
+localedir = join_paths(get_option('prefix'), get_option('localedir'))
+includedir = join_paths(get_option('prefix'), get_option('includedir'))
+
+conf = configuration_data()
+conf.set_quoted('VERSION', meson.project_version())
+conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+conf.set_quoted('LOCALEDIR', localedir)
+
+configure_file(output: 'config.h', configuration: conf)
+
+subdir('po')
+subdir('games')
+subdir('tests')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..e9b77d7
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext(meson.project_name(), preset: 'glib')
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000..9f6ce1c
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,18 @@
+lggs_tests = executable(
+    'libgnome-games-support-tests',
+    [ 'test-scores.vala' ],
+    vala_args: [
+        '--target-glib=2.44',
+    ],
+    dependencies: [
+        gee_dependency,
+        glib_dependency,
+        gtk_dependency,
+        lggs_dependency,
+    ],
+)
+test(
+    'libgnome-games-support-tests',
+    lggs_tests,
+    timeout: 1,
+)
-- 
2.24.1