Skip to content

Commit 0e50d83

Browse files
committed
meson: match libmali SONAME to prebuilt library version
Prebuilts with SONAME libmali.so.0 (e.g. g29p1) caused dh_shlibdeps to pull in an unrelated package as a provider of libmali.so.1 during parallel debuild, since the dummy was always built with version 1.9.0. Detect the major version from the prebuilt SONAME and use it for the dummy library so wrappers link against the correct libmali.so.N.
1 parent 896183f commit 0e50d83

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

meson.build

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,24 @@ map = {
198198
dummy_source = join_paths(meson.current_build_dir(), 'dummy.c')
199199
run_command('touch', dummy_source, check : false)
200200

201+
# Detect the SONAME major version from the prebuilt library so that the dummy
202+
# and all wrapper libraries link against the same libmali.so.N as the prebuilt.
203+
# Without this, a prebuilt with SONAME libmali.so.0 would cause dh_shlibdeps to
204+
# look for a provider of libmali.so.1 (the meson default) outside the package.
205+
_soname_ver = run_command('sh', '-c',
206+
'readelf -d "' + default_lib + '" 2>/dev/null | ' +
207+
'sed -n \'s/.*SONAME.*\\[libmali\\.so\\.\\([0-9]*\\)\\].*/\\1/p\'',
208+
check : false).stdout().strip()
209+
_ver_parts = mali_version.split('.')
210+
mali_lib_version = (_soname_ver != '' ? _soname_ver : _ver_parts[0]) + \
211+
'.' + _ver_parts[1] + '.' + _ver_parts[2]
212+
201213
# Create a dummy library which will be replaced by the prebuilt mali library
202214
libmali = shared_library(
203215
'mali',
204216
dummy_source,
205217
install : true,
206-
version : mali_version)
218+
version : mali_lib_version)
207219

208220
libhook = []
209221
if build_hook

0 commit comments

Comments
 (0)