[meson] Require 0.55.0

We implicitly require it for building ragel subproject. This new version
requirement should satisfied in both Fedora 33 and Debian bullseye, and
not be too cutting edge for us.
This commit is contained in:
Khaled Hosny 2021-11-20 17:09:15 +02:00
parent 84dc4e85e8
commit 69d8f27c69
8 changed files with 38 additions and 78 deletions

View File

@ -68,7 +68,7 @@ jobs:
steps: steps:
- checkout - checkout
- run: apk update && apk add ragel gcc g++ glib-dev freetype-dev cairo-dev git py3-pip ninja - run: apk update && apk add ragel gcc g++ glib-dev freetype-dev cairo-dev git py3-pip ninja
- run: pip3 install meson==0.52.0 - run: pip3 install meson==0.56.0
- run: meson build --buildtype=minsize - run: meson build --buildtype=minsize
- run: ninja -Cbuild -j9 - run: ninja -Cbuild -j9
- run: meson test -Cbuild --print-errorlogs - run: meson test -Cbuild --print-errorlogs
@ -94,7 +94,8 @@ jobs:
steps: steps:
- checkout - checkout
- run: apt update || true - run: apt update || true
- run: DEBIAN_FRONTEND=noninteractive apt install -y clang lld git binutils meson pkg-config ragel libfreetype6-dev libglib2.0-dev libcairo2-dev libicu-dev libgraphite2-dev - run: DEBIAN_FRONTEND=noninteractive apt install -y python3 python3-pip ninja-build clang lld git binutils pkg-config ragel libfreetype6-dev libglib2.0-dev libcairo2-dev libicu-dev libgraphite2-dev
- run: pip3 install meson==0.56.0
# asan+ubsan # asan+ubsan
- run: rm -rf build && meson build --default-library=static -Db_sanitize=address,undefined --buildtype=debugoptimized --wrap-mode=nodownload -Dexperimental_api=true - run: rm -rf build && meson build --default-library=static -Db_sanitize=address,undefined --buildtype=debugoptimized --wrap-mode=nodownload -Dexperimental_api=true
- run: ninja -Cbuild -j8 && meson test -Cbuild --print-errorlogs | asan_symbolize | c++filt - run: ninja -Cbuild -j8 && meson test -Cbuild --print-errorlogs | asan_symbolize | c++filt

View File

