Phase 20: package Linux builds and document release and maintenance workflows

This commit is contained in:
Johannes Findeisen 2026-10-27 06:44:22 +01:00
commit 830b6e1914
22 changed files with 490 additions and 17 deletions

View file

@ -36,6 +36,13 @@ def main():
assert (root / 'share/doc/xtc/PROJECT_FORMAT.md').is_file()
assert os.access(root / 'bin/xtc-check', os.X_OK)
run([str(root / 'bin/xtc-check')])
diagnose = subprocess.check_output([str(root / 'bin/xtc-check'), '--diagnose'], text=True)
assert 'Project formats: 1..7' in diagnose and 'JACK compiled:' in diagnose
# Upgrade/repair repeats the same owned-file install and keeps unrelated data.
(root / 'include/xtc/xtc.h').write_text('old installation marker\n')
run(make + ['install'] + variables, env=env)
assert (root / 'include/xtc/xtc.h').read_bytes() == (source / 'include/xtc/xtc.h').read_bytes()
assert sentinel.read_text() == 'keep\n'
version = subprocess.check_output([str(root / 'bin/xtc-check'), '--version'], text=True)
assert version.startswith('xtc ')
valid = stage / 'valid.xtc'
@ -54,12 +61,29 @@ def main():
flags = shlex.split(subprocess.check_output(pkg + ['--cflags', '--libs', '--static', 'xtc'], env=pkg_env, text=True))
includes = ''.join(f'#include "xtc/{p.name}"\n' for p in sorted((source / 'include/xtc').glob('*.h')))
consumer = stage / 'consumer.c'
consumer.write_text(includes + '\nint main(void) { xtc_project *p = 0; xtc_result r = xtc_project_create(&p); xtc_project_destroy(p); return r != XTC_OK; }\n')
consumer.write_text(includes + r'''
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv) {
xtc_project *p = 0, *q = 0; xtc_midi_plan *a = 0, *b = 0;
uint64_t track, clip, note; float before[127], after[127]; int i, nonzero = 0;
if (argc != 2 || xtc_project_create(&p) != XTC_OK || xtc_project_create(&q) != XTC_OK) return 1;
if (xtc_project_add_track(p,"Installed",&track) != XTC_OK ||
xtc_project_add_midi_clip(p,track,0,960,&clip) != XTC_OK ||
xtc_project_add_note(p,clip,0,960,69,127,0,&note) != XTC_OK ||
xtc_project_save(p,argv[1]) != XTC_OK || xtc_project_load(q,argv[1]) != XTC_OK ||
xtc_midi_plan_create(p,48000,&a) != XTC_OK || xtc_midi_plan_create(q,48000,&b) != XTC_OK ||
xtc_midi_plan_render(a,0,0,0,before,127) != XTC_OK || xtc_midi_plan_render(b,0,0,0,after,127) != XTC_OK) return 2;
for (i = 0; i < 127; ++i) { if (before[i] != after[i]) return 3; if (before[i] != 0) nonzero = 1; }
xtc_midi_plan_destroy(a); xtc_midi_plan_destroy(b); xtc_project_destroy(p); xtc_project_destroy(q);
remove(argv[1]); return !nonzero;
}
''')
for compiler, standard in [('CC', 'c99'), ('CXX', 'c++17')]:
output = stage / ('consumer-' + compiler)
command = shlex.split(env.get(compiler, 'cc' if compiler == 'CC' else 'c++'))
run(command + [f'-std={standard}', '-Wall', '-Wextra', '-Werror', str(consumer)] + flags + ['-o', str(output)])
run([str(output)])
run([str(output), str(stage / ("installed-" + compiler + ".xtc"))])
if args.gui:
run(make + ['install-gui'] + variables, env=env)
gui_env = dict(env, DISPLAY='', WAYLAND_DISPLAY='')