From 478c7869735c1d12cfb45d134d3b75bfc0d175a8 Mon Sep 17 00:00:00 2001 From: "builds.sr.ht" Date: Sat, 13 May 2023 13:58:32 +0000 Subject: [PATCH] Squashed 'subprojects/timely.lv2/' changes from 87feff7..1dcec6a 1dcec6a release-0.2.0 dd1b7d4 Migrate to common ci recipes git-subtree-dir: subprojects/timely.lv2 git-subtree-split: 1dcec6a188a3f2b7a58e9c3c4d41eea5e2c85cd9 --- .build.yml | 18 ----- .builds/alpine-latest.yml | 68 +++++++++++++++++ meson.build | 150 +++++++++++++++++++------------------- meson_options.txt | 9 ++- 4 files changed, 152 insertions(+), 93 deletions(-) delete mode 100644 .build.yml create mode 100644 .builds/alpine-latest.yml diff --git a/.build.yml b/.build.yml deleted file mode 100644 index 7f234b2..0000000 --- a/.build.yml +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-FileCopyrightText: Hanspeter Portner -# SPDX-License-Identifier: CC0-1.0 - -image: alpine/latest -packages: - - reuse - - meson - - lv2-dev -tasks: - - setup: | - cd timely.lv2 - meson setup build - - build: | - cd timely.lv2 - ninja -C build - - test: | - cd timely.lv2 - ninja -C build test diff --git a/.builds/alpine-latest.yml b/.builds/alpine-latest.yml new file mode 100644 index 0000000..98b0247 --- /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: timely.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 7a44ff3..02ded5f 100644 --- a/meson.build +++ b/meson.build @@ -2,22 +2,16 @@ # SPDX-License-Identifier: CC0-1.0 project('timely.lv2', 'c', default_options : [ - 'buildtype=release', 'warning_level=3', 'werror=false', '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,78 +20,88 @@ 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', 'timely.c') +lib_srcs = [ + join_paths('src', 'timely.c') +] timely_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 += timely_lv2 - -test_srcs = [] -test_srcs += join_paths('test', 'timely.c') - -install = not meson.is_subproject() - -mod = shared_module('timely', 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', 'timely.ttl'), - output : 'timely.ttl', - copy : true, - install : install, - install_dir : inst_dir) - -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/timely#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 = [] + test_args += '-fvisibility=hidden' + test_args += '-ffast-math' + + test_deps = [] + test_deps += timely_lv2 + + test_srcs = [] + test_srcs += join_paths('test', 'timely.c') + + install = not meson.is_subproject() + + mod = shared_module('timely', 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', 'timely.ttl'), + output : 'timely.ttl', + copy : true, + install : install, + install_dir : inst_dir) + + 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/timely#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 616c427..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.97') +option('version', type : 'string', value : '0.2.0') -- 2.38.5