2017-05-04 11:45:11 +00:00
|
|
|
project('rofi', 'c',
|
2019-06-26 19:34:39 +00:00
|
|
|
version: '1.5.4-dev',
|
2018-07-10 11:03:52 +00:00
|
|
|
meson_version: '>=0.47.0',
|
2017-05-04 11:45:11 +00:00
|
|
|
license: [ 'MIT' ],
|
|
|
|
default_options: [
|
|
|
|
'c_std=c99',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
c_compiler = meson.get_compiler('c')
|
|
|
|
|
2017-05-04 20:02:57 +00:00
|
|
|
add_project_arguments(
|
|
|
|
'-I@0@'.format(meson.build_root()),
|
|
|
|
'-I@0@'.format(join_paths(meson.source_root(), 'include')),
|
|
|
|
language: 'c'
|
|
|
|
)
|
|
|
|
|
|
|
|
flags = [
|
|
|
|
'-Wparentheses',
|
|
|
|
'-Winline',
|
|
|
|
'-Wunreachable-code',
|
|
|
|
'-Werror=missing-prototypes',
|
2019-04-19 08:09:01 +00:00
|
|
|
'-Wno-inline', # A bit too noisy with Bison…
|
2017-05-04 20:02:57 +00:00
|
|
|
]
|
|
|
|
foreach f : flags
|
|
|
|
if c_compiler.has_argument(f)
|
|
|
|
add_project_arguments(f, language: 'c')
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2019-03-26 11:25:40 +00:00
|
|
|
plugindir = join_paths(get_option('libdir'), meson.project_name())
|
|
|
|
themedir = join_paths(get_option('datadir'), meson.project_name(), 'themes')
|
2017-05-04 11:45:11 +00:00
|
|
|
|
2019-04-19 08:15:06 +00:00
|
|
|
glib_min_major=2
|
|
|
|
glib_min_minor=40
|
|
|
|
glib_min_version='@0@.@1@'.format(glib_min_major, glib_min_minor)
|
2019-03-26 11:25:40 +00:00
|
|
|
plugins_deps = [
|
2019-04-19 08:15:06 +00:00
|
|
|
dependency('glib-2.0', version: '>= @0@'.format(glib_min_version)),
|
2017-05-04 11:45:11 +00:00
|
|
|
dependency('gmodule-2.0'),
|
|
|
|
dependency('cairo'),
|
2019-03-26 11:25:40 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
plugins_deps,
|
|
|
|
dependency('gio-unix-2.0'),
|
2017-05-04 11:45:11 +00:00
|
|
|
dependency('pango'),
|
|
|
|
dependency('pangocairo'),
|
2017-05-28 00:18:09 +00:00
|
|
|
dependency('xkbcommon'),
|
2017-04-12 15:58:32 +00:00
|
|
|
dependency('librsvg-2.0'),
|
2020-02-17 20:34:41 +00:00
|
|
|
dependency('libjpeg'),
|
2017-05-04 11:45:11 +00:00
|
|
|
c_compiler.find_library('m', required: false),
|
|
|
|
]
|
|
|
|
|
|
|
|
# XCB stuff
|
|
|
|
deps += [
|
|
|
|
subproject('libgwater/xcb').get_variable('libgwater_xcb'),
|
|
|
|
dependency('xcb-aux'),
|
|
|
|
dependency('xcb-xkb'),
|
|
|
|
dependency('xkbcommon-x11'),
|
|
|
|
dependency('xcb-ewmh'),
|
|
|
|
dependency('xcb-icccm'),
|
|
|
|
dependency('xcb-xrm'),
|
|
|
|
dependency('xcb-randr'),
|
|
|
|
dependency('xcb-xinerama'),
|
|
|
|
dependency('cairo-xcb'),
|
|
|
|
dependency('libstartup-notification-1.0'),
|
|
|
|
]
|
|
|
|
|
2020-05-04 17:34:50 +00:00
|
|
|
wayland_client = dependency('wayland-client', required: get_option('wayland'))
|
|
|
|
wayland_protocols = dependency('wayland-protocols', required: get_option('wayland'))
|
2020-05-04 21:31:23 +00:00
|
|
|
wayland_cursor = dependency('wayland-cursor', required: get_option('wayland'))
|
2020-05-04 17:34:50 +00:00
|
|
|
if wayland_client.found()
|
|
|
|
deps += wayland_client
|
|
|
|
deps += wayland_protocols
|
2020-05-04 21:31:23 +00:00
|
|
|
deps += wayland_cursor
|
|
|
|
deps += subproject('libgwater/wayland').get_variable('libgwater_wayland')
|
2020-05-04 17:34:50 +00:00
|
|
|
endif
|
|
|
|
|
2019-03-26 11:10:09 +00:00
|
|
|
check = dependency('check', version: '>= 0.11.0', required: get_option('check'))
|
2017-05-04 11:45:11 +00:00
|
|
|
|
|
|
|
header_conf = configuration_data()
|
|
|
|
header_conf.set_quoted('PACKAGE_NAME', meson.project_name())
|
|
|
|
header_conf.set_quoted('PACKAGE_VERSION', meson.project_version())
|
2018-03-29 10:46:51 +00:00
|
|
|
header_conf.set_quoted('VERSION', meson.project_version())
|
2017-05-04 11:45:11 +00:00
|
|
|
header_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
|
2019-05-14 09:55:30 +00:00
|
|
|
header_conf.set_quoted('PACKAGE_BUGREPORT', 'https://github.com/davatorium/rofi/')
|
2017-05-04 11:45:11 +00:00
|
|
|
header_conf.set_quoted('PACKAGE_URL', 'https://reddit.com/r/qtools/')
|
|
|
|
|
|
|
|
header_conf.set('THEME_CONVERTER', true)
|
|
|
|
header_conf.set('_GNU_SOURCE', true)
|
|
|
|
|
2017-10-15 15:51:45 +00:00
|
|
|
header_conf.set('USE_NK_GIT_VERSION', true)
|
2017-05-04 11:45:11 +00:00
|
|
|
|
2019-04-19 08:15:06 +00:00
|
|
|
header_conf.set('GLIB_VERSION_MIN_REQUIRED', '(G_ENCODE_VERSION(@0@,@1@))'.format(glib_min_major, glib_min_minor))
|
|
|
|
header_conf.set('GLIB_VERSION_MAX_ALLOWED', '(G_ENCODE_VERSION(@0@,@1@))'.format(glib_min_major, glib_min_minor))
|
|
|
|
|
2019-03-26 11:10:09 +00:00
|
|
|
header_conf.set('ENABLE_DRUN', get_option('drun'))
|
2020-06-02 19:29:28 +00:00
|
|
|
header_conf.set('WINDOW_MODE', get_option('window'))
|
2020-05-04 21:31:23 +00:00
|
|
|
|
|
|
|
header_conf.set('ENABLE_WAYLAND', wayland_client.found())
|
2017-05-04 11:45:11 +00:00
|
|
|
|
|
|
|
header_conf.set_quoted('MANPAGE_PATH', join_paths(get_option('prefix'), get_option('mandir')))
|
|
|
|
header_conf.set_quoted('SYSCONFDIR', join_paths(get_option('prefix'), get_option('sysconfdir')))
|
2019-03-26 11:25:40 +00:00
|
|
|
header_conf.set_quoted('PLUGIN_PATH', join_paths(get_option('prefix'), plugindir))
|
|
|
|
header_conf.set_quoted('THEME_DIR', join_paths(get_option('prefix'), themedir))
|
2017-05-04 11:45:11 +00:00
|
|
|
|
|
|
|
config_h = configure_file(output: 'config.h', configuration: header_conf)
|
|
|
|
|
2017-10-15 15:51:45 +00:00
|
|
|
nk_options = [
|
2017-05-28 00:18:09 +00:00
|
|
|
'bindings=true',
|
2017-04-12 16:08:57 +00:00
|
|
|
'xdg-theme=true',
|
2017-10-15 16:29:54 +00:00
|
|
|
'git-work-tree=@0@'.format(meson.source_root()),
|
2017-05-28 00:18:09 +00:00
|
|
|
]
|
2017-10-15 15:51:45 +00:00
|
|
|
nk = subproject('libnkutils', default_options: nk_options)
|
|
|
|
nk_subproject_options = nk.get_variable('nk_options')
|
|
|
|
foreach o : nk_options + nk_subproject_options
|
|
|
|
if not nk_options.contains(o) or not nk_subproject_options.contains(o)
|
|
|
|
error('You must not change libnkutils options @0@ != @1@'.format('|'.join(nk_options), '|'.join(nk_subproject_options)))
|
2017-05-28 00:18:09 +00:00
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
deps += nk.get_variable('libnkutils')
|
2018-07-10 11:03:52 +00:00
|
|
|
deps += nk.get_variable('libnkutils_bindings')
|
2017-05-04 11:45:11 +00:00
|
|
|
|
|
|
|
install_headers([
|
|
|
|
'include/mode.h',
|
|
|
|
'include/mode-private.h',
|
|
|
|
'include/helper.h',
|
2017-10-15 09:13:53 +00:00
|
|
|
'include/rofi-types.h',
|
2018-07-14 16:05:34 +00:00
|
|
|
'include/rofi-icon-fetcher.h'
|
2017-05-04 11:45:11 +00:00
|
|
|
],
|
|
|
|
subdir: meson.project_name(),
|
|
|
|
)
|
|
|
|
install_data(
|
|
|
|
'script/rofi-sensible-terminal',
|
|
|
|
'script/rofi-theme-selector',
|
|
|
|
install_dir: join_paths(get_option('prefix'), get_option('bindir'))
|
|
|
|
)
|
|
|
|
|
|
|
|
flex = generator(find_program('flex'),
|
|
|
|
output: '@BASENAME@.c',
|
|
|
|
arguments: [ '-o', '@OUTPUT@', '@INPUT@' ]
|
|
|
|
)
|
|
|
|
bison = generator(find_program('bison'),
|
|
|
|
output: [ '@BASENAME@.c', '@BASENAME@.h' ],
|
2019-04-19 08:09:25 +00:00
|
|
|
arguments: [ '-d', '@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@' ]
|
2017-05-04 11:45:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
rofi_sources = files(
|
|
|
|
'source/rofi.c',
|
|
|
|
'source/mode.c',
|
|
|
|
'source/keyb.c',
|
|
|
|
'config/config.c',
|
2020-06-02 19:29:28 +00:00
|
|
|
'source/display.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
'source/helper.c',
|
|
|
|
'source/timings.c',
|
|
|
|
'source/history.c',
|
|
|
|
'source/theme.c',
|
2018-06-09 17:13:57 +00:00
|
|
|
'source/rofi-icon-fetcher.c',
|
2017-05-27 22:21:57 +00:00
|
|
|
'source/css-colors.c',
|
2020-06-02 19:29:28 +00:00
|
|
|
'source/view.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
'source/widgets/box.c',
|
2018-06-09 17:13:57 +00:00
|
|
|
'source/widgets/icon.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
'source/widgets/container.c',
|
|
|
|
'source/widgets/widget.c',
|
|
|
|
'source/widgets/textbox.c',
|
|
|
|
'source/widgets/listview.c',
|
|
|
|
'source/widgets/scrollbar.c',
|
|
|
|
'source/xrmoptions.c',
|
2017-06-20 19:02:13 +00:00
|
|
|
'source/rofi-types.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
'source/dialogs/run.c',
|
|
|
|
'source/dialogs/ssh.c',
|
|
|
|
'source/dialogs/drun.c',
|
|
|
|
'source/dialogs/dmenu.c',
|
|
|
|
'source/dialogs/combi.c',
|
2020-06-02 19:29:28 +00:00
|
|
|
'source/dialogs/window.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
'source/dialogs/script.c',
|
|
|
|
'source/dialogs/help-keys.c',
|
2020-06-02 19:29:28 +00:00
|
|
|
'source/xcb/display.c',
|
|
|
|
'source/xcb/view.c',
|
2017-06-01 12:55:17 +00:00
|
|
|
'include/display.h',
|
2017-05-04 11:45:11 +00:00
|
|
|
'include/xcb.h',
|
|
|
|
'include/xcb-internal.h',
|
|
|
|
'include/rofi.h',
|
|
|
|
'include/mode.h',
|
|
|
|
'include/mode-private.h',
|
|
|
|
'include/settings.h',
|
|
|
|
'include/keyb.h',
|
|
|
|
'include/view.h',
|
|
|
|
'include/view-internal.h',
|
2018-06-09 17:13:57 +00:00
|
|
|
'include/rofi-icon-fetcher.h',
|
2017-05-04 11:45:11 +00:00
|
|
|
'include/helper.h',
|
|
|
|
'include/helper-theme.h',
|
|
|
|
'include/timings.h',
|
|
|
|
'include/history.h',
|
|
|
|
'include/theme.h',
|
2017-06-20 19:02:13 +00:00
|
|
|
'include/rofi-types.h',
|
2017-05-27 22:21:57 +00:00
|
|
|
'include/css-colors.h',
|
2017-05-04 11:45:11 +00:00
|
|
|
'include/widgets/box.h',
|
2018-06-09 17:13:57 +00:00
|
|
|
'include/widgets/icon.h',
|
2017-05-04 11:45:11 +00:00
|
|
|
'include/widgets/container.h',
|
|
|
|
'include/widgets/widget.h',
|
|
|
|
'include/widgets/widget-internal.h',
|
|
|
|
'include/widgets/textbox.h',
|
|
|
|
'include/widgets/listview.h',
|
|
|
|
'include/widgets/scrollbar.h',
|
|
|
|
'include/xrmoptions.h',
|
|
|
|
'include/dialogs/ssh.h',
|
|
|
|
'include/dialogs/run.h',
|
|
|
|
'include/dialogs/drun.h',
|
|
|
|
'include/dialogs/dmenu.h',
|
|
|
|
'include/dialogs/combi.h',
|
|
|
|
'include/dialogs/script.h',
|
|
|
|
'include/dialogs/window.h',
|
|
|
|
'include/dialogs/dialogs.h',
|
|
|
|
'include/dialogs/help-keys.h',
|
2019-04-02 11:51:53 +00:00
|
|
|
'include/dialogs/dmenuscriptshared.h',
|
2017-05-04 11:45:11 +00:00
|
|
|
)
|
|
|
|
theme_lexer_sources = files('lexer/theme-lexer.l')
|
|
|
|
theme_parser_sources = files('lexer/theme-parser.y')
|
|
|
|
|
|
|
|
theme_lexer = flex.process(theme_lexer_sources)
|
|
|
|
theme_parser = bison.process(theme_parser_sources)
|
2017-10-31 17:16:08 +00:00
|
|
|
|
2020-05-04 17:34:50 +00:00
|
|
|
if get_option('wayland').enabled()
|
|
|
|
wayland_sys_protocols_dir = wayland_protocols.get_pkgconfig_variable('pkgdatadir')
|
|
|
|
wayland_scanner = find_program('wayland-scanner')
|
|
|
|
protocols = files(
|
|
|
|
wayland_sys_protocols_dir + '/stable/xdg-shell/xdg-shell.xml',
|
|
|
|
'protocols/wlr-layer-shell-unstable-v1.xml',
|
|
|
|
)
|
|
|
|
proto_srcs = []
|
|
|
|
proto_headers = []
|
|
|
|
foreach p : protocols
|
|
|
|
proto_srcs += custom_target(
|
|
|
|
'@0@'.format(p).underscorify() + '_protocol_c',
|
|
|
|
input: p,
|
|
|
|
output: '@BASENAME@-protocol.c',
|
|
|
|
command: [wayland_scanner, 'public-code', '@INPUT@', '@OUTPUT@'],
|
|
|
|
)
|
|
|
|
proto_headers += custom_target(
|
|
|
|
'@0@'.format(p).underscorify() + '_protocol_h',
|
|
|
|
input: p,
|
|
|
|
output: '@BASENAME@-protocol.h',
|
|
|
|
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
rofi_sources += proto_srcs
|
|
|
|
rofi_sources += proto_headers
|
2020-06-02 19:29:28 +00:00
|
|
|
rofi_sources += files(
|
|
|
|
'source/wayland/view.c',
|
|
|
|
'source/wayland/display.c',
|
|
|
|
'include/wayland-internal.h',
|
|
|
|
)
|
2020-05-04 17:34:50 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2017-10-31 17:16:08 +00:00
|
|
|
gnome = import('gnome')
|
|
|
|
default_theme = gnome.compile_resources('resources', files('resources/resources.xml'))
|
|
|
|
|
2017-05-04 11:45:11 +00:00
|
|
|
rofi = executable('rofi', rofi_sources + [
|
|
|
|
theme_lexer,
|
|
|
|
theme_parser,
|
2017-10-31 17:16:08 +00:00
|
|
|
default_theme,
|
2017-05-04 11:45:11 +00:00
|
|
|
],
|
|
|
|
dependencies: deps,
|
|
|
|
install: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
subdir('doc')
|
|
|
|
install_man(
|
|
|
|
'doc/rofi.1',
|
2017-11-05 14:28:17 +00:00
|
|
|
'doc/rofi-theme-selector.1',
|
2017-05-04 11:45:11 +00:00
|
|
|
'doc/rofi-sensible-terminal.1',
|
2017-08-04 14:50:51 +00:00
|
|
|
'doc/rofi-theme.5',
|
2017-05-04 11:45:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
install_data(
|
|
|
|
'themes/Adapta-Nokto.rasi',
|
|
|
|
'themes/Arc.rasi',
|
2018-02-25 14:18:37 +00:00
|
|
|
'themes/Arc-Dark.rasi',
|
2017-05-04 11:45:11 +00:00
|
|
|
'themes/DarkBlue.rasi',
|
2017-06-19 07:29:51 +00:00
|
|
|
'themes/Pop-Dark.rasi',
|
2017-05-04 11:45:11 +00:00
|
|
|
'themes/Indego.rasi',
|
|
|
|
'themes/Monokai.rasi',
|
|
|
|
'themes/Paper.rasi',
|
|
|
|
'themes/android_notification.rasi',
|
|
|
|
'themes/arthur.rasi',
|
|
|
|
'themes/blue.rasi',
|
|
|
|
'themes/c64.rasi',
|
2017-06-05 18:31:32 +00:00
|
|
|
'themes/dmenu.rasi',
|
2017-05-04 11:45:11 +00:00
|
|
|
'themes/glue_pro_blue.rasi',
|
2018-02-25 14:18:37 +00:00
|
|
|
'themes/gruvbox-common.rasi',
|
2017-05-04 11:45:11 +00:00
|
|
|
'themes/gruvbox-dark-hard.rasi',
|
|
|
|
'themes/gruvbox-dark-soft.rasi',
|
|
|
|
'themes/gruvbox-dark.rasi',
|
|
|
|
'themes/gruvbox-light-hard.rasi',
|
|
|
|
'themes/gruvbox-light-soft.rasi',
|
|
|
|
'themes/gruvbox-light.rasi',
|
|
|
|
'themes/lb.rasi',
|
|
|
|
'themes/paper-float.rasi',
|
|
|
|
'themes/purple.rasi',
|
|
|
|
'themes/sidebar.rasi',
|
|
|
|
'themes/solarized.rasi',
|
|
|
|
'themes/solarized_alternate.rasi',
|
2019-05-14 09:35:30 +00:00
|
|
|
'themes/fancy.rasi',
|
2017-05-04 11:45:11 +00:00
|
|
|
install_dir: themedir
|
|
|
|
)
|
|
|
|
|
2017-10-16 17:18:19 +00:00
|
|
|
pkg = import('pkgconfig')
|
|
|
|
|
2019-03-26 11:25:40 +00:00
|
|
|
pkg.generate(
|
|
|
|
filebase: 'rofi',
|
|
|
|
name: 'rofi',
|
|
|
|
version: meson.project_version(),
|
|
|
|
description: 'Header files for rofi plugins',
|
|
|
|
variables: [
|
|
|
|
'pluginsdir=@0@'.format(join_paths('${libdir}', meson.project_name())),
|
|
|
|
],
|
|
|
|
requires_private: plugins_deps,
|
2017-06-20 12:57:25 +00:00
|
|
|
)
|
2017-05-04 11:45:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
test('history test', executable('history.test', [
|
|
|
|
'test/history-test.c',
|
|
|
|
],
|
|
|
|
objects: rofi.extract_objects([
|
|
|
|
'source/history.c',
|
|
|
|
'config/config.c',
|
|
|
|
]),
|
|
|
|
dependencies: deps,
|
|
|
|
))
|
|
|
|
|
|
|
|
test('helper_pidfile test', executable('helper_pidfile.test', [
|
|
|
|
'test/helper-pidfile.c',
|
|
|
|
],
|
|
|
|
objects: rofi.extract_objects([
|
|
|
|
'config/config.c',
|
|
|
|
'source/helper.c',
|
|
|
|
'source/xrmoptions.c',
|
2017-06-20 19:02:13 +00:00
|
|
|
'source/rofi-types.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
]),
|
|
|
|
dependencies: deps,
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
test('widget test', executable('widget.test', [
|
|
|
|
'test/widget-test.c',
|
|
|
|
theme_parser,
|
|
|
|
theme_lexer,
|
|
|
|
],
|
|
|
|
objects: rofi.extract_objects([
|
|
|
|
'source/widgets/widget.c',
|
|
|
|
'source/widgets/textbox.c',
|
|
|
|
'source/theme.c',
|
2017-06-20 19:02:13 +00:00
|
|
|
'source/rofi-types.c',
|
2017-05-27 22:21:57 +00:00
|
|
|
'source/css-colors.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
'source/helper.c',
|
|
|
|
'config/config.c',
|
|
|
|
]),
|
|
|
|
dependencies: deps,
|
|
|
|
))
|
|
|
|
|
|
|
|
test('box test', executable('box.test', [
|
|
|
|
'test/box-test.c',
|
|
|
|
theme_parser,
|
|
|
|
theme_lexer,
|
|
|
|
],
|
|
|
|
objects: rofi.extract_objects([
|
|
|
|
'source/widgets/widget.c',
|
|
|
|
'source/widgets/box.c',
|
|
|
|
'source/theme.c',
|
2017-06-20 19:02:13 +00:00
|
|
|
'source/rofi-types.c',
|
2017-05-27 22:21:57 +00:00
|
|
|
'source/css-colors.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
'config/config.c',
|
|
|
|
]),
|
|
|
|
dependencies: deps,
|
|
|
|
))
|
|
|
|
|
|
|
|
test('scrollbar test', executable('scrollbar.test', [
|
|
|
|
'test/scrollbar-test.c',
|
|
|
|
theme_parser,
|
|
|
|
theme_lexer,
|
|
|
|
],
|
|
|
|
objects: rofi.extract_objects([
|
|
|
|
'source/widgets/widget.c',
|
|
|
|
'source/widgets/scrollbar.c',
|
|
|
|
'source/theme.c',
|
2017-06-20 19:02:13 +00:00
|
|
|
'source/rofi-types.c',
|
2017-05-27 22:21:57 +00:00
|
|
|
'source/css-colors.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
'config/config.c',
|
|
|
|
]),
|
|
|
|
dependencies: deps,
|
|
|
|
))
|
|
|
|
|
|
|
|
test('textbox test', executable('textbox.test', [
|
|
|
|
'test/textbox-test.c',
|
|
|
|
theme_parser,
|
|
|
|
theme_lexer,
|
|
|
|
],
|
|
|
|
objects: rofi.extract_objects([
|
|
|
|
'source/widgets/widget.c',
|
|
|
|
'source/widgets/textbox.c',
|
|
|
|
'source/theme.c',
|
2017-06-20 19:02:13 +00:00
|
|
|
'source/rofi-types.c',
|
2017-05-27 22:21:57 +00:00
|
|
|
'source/css-colors.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
'source/helper.c',
|
|
|
|
'config/config.c',
|
|
|
|
]),
|
|
|
|
dependencies: deps,
|
|
|
|
))
|
|
|
|
|
|
|
|
test('helper test', executable('helper.test', [
|
|
|
|
'test/helper-test.c',
|
|
|
|
],
|
|
|
|
objects: rofi.extract_objects([
|
|
|
|
'config/config.c',
|
|
|
|
'source/helper.c',
|
|
|
|
'source/xrmoptions.c',
|
2017-06-20 19:02:13 +00:00
|
|
|
'source/rofi-types.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
]),
|
|
|
|
dependencies: deps,
|
|
|
|
))
|
|
|
|
|
|
|
|
test('helper_expand test', executable('helper_expand.test', [
|
|
|
|
'test/helper-expand.c',
|
|
|
|
],
|
|
|
|
objects: rofi.extract_objects([
|
|
|
|
'config/config.c',
|
|
|
|
'source/helper.c',
|
|
|
|
'source/xrmoptions.c',
|
2017-06-20 19:02:13 +00:00
|
|
|
'source/rofi-types.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
]),
|
|
|
|
dependencies: deps,
|
|
|
|
))
|
|
|
|
|
|
|
|
test('helper_config_cmdline_parser test', executable('helper_config_cmdline_parser.test', [
|
|
|
|
'test/helper-config-cmdline-parser.c',
|
|
|
|
],
|
|
|
|
objects: rofi.extract_objects([
|
|
|
|
'config/config.c',
|
|
|
|
'source/helper.c',
|
|
|
|
'source/xrmoptions.c',
|
2017-06-20 19:02:13 +00:00
|
|
|
'source/rofi-types.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
]),
|
|
|
|
dependencies: deps,
|
|
|
|
))
|
|
|
|
|
|
|
|
if check.found()
|
|
|
|
deps+= [ check ]
|
|
|
|
|
|
|
|
test('theme_parser test', executable('theme_parser.test', [
|
|
|
|
'test/theme-parser-test.c',
|
|
|
|
theme_lexer,
|
|
|
|
theme_parser,
|
|
|
|
],
|
|
|
|
objects: rofi.extract_objects([
|
|
|
|
'config/config.c',
|
|
|
|
'source/helper.c',
|
|
|
|
'source/xrmoptions.c',
|
|
|
|
'source/theme.c',
|
2017-06-20 19:02:13 +00:00
|
|
|
'source/rofi-types.c',
|
2017-05-27 22:21:57 +00:00
|
|
|
'source/css-colors.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
]),
|
|
|
|
dependencies: deps,
|
|
|
|
))
|
|
|
|
|
|
|
|
test('mode test', executable('mode.test', [
|
|
|
|
'test/mode-test.c',
|
|
|
|
],
|
|
|
|
objects: rofi.extract_objects([
|
|
|
|
'config/config.c',
|
|
|
|
'source/dialogs/help-keys.c',
|
|
|
|
'source/helper.c',
|
|
|
|
'source/mode.c',
|
|
|
|
'source/xrmoptions.c',
|
2017-06-20 19:02:13 +00:00
|
|
|
'source/rofi-types.c',
|
2017-05-04 11:45:11 +00:00
|
|
|
'source/keyb.c',
|
|
|
|
]),
|
|
|
|
dependencies: deps,
|
|
|
|
))
|
2017-10-15 09:13:53 +00:00
|
|
|
|
|
|
|
test('helper_tokenize test', executable('helper_tokenize.test', [
|
|
|
|
'test/helper-tokenize.c',
|
|
|
|
],
|
|
|
|
objects: rofi.extract_objects([
|
|
|
|
'config/config.c',
|
|
|
|
'source/helper.c',
|
|
|
|
'source/xrmoptions.c',
|
|
|
|
'source/rofi-types.c',
|
|
|
|
]),
|
|
|
|
dependencies: deps,
|
|
|
|
))
|
2017-05-04 11:45:11 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2017-07-06 16:26:19 +00:00
|
|
|
run_target('test-x', command: [ 'test/run_all_tests.sh' ], depends: [ rofi ])
|
2017-05-04 11:45:11 +00:00
|
|
|
|
|
|
|
uncrustify = find_program('uncrustify', required: false)
|
|
|
|
if uncrustify.found()
|
|
|
|
run_target('indent',
|
|
|
|
command: [
|
|
|
|
uncrustify,
|
|
|
|
'-c', join_paths(meson.source_root(), 'data', 'uncrustify.cfg'),
|
2017-05-29 14:51:03 +00:00
|
|
|
'--replace',
|
2017-05-04 11:45:11 +00:00
|
|
|
rofi_sources
|
|
|
|
],
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
|
|
|
rofi_sources += theme_lexer_sources
|
|
|
|
rofi_sources += theme_parser_sources
|
|
|
|
|
|
|
|
cppcheck = find_program('cppcheck', required: false)
|
|
|
|
if cppcheck.found()
|
|
|
|
run_target('cppcheck',
|
|
|
|
command: [
|
|
|
|
cppcheck,
|
|
|
|
'--std=@0@'.format(get_option('c_std')),
|
|
|
|
'--platform=unix64',
|
|
|
|
'--enable=all',
|
|
|
|
'-Uerror_dialog',
|
|
|
|
'--inconclusive',
|
|
|
|
'-I@0@'.format(join_paths(meson.source_root(), 'include')),
|
|
|
|
rofi_sources
|
|
|
|
],
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ohcount = find_program('ohcount', required: false)
|
|
|
|
if ohcount.found()
|
|
|
|
run_target('ohcount',
|
|
|
|
command: [
|
|
|
|
ohcount,
|
|
|
|
rofi_sources
|
|
|
|
],
|
|
|
|
)
|
|
|
|
endif
|