summaryrefslogtreecommitdiff
path: root/meson.build
blob: eca7b9d293a5a07ee8809bfa5e3078fbd4dfcc9c (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
project('libgweather', 'c',
  version: '40.0',
  license: 'GPL-2.0-or-later',
  meson_version: '>= 0.55.0',
  default_options: [
    'warning_level=2',
    'buildtype=debugoptimized',
    'c_std=gnu99',
  ],
)

# Add another 0, so that we can release without a suffix
libgweather_version = meson.project_version().split('.') + [0]

# We use libtool-version numbers because it's easier to understand.
# Before making a release, the libgweather_so_*
# numbers should be modified. The components are of the form C:R:A.
# a) If binary compatibility has been broken (eg removed or changed interfaces)
#    change to C+1:0:0.
# b) If interfaces have been changed or added, but binary compatibility has
#    been preserved, change to C+1:0:A+1
# c) If the interface is the same as the previous version, change to C:R+1:A
libgweather_lt_c=16
libgweather_lt_r=0
libgweather_lt_a=0

pkgconfig = import('pkgconfig')
gnome = import('gnome')
i18n = import('i18n')

prefix = get_option('prefix')

bindir = prefix / get_option('bindir')
datadir = prefix / get_option('datadir')
libdir = prefix / get_option('libdir')
includedir = prefix / get_option('includedir')
libexecdir = prefix / get_option('libexecdir')
sysconfdir = prefix / get_option('sysconfdir')

pkgdatadir = datadir / 'libgweather'
pkglibdir = libdir / 'libgweather'

glib_req_version = '>= 2.44.0'
gtk_req_version = '>= 3.13.5'
libsoup_req_version = '>= 2.44.0'
libxml_req_version = '>= 2.6.0'

GETTEXT_PACKAGE = 'libgweather-3.0'

pylint = find_program('pylint-3', 'pylint3', 'pylint', required: false)
pylint_flags = [
  '-d', 'C0111',
  '-d', 'W0511',
  '-d', 'F0401',
  '-d', 'C0326',
]

if get_option('glade_catalog') == 'false'
  enable_glade_catalog = false
else
  glade_dep = dependency('gladeui-2.0', required: get_option('glade_catalog') == 'true')
  enable_glade_catalog = glade_dep.found()
  if enable_glade_catalog
    glade_catalogdir = datadir / 'glade/catalogs'
  endif
endif

enable_vala = get_option('enable_vala')
if enable_vala == 'auto'
  enable_vala = find_program('vapigen', required: false).found()
else
  enable_vala = enable_vala != 'false'
endif

gen_locations_variant = find_program('build-aux/meson/gen_locations_variant.py')

subdir('data')
subdir('libgweather')
subdir('schemas')
subdir('doc')
subdir('po')
subdir('po-locations')

meson.add_install_script('build-aux/meson/meson_post_install.py')

pkgconfig.generate(
  filebase: 'gweather-3.0',
  name: 'GWeather',
  description: 'GWeather shared library',
  version: meson.project_version(),
  libraries: lib_libgweather,
  subdirs: 'libgweather-3.0',
  requires: [
    'gtk+-3.0',
  ],
  requires_private: [
    'gio-2.0',
    'libsoup-2.4',
    'libxml-2.0',
    'geocode-glib-1.0',
  ],
)

summary({
    'prefix': prefix,
    'libdir': libdir,
    'datadir': datadir,
    'zone info': get_option('zoneinfo_dir'),
  },
  section: 'Directories',
)

summary({
    'Debug': get_option('debug'),
    'Optimization': get_option('optimization'),
    'Glade catalog': enable_glade_catalog,
    'Generate VAPI': enable_vala,
    'API reference': get_option('gtk_doc'),
  },
  section: 'Build',
  bool_yn: true,
)