From ad835fb37c3d0a5748b95ba78c52a0f939c0bd0b Mon Sep 17 00:00:00 2001 From: "builds.sr.ht" Date: Sat, 13 May 2023 16:26:43 +0000 Subject: [PATCH] Squashed 'subprojects/props.lv2/' changes from 769060d..3d8c0b6 3d8c0b6 release-0.2.0 6712ae2 Migrate to common ci recipes git-subtree-dir: subprojects/props.lv2 git-subtree-split: 3d8c0b629364788a18a4c6f025b57c614cc7db4a --- .builds/alpine-latest.yml | 68 ++++++++++++++ meson.build | 190 ++++++++++++++++++++------------------ meson_options.txt | 9 +- 3 files changed, 175 insertions(+), 92 deletions(-) create mode 100644 .builds/alpine-latest.yml diff --git a/.builds/alpine-latest.yml b/.builds/alpine-latest.yml new file mode 100644 index 0000000..cba513b --- /dev/null +++ b/.builds/alpine-latest.yml @@ -0,0 +1,68 @@ +# SPDX-FileCopyrightText: Hanspeter Portner +# SPDX-License-Identifier: CC0-1.0 + +--- + +image: alpine/latest + +packages: + - clang15-analyzer + - llvm15 + - reuse + - meson + - git-subtree + - hut + - jq + - valgrind + + - lv2-dev + +environment: + project: props.lv2 + +secrets: + - 0545580c-42ac-4700-b322-4e9df924eb07 # runner-ssh + - 5fe806cd-3af4-4588-9898-8115d9262144 # hut-config + - d6d10b2a-542a-4b45-b1be-6ef30a8ab558 # git-config + +sources: + - https://git.open-music-kontrollers.ch/~hp/ci + +tasks: + - gcc: | + . ~/ci/activate + + ci-meson gcc setup + ci-meson gcc build + ci-meson gcc test + ci-meson gcc memcheck + + - clang: | + . ~/ci/activate + + ci-meson clang setup + ci-meson clang build + ci-meson clang test + ci-meson clang memcheck + + - analyzer: | + . ~/ci/activate + + ci-meson analyzer setup + ci-meson analyzer build + ci-meson analyzer test + + - deploy: | + . ~/ci/activate + + if ! ci-isrelease; then + complete-build + fi + + ci-subtreemerge + +triggers: + - action: email + condition: failure + to: "" +... diff --git a/meson.build b/meson.build index e9e3252..a9ed05f 100644 --- a/meson.build +++ b/meson.build @@ -8,16 +8,11 @@ project('props.lv2', 'c', default_options : [ 'b_lto=true', 'c_std=c11']) +build_tests = get_option('build-tests') lv2libdir = get_option('lv2libdir') inst_dir = join_paths(lv2libdir, meson.project_name()) -reuse = find_program('reuse', required : false) -cp = find_program('cp') -lv2_validate = find_program('lv2_validate', native : true, required : false) -sord_validate = find_program('sord_validate', native : true, required : false) -lv2lint = find_program('lv2lint', required : false) - add_project_arguments('-D_GNU_SOURCE', language : 'c') conf_data = configuration_data() @@ -26,96 +21,111 @@ cc = meson.get_compiler('c') m_dep = cc.find_library('m') lv2_dep = dependency('lv2', version : '>=1.14.0') -lib_deps = [] -lib_deps += m_dep -lib_deps += lv2_dep +lib_deps = [ + m_dep, + lv2_dep +] -lib_incs = [] -lib_incs += include_directories('') +lib_incs = [ + include_directories('') +] -lib_srcs = [] -lib_srcs += join_paths('src', 'props.c') +lib_srcs = [ + join_paths('src', 'props.c') +] props_lv2 = declare_dependency( include_directories : lib_incs, dependencies : lib_deps, sources : lib_srcs) -test_args = [] -test_args += '-fvisibility=hidden' -test_args += '-ffast-math' - -test_deps = [] -test_deps += props_lv2 - -test_srcs = [] -test_srcs += join_paths('test', 'props.c') - -check_srcs = [] -check_srcs += join_paths('test', 'props_test.c') - -install = not meson.is_subproject() - -mod = shared_module('props', test_srcs, - c_args : test_args, - name_prefix : '', - dependencies : test_deps, - install : install, - install_dir : inst_dir) - -version = get_option('version').split('.') -conf_data.set('MAJOR_VERSION', version[0]) -conf_data.set('MINOR_VERSION', version[1]) -conf_data.set('MICRO_VERSION', version[2]) - -suffix = mod.full_path().strip().split('.')[-1] -conf_data.set('MODULE_SUFFIX', '.' + suffix) - -manifest_ttl = configure_file( - input : join_paths('test', 'manifest.ttl.in'), - output : 'manifest.ttl', - configuration : conf_data, - install : install, - install_dir : inst_dir) - -dsp_ttl = configure_file( - input : join_paths('test', 'props.ttl'), - output : 'props.ttl', - copy : true, - install : install, - install_dir : inst_dir) - -chunk_bin = configure_file( - input : join_paths('test', 'chunk.bin'), - output : 'chunk.bin', - copy : true, - install : install, - install_dir : inst_dir) - -props_test = executable('props_test', check_srcs, - c_args : test_args, - dependencies : test_deps, - install : false) - -test('Test', props_test, - timeout : 240) - -if lv2_validate.found() and sord_validate.found() - test('LV2 validate', lv2_validate, - args : [manifest_ttl, dsp_ttl]) -endif - -if lv2lint.found() - test('LV2 lint', lv2lint, - args : ['-M', 'pack', - '-E', 'warn', - '-I', meson.current_build_dir(), - 'http://open-music-kontrollers.ch/lv2/props#test']) -endif - -if reuse.found() - test('REUSE', reuse, args : [ - '--root', meson.current_source_dir(), - 'lint' - ]) +if build_tests + reuse = find_program('reuse', required : false) + lv2_validate = find_program('lv2_validate', native : true, required : false) + sord_validate = find_program('sord_validate', native : true, required : false) + lv2lint = find_program('lv2lint', required : false) + + test_args = [ + '-fvisibility=hidden', + '-ffast-math' + ] + + test_deps = [ + props_lv2 + ] + + test_srcs = [ + join_paths('test', 'props.c') + ] + + check_srcs = [ + join_paths('test', 'props_test.c') + ] + + install = not meson.is_subproject() + + mod = shared_module('props', test_srcs, + c_args : test_args, + name_prefix : '', + dependencies : test_deps, + install : install, + install_dir : inst_dir) + + version = get_option('version').split('.') + conf_data.set('MAJOR_VERSION', version[0]) + conf_data.set('MINOR_VERSION', version[1]) + conf_data.set('MICRO_VERSION', version[2]) + + suffix = mod.full_path().strip().split('.')[-1] + conf_data.set('MODULE_SUFFIX', '.' + suffix) + + manifest_ttl = configure_file( + input : join_paths('test', 'manifest.ttl.in'), + output : 'manifest.ttl', + configuration : conf_data, + install : install, + install_dir : inst_dir) + + dsp_ttl = configure_file( + input : join_paths('test', 'props.ttl'), + output : 'props.ttl', + copy : true, + install : install, + install_dir : inst_dir) + + chunk_bin = configure_file( + input : join_paths('test', 'chunk.bin'), + output : 'chunk.bin', + copy : true, + install : install, + install_dir : inst_dir) + + props_test = executable('props_test', check_srcs, + c_args : test_args, + dependencies : test_deps, + install : false) + + test('Test', props_test, + timeout : 240, + suite: ['memcheck']) + + if lv2_validate.found() and sord_validate.found() + test('LV2 validate', lv2_validate, + args : [manifest_ttl, dsp_ttl]) + endif + + if lv2lint.found() + test('LV2 lint', lv2lint, + args : ['-M', 'pack', + '-E', 'warn', + '-I', meson.current_build_dir(), + 'http://open-music-kontrollers.ch/lv2/props#test']) + endif + + if reuse.found() + test('REUSE', reuse, args : [ + '--root', meson.current_source_dir(), + 'lint' + ]) + endif endif diff --git a/meson_options.txt b/meson_options.txt index cb7f311..fdb7125 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,8 +1,13 @@ # SPDX-FileCopyrightText: Hanspeter Portner # SPDX-License-Identifier: CC0-1.0 -# + +option('build-tests', + type : 'boolean', + value : true, + yield : true) + option('lv2libdir', type : 'string', value : 'lib/lv2') -option('version', type : 'string', value : '0.1.195') +option('version', type : 'string', value : '0.2.0') -- 2.45.2