File: meson.build

package info (click to toggle)
brisk-menu 0.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 984 kB
  • sloc: ansic: 5,796; xml: 93; sh: 71; makefile: 14
file content (131 lines) | stat: -rw-r--r-- 3,761 bytes parent folder | download | duplicates (2)
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
project(
    'brisk-menu',
    ['c'],
    version: '0.6.2',
    license: [
        'GPL-2.0',
        'CC-BY-SA-4.0',
    ],
    default_options: [
        'c_std=c11',
        'prefix=/usr',
        'sysconfdir=/etc',
    ],
)

am_cflags = [
    '-fstack-protector',
    '-Wall',
    '-pedantic',
    '-Wstrict-prototypes',
    '-Wundef',
    '-fno-common',
    '-Werror-implicit-function-declaration',
    '-Wformat',
    '-Wformat-security',
    '-Werror=format-security',
    '-Wconversion',
    '-Wunused-variable',
    '-Wunreachable-code',
    '-W',
    '-D_FORTIFY_SOURCE=2',
]

gtk_version_flags = [
    '-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_18',
    '-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_18',
    '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_44',
    '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_44',
]

# Add our main flags
add_global_arguments(am_cflags, language: 'c')

# Handle glib schemas & icons
meson.add_install_script('meson_post_install.sh')

# Ensure we limit the GTK version used!
add_global_arguments(gtk_version_flags, language: 'c')

# Need GNOME module throughout Brisk build
gnome = import('gnome')

# Required minimum versions
gtk_min_version = '>= 3.18.0'
mate_min_version = '>= 1.21.0'
glib_min_version = '>= 2.44.0'

# GTK/UI deps
dep_gtk3 = dependency('gtk+-3.0', version: gtk_min_version)
dep_gio_unix = dependency('gio-unix-2.0', version: glib_min_version)
dep_gdkx11 = dependency('gdk-x11-3.0', version: gtk_min_version)
dep_x11 = dependency('x11')

# MATE dependencies
dep_mate_applet = dependency('libmatepanelapplet-4.0', version: mate_min_version)
dep_mate_menu = dependency('libmate-menu', version: mate_min_version)

# Misc
dep_notify = dependency('libnotify', version: '>= 0.7.0')

# Get configuration bits together
path_prefix = get_option('prefix')
path_sysconfdir = join_paths(path_prefix, get_option('sysconfdir'))
path_datadir = join_paths(path_prefix, get_option('datadir'))
path_libexecdir = join_paths(path_prefix, get_option('libexecdir'))
path_bindir = join_paths(path_prefix, get_option('bindir'))
path_localedir = join_paths(path_prefix, get_option('localedir'))
podir = join_paths(meson.source_root(), 'subprojects', 'translations')

# Sort out config.h now
cdata = configuration_data()

# General options..
cdata.set_quoted('PACKAGE_VERSION', meson.project_version())
cdata.set_quoted('PACKAGE_URL', 'https://getsol.us')

# Ensure locales will work
cdata.set_quoted('GETTEXT_PACKAGE', meson.project_name())
cdata.set_quoted('MATELOCALEDIR', path_localedir)
cdata.set('ENABLE_NLS', '1')

# Write config.h now
config_h = configure_file(
     configuration: cdata,
     output: 'config.h',
)
config_h_dir = include_directories('.')

# We're going to allow controlling this as either building a .so variant of
# Brisk Menu, or as a standalone binary
#
# For now just limit to stand-alone..
with_applet_type = 'stand-alone'

# Handle data before anything else
subdir('data')

# Prep translations prior to build
translations = subproject('translations')

# Now go build the source
subdir('src')

report = [
    '    Build configuration:',
    '    ====================',
    '',
    '    prefix:                                 @0@'.format(path_prefix),
    '    datadir:                                @0@'.format(path_datadir),
    '    sysconfdir:                             @0@'.format(path_sysconfdir),
    '    bindir:                                 @0@'.format(path_bindir),
    '    libexecdir:                             @0@'.format(path_libexecdir),
    '',
    '    MATE Applet:',
    '    ============',
    '',
    '    applet type:                            @0@'.format(with_applet_type),
]

# Output some stuff to validate the build config
message('\n\n\n' + '\n'.join(report) + '\n\n')