@ -49,8 +49,8 @@ ignore_headers = [
gnome.gtkdoc('harfbuzz', gnome.gtkdoc('harfbuzz',
main_sgml: 'harfbuzz-docs.xml', main_sgml: 'harfbuzz-docs.xml',
src_dir: [join_paths(meson.current_source_dir(), '../src'), src_dir: [meson.current_source_dir() / '..' / 'src',
join_paths(meson.current_build_dir(), '../src'), meson.current_build_dir() / '..' / 'src',
], ],
scan_args: ['--deprecated-guards=HB_DISABLE_DEPRECATED', scan_args: ['--deprecated-guards=HB_DISABLE_DEPRECATED',
'--ignore-decorators=HB_EXTERN|HB_DEPRECATED', '--ignore-decorators=HB_EXTERN|HB_DEPRECATED',

View File

@ -1,5 +1,5 @@
project('harfbuzz', 'c', 'cpp', project('harfbuzz', 'c', 'cpp',
meson_version: '>= 0.52.0', meson_version: '>= 0.55.0',
version: '3.1.1', version: '3.1.1',
default_options: [ default_options: [
'cpp_rtti=false', # Just to support msvc, we are passing -fno-exceptions also anyway 'cpp_rtti=false', # Just to support msvc, we are passing -fno-exceptions also anyway
@ -141,18 +141,12 @@ if not get_option('cairo').disabled()
endif endif
if not cairo_dep.found() if not cairo_dep.found()
# Requires Meson 0.54.0 to use cairo subproject # Note that we don't have harfbuzz -> cairo -> freetype2 -> harfbuzz fallback
if meson.version().version_compare('>=0.54.0') # dependency cycle here because we have configured freetype2 above with
# Note that we don't have harfbuzz -> cairo -> freetype2 -> harfbuzz fallback # harfbuzz support disabled, so when cairo will lookup freetype2 dependency
# dependency cycle here because we have configured freetype2 above with # it will be forced to use that one.
# harfbuzz support disabled, so when cairo will lookup freetype2 dependency cairo_dep = dependency('cairo', fallback: 'cairo', required: get_option('cairo'))
# it will be forced to use that one. cairo_ft_dep = dependency('cairo-ft', fallback: 'cairo', required: get_option('cairo'))
cairo_dep = dependency('cairo', fallback: 'cairo', required: get_option('cairo'))
cairo_ft_dep = dependency('cairo-ft', fallback: 'cairo', required: get_option('cairo'))
elif get_option('cairo').enabled()
error('cairo feature is enabled but it cannot be found on the system and ' +
'meson>=0.54.0 is required to build it as subproject')
endif
endif endif
endif endif
@ -387,19 +381,6 @@ build_summary = {
'Benchmark': get_option('benchmark').enabled(), 'Benchmark': get_option('benchmark').enabled(),
}, },
} }
if meson.version().version_compare('>=0.53') foreach section_title, section : build_summary
foreach section_title, section : build_summary summary(section, bool_yn: true, section: section_title)
summary(section, bool_yn: true, section: section_title) endforeach
endforeach
else
summary = ['']
foreach section_title, section : build_summary
summary += ' @0@:'.format(section_title)
foreach feature, value : section
summary += ' @0@:'.format(feature)
summary += ' @0@'.format(value)
endforeach
summary += ''
endforeach
message('\n'.join(summary))
endif

View File

@ -6,12 +6,6 @@ if get_option('experimental_api') and add_languages('rust', required: false, nat
ttf_parser_dep = subproject('ttf-parser').get_variable('ttf_parser_dep') ttf_parser_dep = subproject('ttf-parser').get_variable('ttf_parser_dep')
endif endif
if ttf_parser_dep.found()
benchmark_cpp_args = ['-DHAVE_TTFPARSER']
else
benchmark_cpp_args = []
endif
benchmark('perf', executable('perf', 'perf.cc', benchmark('perf', executable('perf', 'perf.cc',
dependencies: [ dependencies: [
google_benchmark_dep, freetype_dep, google_benchmark_dep, freetype_dep,
@ -20,8 +14,8 @@ benchmark('perf', executable('perf', 'perf.cc',
# https://github.com/RazrFalcon/ttf-parser/issues/29 # https://github.com/RazrFalcon/ttf-parser/issues/29
ttf_parser_dep, thread_dep, cpp.find_library('dl'), ttf_parser_dep, thread_dep, cpp.find_library('dl'),
], ],
cpp_args: benchmark_cpp_args, cpp_args: ttf_parser_dep.found() ? ['-DHAVE_TTFPARSER'] : [],
include_directories: [incconfig, incsrc], include_directories: [incconfig, incsrc],
link_with: [libharfbuzz], link_with: [libharfbuzz],
install: false, install: false,
), workdir: join_paths(meson.current_source_dir(), '..'), timeout: 100) ), workdir: meson.current_source_dir() / '..', timeout: 100)

View File

@ -3,7 +3,7 @@ hb_version_h = configure_file(
input: 'hb-version.h.in', input: 'hb-version.h.in',
output: 'hb-version.h', output: 'hb-version.h',
install: true, install: true,
install_dir: join_paths(get_option('includedir'), meson.project_name())) install_dir: get_option('includedir') / meson.project_name())
# Base and default-included sources and headers # Base and default-included sources and headers
hb_base_sources = files( hb_base_sources = files(
@ -569,7 +569,7 @@ cmake_config.set('have_gobject', '@0@'.format(have_gobject))
configure_file(input: 'harfbuzz-config.cmake.in', configure_file(input: 'harfbuzz-config.cmake.in',
output: 'harfbuzz-config.cmake', output: 'harfbuzz-config.cmake',
configuration: cmake_config, configuration: cmake_config,
install_dir: join_paths(get_option('libdir'), 'cmake', 'harfbuzz'), install_dir: get_option('libdir') / 'cmake' / 'harfbuzz',
) )
libharfbuzz_gobject_dep = null_dep libharfbuzz_gobject_dep = null_dep
@ -579,14 +579,12 @@ if have_gobject
h_templ = configure_file( h_templ = configure_file(
input: 'hb-gobject-enums.h.tmpl', input: 'hb-gobject-enums.h.tmpl',
output: 'hb-gobject-enums-tmp.h.tmpl', output: 'hb-gobject-enums-tmp.h.tmpl',
configuration: configuration_data(), copy: true)
format: 'cmake')
cc_templ = configure_file( cc_templ = configure_file(
input: 'hb-gobject-enums.cc.tmpl', input: 'hb-gobject-enums.cc.tmpl',
output: 'hb-gobject-enums-tmp.cc.tmpl', output: 'hb-gobject-enums-tmp.cc.tmpl',
configuration: configuration_data(), copy: true)
format: 'cmake')
enums = gnome.mkenums('hb-gobject', enums = gnome.mkenums('hb-gobject',
sources: hb_headers, sources: hb_headers,
@ -607,7 +605,7 @@ if have_gobject
output: 'hb-gobject-enums.h', output: 'hb-gobject-enums.h',
command: [find_program('fix_get_types.py'), '@INPUT@', '@OUTPUT@'], command: [find_program('fix_get_types.py'), '@INPUT@', '@OUTPUT@'],
install: true, install: true,
install_dir: join_paths(get_option('prefix'), get_option('includedir'), meson.project_name()), install_dir: get_option('prefix') / get_option('includedir') / meson.project_name(),
) )
hb_gobject_sources += [enum_c] hb_gobject_sources += [enum_c]
@ -658,16 +656,10 @@ if have_gobject
'--cflags-end']) '--cflags-end'])
endif endif
if build_gir
libharfbuzz_gobject_sources = hb_gen_files_gir
else
libharfbuzz_gobject_sources = hb_gobject_sources
endif
libharfbuzz_gobject_dep = declare_dependency( libharfbuzz_gobject_dep = declare_dependency(
link_with: libharfbuzz_gobject, link_with: libharfbuzz_gobject,
include_directories: incsrc, include_directories: incsrc,
sources: libharfbuzz_gobject_sources, sources: build_gir ? hb_gen_files_gir : hb_gobject_sources,
dependencies: [glib_dep, gobject_dep]) dependencies: [glib_dep, gobject_dep])
pkgmod.generate(libharfbuzz_gobject, pkgmod.generate(libharfbuzz_gobject,
@ -708,21 +700,13 @@ if get_option('tests').enabled()
env.set('HBHEADERS', ' '.join(HBHEADERS)) env.set('HBHEADERS', ' '.join(HBHEADERS))
if cpp.get_id() != 'msvc' and not meson.is_cross_build() # ensure the local tools are usable if cpp.get_id() != 'msvc' and not meson.is_cross_build() # ensure the local tools are usable
if meson.version().version_compare('>=0.55') dist_check_script += ['check-libstdc++', 'check-static-inits', 'check-symbols']
dist_check_script += 'check-libstdc++'
endif
dist_check_script += ['check-static-inits', 'check-symbols']
endif endif
foreach name : dist_check_script foreach name : dist_check_script
if name == 'check-symbols'
test_depends = defs_list
else
test_depends = []
endif
test(name, find_program(name + '.py'), test(name, find_program(name + '.py'),
env: env, env: env,
depends: test_depends, depends: name == 'check-symbols' ? defs_list : [],
suite: ['src'], suite: ['src'],
) )
endforeach endforeach

View File

@ -38,7 +38,7 @@ test('shape_fuzzer', find_program('run-shape-fuzzer-tests.py'),
], ],
timeout: 300, timeout: 300,
depends: [hb_shape_fuzzer_exe, libharfbuzz, libharfbuzz_subset], depends: [hb_shape_fuzzer_exe, libharfbuzz, libharfbuzz_subset],
workdir: join_paths(meson.current_build_dir(), '..', '..'), workdir: meson.current_build_dir() / '..' / '..',
env: env, env: env,
suite: ['fuzzing', 'slow'], suite: ['fuzzing', 'slow'],
) )
@ -50,7 +50,7 @@ test('subset_fuzzer', find_program('run-subset-fuzzer-tests.py'),
# as the tests are ran concurrently let's raise acceptable time here # as the tests are ran concurrently let's raise acceptable time here
# ideally better to break and let meson handles them in parallel # ideally better to break and let meson handles them in parallel
timeout: 300, timeout: 300,
workdir: join_paths(meson.current_build_dir(), '..', '..'), workdir: meson.current_build_dir() / '..' / '..',
env: env, env: env,
suite: ['fuzzing', 'slow'], suite: ['fuzzing', 'slow'],
) )
@ -59,7 +59,7 @@ test('draw_fuzzer', find_program('run-draw-fuzzer-tests.py'),
args: [ args: [
hb_draw_fuzzer_exe, hb_draw_fuzzer_exe,
], ],
workdir: join_paths(meson.current_build_dir(), '..', '..'), workdir: meson.current_build_dir() / '..' / '..',
env: env, env: env,
suite: ['fuzzing'], suite: ['fuzzing'],
) )

View File

@ -14,10 +14,10 @@ foreach file_name : in_house_tests
test(test_name, shaping_run_tests_py, test(test_name, shaping_run_tests_py,
args: [ args: [
hb_shape, hb_shape,
join_paths(meson.current_source_dir(), 'data', 'in-house', 'tests', file_name), meson.current_source_dir() / 'data' / 'in-house' / 'tests' / file_name,
], ],
env: env, env: env,
workdir: join_paths(meson.current_build_dir(), '..', '..'), workdir: meson.current_build_dir() / '..' / '..',
suite: ['shaping', 'in-house'], suite: ['shaping', 'in-house'],
) )
endforeach endforeach
@ -28,10 +28,10 @@ foreach file_name : aots_tests
test(test_name, shaping_run_tests_py, test(test_name, shaping_run_tests_py,
args: [ args: [
hb_shape, hb_shape,
join_paths(meson.current_source_dir(), 'data', 'aots', 'tests', file_name), meson.current_source_dir() / 'data' / 'aots' / 'tests' / file_name,
], ],
env: env, env: env,
workdir: join_paths(meson.current_build_dir(), '..', '..'), workdir: meson.current_build_dir() / '..' / '..',
suite: ['shaping', 'aots'], suite: ['shaping', 'aots'],
) )
endforeach endforeach
@ -42,10 +42,10 @@ foreach file_name : text_rendering_tests
test(test_name, shaping_run_tests_py, test(test_name, shaping_run_tests_py,
args: [ args: [
hb_shape, hb_shape,
join_paths(meson.current_source_dir(), 'data', 'text-rendering-tests', 'tests', file_name), meson.current_source_dir() / 'data' / 'text-rendering-tests' / 'tests' / file_name,
], ],
env: env, env: env,
workdir: join_paths(meson.current_build_dir(), '..', '..'), workdir: meson.current_build_dir() / '..' / '..',
suite: ['shaping', 'text-rendering-tests'], suite: ['shaping', 'text-rendering-tests'],
) )
endforeach endforeach

View File

@ -66,12 +66,12 @@ foreach t : tests
test(t, run_test, test(t, run_test,
args: [ args: [
hb_subset, hb_subset,
join_paths(meson.current_source_dir(), 'data', 'tests', fname), meson.current_source_dir() / 'data' / 'tests' / fname,
], ],
# as the tests are ran concurrently let's raise acceptable time here # as the tests are ran concurrently let's raise acceptable time here
# ideally better to break and let meson handles them in parallel # ideally better to break and let meson handles them in parallel
timeout: 500, timeout: 500,
workdir: join_paths(meson.current_build_dir(), '..', '..'), workdir: meson.current_build_dir() / '..' / '..',
suite: 'subset', suite: 'subset',
) )
endforeach endforeach
@ -84,9 +84,9 @@ foreach t : repack_tests
test(t, run_repack_test, test(t, run_repack_test,
args: [ args: [
hb_subset, hb_subset,
join_paths(meson.current_source_dir(), 'data', 'repack_tests', fname), meson.current_source_dir() / 'data' / 'repack_tests' / fname,
], ],
workdir: join_paths(meson.current_build_dir(), '..', '..'), workdir: meson.current_build_dir() / '..' / '..',
suite: ['subset', 'repack'], suite: ['subset', 'repack'],
) )
endforeach endforeach