From 9302ef59f38913d024b7b1edebb40ebce3275753 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Thu, 4 May 2017 13:36:18 +0200 Subject: [PATCH 1/9] gitmodules: Move to subprojects/ Signed-off-by: Quentin Glidic --- .gitmodules | 2 +- Makefile.am | 2 +- libgwater-xcb-nolibtool.mk | 14 +++++++------- libgwater => subprojects/libgwater | 0 4 files changed, 9 insertions(+), 9 deletions(-) rename libgwater => subprojects/libgwater (100%) diff --git a/.gitmodules b/.gitmodules index 2034529a..b0c4f823 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "libgwater"] - path = libgwater + path = subprojects/libgwater url = git://github.com/sardemff7/libgwater diff --git a/Makefile.am b/Makefile.am index c48a8915..5a112cef 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ # Specify automake version. AUTOMAKE_OPTIONS = 1.11.3 -ACLOCAL_AMFLAGS = -I libgwater ${ACLOCAL_FLAGS} +ACLOCAL_AMFLAGS = -I subprojects/libgwater ${ACLOCAL_FLAGS} AM_YFLAGS = -d diff --git a/libgwater-xcb-nolibtool.mk b/libgwater-xcb-nolibtool.mk index e4e07eb7..d6403da9 100644 --- a/libgwater-xcb-nolibtool.mk +++ b/libgwater-xcb-nolibtool.mk @@ -1,20 +1,20 @@ noinst_LIBRARIES += \ - libgwater/libgwater-xcb.a + libgwater-xcb.a -libgwater_libgwater_xcb_a_SOURCES = \ - libgwater/xcb/libgwater-xcb.c \ - libgwater/xcb/libgwater-xcb.h +libgwater_xcb_a_SOURCES = \ + subprojects/libgwater/xcb/libgwater-xcb.c \ + subprojects/libgwater/xcb/libgwater-xcb.h -libgwater_libgwater_xcb_a_CFLAGS = \ +libgwater_xcb_a_CFLAGS = \ $(AM_CFLAGS) \ $(GW_XCB_INTERNAL_CFLAGS) GW_XCB_CFLAGS = \ - -I$(srcdir)/libgwater/xcb \ + -I$(srcdir)/subprojects/libgwater/xcb \ $(GW_XCB_INTERNAL_CFLAGS) GW_XCB_LIBS = \ - libgwater/libgwater-xcb.a \ + libgwater-xcb.a \ $(GW_XCB_INTERNAL_LIBS) diff --git a/libgwater b/subprojects/libgwater similarity index 100% rename from libgwater rename to subprojects/libgwater From 7fd8ce4c0afa295816db384622f56e70a12b1f32 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Thu, 4 May 2017 13:45:11 +0200 Subject: [PATCH 2/9] Add Meson build system support Signed-off-by: Quentin Glidic --- .travis.yml | 21 +- config/config.c | 1 + doc/meson.build | 32 +++ meson.build | 441 ++++++++++++++++++++++++++++++++++++++++++ meson_options.txt | 5 + source/theme.c | 1 + test/run_all_tests.sh | 41 ++++ 7 files changed, 531 insertions(+), 11 deletions(-) create mode 100644 doc/meson.build create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100755 test/run_all_tests.sh diff --git a/.travis.yml b/.travis.yml index 71fcb52b..948d224b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,6 +56,10 @@ before_install: # TODO: We install libxcb-ewmh-dev here, until it is whitelisted again in Travis install: - sudo apt-get install -y --force-yes libxkbcommon-dev libxkbcommon-x11-dev libxcb-ewmh-dev flex/trusty-backports libfl-dev/trusty-backports + - pip3 install meson + - wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip + - unzip ninja-linux.zip + - export PATH=$(pwd):$PATH - git clone https://github.com/alobbs/doxy-coverage - git clone --recursive https://github.com/Airblader/xcb-util-xrm.git - cd xcb-util-xrm @@ -72,21 +76,16 @@ install: - cd - before_script: - - autoreconf -i - - ./configure --enable-gcov --enable-drun + - meson build -Db_coverage=true script: - - make - - make check + - ninja -C build + - ninja -C build test - ulimit -c unlimited - - make test-x - - if [ -f core ]; then echo "bt" | gdb ./rofi core; fi - - make test-x1 - - make coverage-cli - - make distcheck - - make doxy 2>&1 > doxygen.log + - ninja -C build test-x + - ninja -C build doc/html 2>&1 > doxygen.log - test $(grep -c warning doxygen.log) -eq 0 - - ./doxy-coverage/doxy-coverage.py doc/html/xml/ + - ./doxy-coverage/doxy-coverage.py build/doc/html/xml/ after_success: - bash <(curl -s https://codecov.io/bash) diff --git a/config/config.c b/config/config.c index 902aee45..0e72e894 100644 --- a/config/config.c +++ b/config/config.c @@ -25,6 +25,7 @@ * */ +#include "config.h" #include #include #include diff --git a/doc/meson.build b/doc/meson.build new file mode 100644 index 00000000..9b5ee0e1 --- /dev/null +++ b/doc/meson.build @@ -0,0 +1,32 @@ +ronn = find_program('ronn', required: false) +if ronn.found() + run_target('update-manpage', + command: [ ronn, files( + 'rofi-manpage.markdown', + 'rofi-theme-manpage.markdown', + )] + ) +endif + +doxy_conf = configuration_data() +doxy_conf.set('PACKAGE', meson.project_name()) +doxy_conf.set('VERSION', meson.project_version()) +doxy_conf.set('abs_builddir', join_paths(meson.build_root(), meson.current_build_dir())) +doxy_conf.set('abs_top_srcdir', meson.source_root()) + +doxyfile = configure_file( + input: 'rofi.doxy.in', + output: 'rofi.doxy', + configuration: doxy_conf, + install: false, +) + +doxygen = find_program('doxygen', required: false) +if doxygen.found() + html_target = custom_target('doxy', + input: doxyfile, + output: 'html', + command: [doxygen, doxyfile], + install: false, + ) +endif diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..6c95ad01 --- /dev/null +++ b/meson.build @@ -0,0 +1,441 @@ +project('rofi', 'c', + version: '1.3.1', + meson_version: '>=0.39.1', + license: [ 'MIT' ], + default_options: [ + 'c_std=c99', + 'warning_level=3', + ], +) + +c_compiler = meson.get_compiler('c') + +plugindir = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name()) +themedir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name(), 'themes') + +deps = [ + dependency('glib-2.0', version: '>= 2.40'), + dependency('gio-unix-2.0'), + dependency('gmodule-2.0'), + dependency('cairo'), + dependency('pango'), + dependency('pangocairo'), + dependency('xkbcommon', version: '>= 0.5.0'), + 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'), +] + +check = dependency('check', version: '>= 0.11.0', required: get_option('enable-check')) + +header_conf = configuration_data() +header_conf.set_quoted('PACKAGE_NAME', meson.project_name()) +header_conf.set_quoted('PACKAGE_VERSION', meson.project_version()) +header_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) +header_conf.set_quoted('PACKAGE_BUGREPORT', 'https://github.com/DaveDavenport/rofi/') +header_conf.set_quoted('PACKAGE_URL', 'https://reddit.com/r/qtools/') + +header_conf.set('THEME_CONVERTER', true) +header_conf.set('_GNU_SOURCE', true) + +git = find_program('git', required: false) +if git.found() + git_version = run_command(git, '--git-dir', join_paths(meson.source_root(), '.git'), 'describe', '--tags', '--always', '--dirty') + git_branch = run_command(git, '--git-dir', join_paths(meson.source_root(), '.git'), 'describe', '--tags', '--always', '--all') + if git_version.returncode() == 0 and git_branch.returncode() == 0 + git_branch_parts = [] + foreach b : git_branch.stdout().strip().split('/') + if b != 'heads' + git_branch_parts += b + endif + endforeach + header_conf.set_quoted('GIT_VERSION', '@0@ - @1@ (@2@)'.format(meson.project_version(), git_version.stdout().strip(), '/'.join(git_branch_parts))) + endif +endif + +header_conf.set('ENABLE_DRUN', get_option('enable-drun')) +header_conf.set('WINDOW_MODE', get_option('enable-window')) + +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'))) +header_conf.set_quoted('PLUGIN_PATH', plugindir) +header_conf.set_quoted('THEME_DIR', themedir) + +config_h = configure_file(output: 'config.h', configuration: header_conf) + +add_project_arguments( + '-fvisibility=hidden', + '-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', +] +if get_option('enable-asan') + flags += [ + '-fsanitize=address', + '-fno-omit-frame-pointer', + ] +endif +foreach f : flags + if c_compiler.has_argument(f) + add_project_arguments(f, language: 'c') + endif +endforeach + + +install_headers([ + 'include/mode.h', + 'include/mode-private.h', + 'include/helper.h', + ], + 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' ], + arguments: [ '-y', '@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@' ] +) + +rofi_sources = files( + 'source/rofi.c', + 'source/view.c', + 'source/mode.c', + 'source/keyb.c', + 'config/config.c', + 'source/helper.c', + 'source/timings.c', + 'source/history.c', + 'source/theme.c', + 'source/widgets/box.c', + 'source/widgets/container.c', + 'source/widgets/widget.c', + 'source/widgets/textbox.c', + 'source/widgets/listview.c', + 'source/widgets/scrollbar.c', + 'source/xrmoptions.c', + 'source/x11-helper.c', + 'source/dialogs/run.c', + 'source/dialogs/ssh.c', + 'source/dialogs/drun.c', + 'source/dialogs/dmenu.c', + 'source/dialogs/combi.c', + 'source/dialogs/window.c', + 'source/dialogs/script.c', + 'source/dialogs/help-keys.c', + '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', + 'include/helper.h', + 'include/helper-theme.h', + 'include/timings.h', + 'include/history.h', + 'include/theme.h', + 'include/default-theme.h', + 'include/widgets/box.h', + '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/x11-helper.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', + 'include/xkb.h', + 'include/xkb-internal.h', +) +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) +rofi = executable('rofi', rofi_sources + [ + theme_lexer, + theme_parser, + ], + dependencies: deps, + install: true, +) + +subdir('doc') +install_man( + 'doc/rofi.1', + 'doc/rofi-sensible-terminal.1', +) + +install_data( + 'themes/Adapta-Nokto.rasi', + 'themes/Arc.rasi', + 'themes/DarkBlue.rasi', + 'themes/Indego.rasi', + 'themes/Monokai.rasi', + 'themes/Paper.rasi', + 'themes/android_notification.rasi', + 'themes/arthur.rasi', + 'themes/blue.rasi', + 'themes/c64.rasi', + 'themes/glue_pro_blue.rasi', + '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', + install_dir: themedir +) + + + +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', + 'source/x11-helper.c', + ]), + dependencies: deps, +)) + +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/x11-helper.c', + ]), + 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', + 'source/helper.c', + 'source/x11-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', + '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', + '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', + 'source/helper.c', + 'source/x11-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', + 'source/x11-helper.c', + ]), + 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', + 'source/x11-helper.c', + ]), + 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', + 'source/x11-helper.c', + ]), + 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/x11-helper.c', + 'source/theme.c', + ]), + 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', + 'source/keyb.c', + ]), + dependencies: deps, + )) +endif + + +run_target('test-x', command: [ 'test/run_all_tests.sh' ]) + +uncrustify = find_program('uncrustify', required: false) +if uncrustify.found() + run_target('indent', + command: [ + uncrustify, + '-c', join_paths(meson.source_root(), 'data', 'uncrustify.cfg'), + 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 diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 00000000..d4b612ec --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,5 @@ +option('enable-drun', type: 'boolean', value: true, description: 'Desktop file mode') +option('enable-window', type: 'boolean', value: true, description: 'Window switcher mode') +option('enable-timings', type: 'boolean', value: true, description: 'Timimngs output') +option('enable-asan', type: 'boolean', value: false, description: 'Address sanitizer') +option('enable-check', type: 'boolean', value: true, description: 'Build and run libcheck-based tests') diff --git a/source/theme.c b/source/theme.c index 2cf1683b..274a866a 100644 --- a/source/theme.c +++ b/source/theme.c @@ -27,6 +27,7 @@ #define G_LOG_DOMAIN "Theme" +#include "config.h" #include #include #include diff --git a/test/run_all_tests.sh b/test/run_all_tests.sh new file mode 100755 index 00000000..4d830169 --- /dev/null +++ b/test/run_all_tests.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +tests=( + run_errormsg_test + run_switchdialog_test + run_dmenu_test + run_dmenu_custom_test + run_run_test + run_script_test + run_issue_256 + run_issue_275 + run_dmenu_empty + run_dmenu_issue_292 + run_screenshot_test + xr_dump_test + run_drun_test + run_combi_test + run_regex_test + run_glob_test + run_issue333_test + help_output_test + run_dmenu_normal_window_test + run_window_test +) + +cd ${MESON_BUILD_ROOT} +rm -f core + +display=200 +for test in "${tests[@]}"; do + echo "Test ${test}" + ${MESON_SOURCE_ROOT}/test/run_test.sh ${display} ${MESON_SOURCE_ROOT}/test/${test}.sh ${MESON_BUILD_ROOT} ${MESON_SOURCE_ROOT} + ret=$? + if [[ -f core ]]; then + echo "bt" | gdb ./rofi core + exit ${ret} + elif [[ ${ret} != 0 ]]; then + exit ${ret} + fi + display=$(( ${display} + 1 )) +done From 27cc1a821a95ca64004cd9a8b37d4a86af22db02 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Thu, 4 May 2017 22:02:57 +0200 Subject: [PATCH 3/9] meson: Reorder project arguments Signed-off-by: Quentin Glidic --- meson.build | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/meson.build b/meson.build index 6c95ad01..5016c9db 100644 --- a/meson.build +++ b/meson.build @@ -10,6 +10,31 @@ project('rofi', 'c', c_compiler = meson.get_compiler('c') +add_project_arguments( + '-fvisibility=hidden', + '-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', +] +if get_option('enable-asan') + flags += [ + '-fsanitize=address', + '-fno-omit-frame-pointer', + ] +endif +foreach f : flags + if c_compiler.has_argument(f) + add_project_arguments(f, language: 'c') + endif +endforeach + plugindir = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name()) themedir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name(), 'themes') @@ -76,31 +101,6 @@ header_conf.set_quoted('THEME_DIR', themedir) config_h = configure_file(output: 'config.h', configuration: header_conf) -add_project_arguments( - '-fvisibility=hidden', - '-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', -] -if get_option('enable-asan') - flags += [ - '-fsanitize=address', - '-fno-omit-frame-pointer', - ] -endif -foreach f : flags - if c_compiler.has_argument(f) - add_project_arguments(f, language: 'c') - endif -endforeach - install_headers([ 'include/mode.h', From 2140c9dffbd601eac2574473c741b8b9834e3887 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Thu, 4 May 2017 22:26:03 +0200 Subject: [PATCH 4/9] meson: Add dist target Signed-off-by: Quentin Glidic --- Makefile.am | 5 +++++ meson.build | 2 ++ script/dist.sh | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100755 script/dist.sh diff --git a/Makefile.am b/Makefile.am index 5a112cef..263e0490 100644 --- a/Makefile.am +++ b/Makefile.am @@ -587,3 +587,8 @@ coverage-clean: .PHONY: .FORCE .FORCE: + +EXTRA_DIST += \ + doc/meson.build \ + subprojects/libgwater/xcb/meson.build \ + meson.build diff --git a/meson.build b/meson.build index 5016c9db..a5d33374 100644 --- a/meson.build +++ b/meson.build @@ -439,3 +439,5 @@ if ohcount.found() ], ) endif + +run_target('dist', command: [ 'script/dist.sh' ]) diff --git a/script/dist.sh b/script/dist.sh new file mode 100755 index 00000000..04f7dc3f --- /dev/null +++ b/script/dist.sh @@ -0,0 +1,21 @@ +#! /bin/sh + +NAME=`mesonintrospect ${MESON_BUILD_ROOT} --projectinfo | tr ',[' '\n\n' | sed -n 1,/subprojects/p | grep name | cut -d'"' -f4` +VERSION=`mesonintrospect ${MESON_BUILD_ROOT} --projectinfo | tr ',[' '\n\n' | sed -n 1,/subprojects/p | grep version | cut -d'"' -f4` +PREFIX=${NAME}-${VERSION} +TAR=${MESON_BUILD_ROOT}/${PREFIX}.tar + +rm -f ${TAR} ${TAR}.xz +git archive --prefix=${PREFIX}/ --format=tar HEAD > ${TAR} +( + git submodule | \ + while read commit path ref; do + ( + cd ${path} + git archive --prefix=${PREFIX}/${path}/ --format=tar ${commit} > tmp.tar + tar -Af ${TAR} tmp.tar + rm -f tmp.tar + ) + done +) +xz ${TAR} From 21982db45041604b645f73dc0c9b8a3914adb49d Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Mon, 15 May 2017 13:17:06 +0200 Subject: [PATCH 5/9] meson: Now dist target is upstream This reverts commit 2140c9dffbd601eac2574473c741b8b9834e3887, but not the Makefile.am part. Also fixes EXTRA_DIST. Signed-off-by: Quentin Glidic --- Makefile.am | 1 + meson.build | 2 -- script/dist.sh | 21 --------------------- 3 files changed, 1 insertion(+), 23 deletions(-) delete mode 100755 script/dist.sh diff --git a/Makefile.am b/Makefile.am index 263e0490..a5b9de78 100644 --- a/Makefile.am +++ b/Makefile.am @@ -591,4 +591,5 @@ coverage-clean: EXTRA_DIST += \ doc/meson.build \ subprojects/libgwater/xcb/meson.build \ + meson_options.txt \ meson.build diff --git a/meson.build b/meson.build index a5d33374..5016c9db 100644 --- a/meson.build +++ b/meson.build @@ -439,5 +439,3 @@ if ohcount.found() ], ) endif - -run_target('dist', command: [ 'script/dist.sh' ]) diff --git a/script/dist.sh b/script/dist.sh deleted file mode 100755 index 04f7dc3f..00000000 --- a/script/dist.sh +++ /dev/null @@ -1,21 +0,0 @@ -#! /bin/sh - -NAME=`mesonintrospect ${MESON_BUILD_ROOT} --projectinfo | tr ',[' '\n\n' | sed -n 1,/subprojects/p | grep name | cut -d'"' -f4` -VERSION=`mesonintrospect ${MESON_BUILD_ROOT} --projectinfo | tr ',[' '\n\n' | sed -n 1,/subprojects/p | grep version | cut -d'"' -f4` -PREFIX=${NAME}-${VERSION} -TAR=${MESON_BUILD_ROOT}/${PREFIX}.tar - -rm -f ${TAR} ${TAR}.xz -git archive --prefix=${PREFIX}/ --format=tar HEAD > ${TAR} -( - git submodule | \ - while read commit path ref; do - ( - cd ${path} - git archive --prefix=${PREFIX}/${path}/ --format=tar ${commit} > tmp.tar - tar -Af ${TAR} tmp.tar - rm -f tmp.tar - ) - done -) -xz ${TAR} From e324d0c6a95523cac75333fca8471d3b446daf03 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Sun, 28 May 2017 00:24:52 +0200 Subject: [PATCH 6/9] Makefile.am: Use wrapper script for test-x Signed-off-by: Quentin Glidic --- Makefile.am | 50 +++----------------------------------------------- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/Makefile.am b/Makefile.am index d839ac06..50afdddf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -507,53 +507,9 @@ endif .PHONY: test-x test-x: $(bin_PROGRAMS) - echo "Test 2" - $(top_srcdir)/test/run_test.sh 200 $(top_srcdir)/test/run_errormsg_test.sh $(top_builddir) - echo "Test 3" - $(top_srcdir)/test/run_test.sh 201 $(top_srcdir)/test/run_switchdialog_test.sh $(top_builddir) - echo "Test 4" - $(top_srcdir)/test/run_test.sh 202 $(top_srcdir)/test/run_dmenu_test.sh $(top_builddir) - echo "Test 5" - $(top_srcdir)/test/run_test.sh 203 $(top_srcdir)/test/run_dmenu_custom_test.sh $(top_builddir) - echo "Test 6" - $(top_srcdir)/test/run_test.sh 204 $(top_srcdir)/test/run_run_test.sh $(top_builddir) - echo "Test 7" - $(top_srcdir)/test/run_test.sh 205 $(top_srcdir)/test/run_script_test.sh $(top_builddir) - echo "Issue 256" - $(top_srcdir)/test/run_test.sh 206 $(top_srcdir)/test/run_issue_256.sh $(top_builddir) - echo "Issue 275" - $(top_srcdir)/test/run_test.sh 207 $(top_srcdir)/test/run_issue_275.sh $(top_builddir) - echo "Crash empty list" - $(top_srcdir)/test/run_test.sh 208 $(top_srcdir)/test/run_dmenu_empty.sh $(top_builddir) - echo "Test multiple select" - $(top_srcdir)/test/run_test.sh 209 $(top_srcdir)/test/run_dmenu_issue_292.sh $(top_builddir) - echo "Test screenshot" - $(top_srcdir)/test/run_test.sh 210 $(top_srcdir)/test/run_screenshot_test.sh $(top_builddir) - echo "Test xr dump" - $(top_srcdir)/test/run_test.sh 212 $(top_srcdir)/test/xr_dump_test.sh $(top_builddir) $(top_srcdir) - echo "Test drun" - $(top_srcdir)/test/run_test.sh 213 $(top_srcdir)/test/run_drun_test.sh $(top_builddir) - echo "Test combi" - $(top_srcdir)/test/run_test.sh 214 $(top_srcdir)/test/run_combi_test.sh $(top_builddir) - echo "Test dmenu regex" - $(top_srcdir)/test/run_test.sh 215 $(top_srcdir)/test/run_regex_test.sh $(top_builddir) - echo "Test dmenu glob" - $(top_srcdir)/test/run_test.sh 216 $(top_srcdir)/test/run_glob_test.sh $(top_builddir) - echo "Test issue 333" - $(top_srcdir)/test/run_test.sh 217 $(top_srcdir)/test/run_issue333_test.sh $(top_builddir) - echo "Test help output" - $(top_srcdir)/test/run_test.sh 218 $(top_srcdir)/test/help_output_test.sh $(top_builddir) $(top_srcdir) - echo "Test theme output" - $(top_srcdir)/test/run_test.sh 219 $(top_srcdir)/test/default_theme_test.sh $(top_builddir) $(top_srcdir) - echo "Test theme convert output" - $(top_srcdir)/test/run_test.sh 220 $(top_srcdir)/test/convert_old_theme_test.sh $(top_builddir) $(top_srcdir) - -test-x1: $(bin_PROGRAMS) - echo "Test dmenu-normal-window" - $(top_srcdir)/test/run_test.sh 219 $(top_srcdir)/test/run_dmenu_normal_window_test.sh $(top_builddir) - echo "Test window" - $(top_srcdir)/test/run_test.sh 220 $(top_srcdir)/test/run_window_test.sh $(top_builddir) $(top_srcdir) - echo "End tests" + MESON_SOURCE_ROOT="$(top_srcdir)" \ + MESON_BUILD_ROOT="$(top_builddir)" \ + $(top_srcdir)/test/run_all_tests.sh .PHONY: indent From 9ddf92be6e715daadf0899ab49646f93ffa69eee Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Sun, 28 May 2017 00:32:46 +0200 Subject: [PATCH 7/9] gitmodules: Update libgwater Signed-off-by: Quentin Glidic --- subprojects/libgwater | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/libgwater b/subprojects/libgwater index e1f98d37..60e5e71e 160000 --- a/subprojects/libgwater +++ b/subprojects/libgwater @@ -1 +1 @@ -Subproject commit e1f98d377f2b1dbeab224e48e9c55b7be99a9e14 +Subproject commit 60e5e71e09e573bd5c7839ce4a892747ea232526 From cfede32f7cb78a9ca0dd0a84f54048103f4718f3 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Sun, 28 May 2017 00:39:51 +0200 Subject: [PATCH 8/9] travis: Drop unneeded direct test call Signed-off-by: Quentin Glidic --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 98b07ef3..948d224b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -81,7 +81,6 @@ before_script: script: - ninja -C build - ninja -C build test - - ./theme_parser_test - ulimit -c unlimited - ninja -C build test-x - ninja -C build doc/html 2>&1 > doxygen.log From 0afe4d237dd5ca92d08211fbf78975910cedbf0a Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Sun, 28 May 2017 00:43:46 +0200 Subject: [PATCH 9/9] test-x: Keep server and fluxbox logs out of the way Signed-off-by: Quentin Glidic --- test/run_all_tests.sh | 1 + test/run_test.sh | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/run_all_tests.sh b/test/run_all_tests.sh index 6625c6da..6b039c65 100755 --- a/test/run_all_tests.sh +++ b/test/run_all_tests.sh @@ -26,6 +26,7 @@ tests=( ) cd ${MESON_BUILD_ROOT} +mkdir -p test-x-logs rm -f core display=200 diff --git a/test/run_test.sh b/test/run_test.sh index ecee0ed0..a41de6a8 100755 --- a/test/run_test.sh +++ b/test/run_test.sh @@ -6,10 +6,10 @@ function create_fake_x ( ) { export DISPLAY=":$1" echo "Starting fake X: ${DISPLAY}" - Xvfb +extension XINERAMA +xinerama -screen 0 1280x1024x24 -screen 1 800x600x24 ${DISPLAY} & + Xvfb +extension XINERAMA +xinerama -screen 0 1280x1024x24 -screen 1 800x600x24 ${DISPLAY} &>test-x-logs/xserver-:$1.log & XPID=$! sleep 1; - timeout -k 30s 30s fluxbox & + timeout -k 30s 30s fluxbox &>test-x-logs/fluxbox-:$1.log & FPID=$! sleep 1 } @@ -28,14 +28,13 @@ function destroy_fake_x ( ) fi } -if [ -n "$3" ] +if [ -n "$3" ] then export PATH=$3:$PATH fi create_fake_x "$1" -echo "$DISPLAY" -$2 $4 +"$2" "$4" RES=$? destroy_fake_x