From 13a4f69a55984a5e7aa5d83ab19e8456a74bf1c0 Mon Sep 17 00:00:00 2001 From: mmnmnnmnmm Date: Mon, 10 Oct 2022 20:26:49 +0100 Subject: [PATCH] dosbox-staging: run speexdsp test in cross-builds Use qemu-user-static to test target speexdsp library for a hard to diagnose sound issue. --- .../dosbox-staging/patches/fix_cross.patch | 62 +++++++------------ srcpkgs/dosbox-staging/template | 1 + 2 files changed, 25 insertions(+), 38 deletions(-) diff --git a/srcpkgs/dosbox-staging/patches/fix_cross.patch b/srcpkgs/dosbox-staging/patches/fix_cross.patch index 98b0b6b7884c..3cc2ca806c00 100644 --- a/srcpkgs/dosbox-staging/patches/fix_cross.patch +++ b/srcpkgs/dosbox-staging/patches/fix_cross.patch @@ -1,55 +1,41 @@ +diff --git a/meson.build b/meson.build +index 1509deabca..5d517611aa 100644 --- a/meson.build +++ b/meson.build -@@ -376,24 +376,37 @@ +@@ -377,24 +377,30 @@ speexdsp_dep = dependency( static: ('speexdsp' in static_libs_list or prefers_static_libs), ) -# The system has SpeexDSP, so test its floating-point handling -if speexdsp_dep.found() -- system_speexdsp_test = cxx.run( -- files('contrib/check-speexdsp/test_speexdsp_float_api.cpp'), -- dependencies: speexdsp_dep, -- name: 'SpeexDSP system library has reliable floating-point API', -- ) ++# The library needs to be available and testable to be trusted ++can_trust_system_speexdsp = ( ++ speexdsp_dep.found() ++ and meson.can_run_host_binaries() ++) ++ ++# Test the library. Trust is dropped if the test fails. ++if can_trust_system_speexdsp + system_speexdsp_test = cxx.run( + files('contrib/check-speexdsp/test_speexdsp_float_api.cpp'), + dependencies: speexdsp_dep, + name: 'SpeexDSP system library has reliable floating-point API', + ) - is_system_speexdsp_reliable = ( -- system_speexdsp_test.compiled() -- and system_speexdsp_test.returncode() == 0 -- ) ++ can_trust_system_speexdsp = ( + system_speexdsp_test.compiled() + and system_speexdsp_test.returncode() == 0 + ) - if is_system_speexdsp_reliable -- speexdsp_summary_msg = 'system library' -+if meson.can_run_host_binaries() -+ # The system has SpeexDSP, so test its floating-point handling -+ if speexdsp_dep.found() -+ system_speexdsp_test = cxx.run( -+ files('contrib/check-speexdsp/test_speexdsp_float_api.cpp'), -+ dependencies: speexdsp_dep, -+ name: 'SpeexDSP system library has reliable floating-point API', -+ ) -+ is_system_speexdsp_reliable = ( -+ system_speexdsp_test.compiled() -+ and system_speexdsp_test.returncode() == 0 -+ ) -+ if is_system_speexdsp_reliable -+ speexdsp_summary_msg = 'system library' -+ endif ++ if can_trust_system_speexdsp + speexdsp_summary_msg = 'system library' endif -+else -+ speexdsp_summary_msg = 'system library' endif -# The system doesn't have SpeexDSP or it's unreiable, so use the wrap -if not speexdsp_dep.found() or not is_system_speexdsp_reliable -+use_speex_wrap = false -+# The system doesn't have SpeexDSP or it's unreliable, so use the wrap -+if not speexdsp_dep.found() -+ use_speex_wrap = true -+elif meson.can_run_host_binaries() -+ if not is_system_speexdsp_reliable -+ use_speex_wrap = true -+ endif -+endif -+ -+if use_speex_wrap ++# Use the wrap if the system doesn't have SpeexDSP, we couldn't test it, or testing failed ++if not can_trust_system_speexdsp speexdsp_dep = subproject( 'speexdsp', default_options: default_wrap_options, diff --git a/srcpkgs/dosbox-staging/template b/srcpkgs/dosbox-staging/template index 7173a6fda80a..c844b3db58f6 100644 --- a/srcpkgs/dosbox-staging/template +++ b/srcpkgs/dosbox-staging/template @@ -3,6 +3,7 @@ pkgname=dosbox-staging version=0.79.1 revision=1 build_style=meson +build_helper=qemu hostmakedepends="pkg-config" makedepends="SDL2-devel SDL2_net-devel alsa-lib-devel fluidsynth-devel libiir1-devel libmt32emu-devel libpng-devel libslirp-devel opusfile-devel speexdsp-devel"