~hp/vm.lv2

2bc984102178828d5a3cb2d9b99c5289aa97871a — builds.sr.ht 1 year, 4 months ago 2e59790
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
3 files changed, 175 insertions(+), 92 deletions(-)

A .builds/alpine-latest.yml
M meson.build
M meson_options.txt
A .builds/alpine-latest.yml => .builds/alpine-latest.yml +68 -0
@@ 0,0 1,68 @@
# SPDX-FileCopyrightText: Hanspeter Portner <dev@open-music-kontrollers.ch>
# 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: "<dev@open-music-kontrollers.ch>"
...

M meson.build => meson.build +100 -90
@@ 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

M meson_options.txt => meson_options.txt +7 -2
@@ 1,8 1,13 @@
# SPDX-FileCopyrightText: Hanspeter Portner <dev@open-music-kontrollers.ch>
# 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')