0cdd2a5c54
The ABI of a shared library on Linux is given by a major version, which is part of the SONAME and is incremented (rarely) on incompatible changes, and a minor version, which is part of the basename of the regular file to which the SONAME provides a symlink. Until now, the ABI minor version was hard-coded, which means we can't tell which of a pair of Wayland libraries is newer (and therefore likely to have more symbols and/or fewer bugs). libwayland-egl already had ABI major version 1, so we can use the "marketing" version number as the ABI major.minor version number directly, so Wayland 1.19.90 would produce libwayland-egl.so.1 -> libwayland-egl.so.1.19.90. libwayland-cursor and libwayland-server have ABI major version 0, and OS distributions don't like it when there's a SONAME bump for no good reason, so use their existing ABI major version together with the "marketing" minor version: libwayland-cursor.so.0 -> libwayland-cursor.so.0.19.90. If the Wayland major version number is incremented to 2, we'll have to rethink this, so add some error() to break the build if/when that happens. Assuming that Wayland 2.0 would involve breaking changes, the best way would probably to bump all the SONAMEs to libwayland-foo.so.2. Resolves: https://gitlab.freedesktop.org/wayland/wayland/-/issues/175 Signed-off-by: Simon McVittie <smcv@collabora.com>
39 lines
1.2 KiB
Meson
39 lines
1.2 KiB
Meson
icondir = get_option('icon_directory')
|
|
if icondir == ''
|
|
icondir = join_paths(get_option('prefix'), get_option('datadir'), 'icons')
|
|
endif
|
|
|
|
if wayland_version[0] != '1'
|
|
# The versioning used for the shared libraries assumes that the major
|
|
# version of Wayland as a whole will increase to 2 if and only if there
|
|
# is an ABI break, at which point we should probably bump the SONAME of
|
|
# all libraries to .so.2. For more details see
|
|
# https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/177
|
|
error('We probably need to bump the SONAME of libwayland-cursor')
|
|
endif
|
|
|
|
wayland_cursor = library(
|
|
'wayland-cursor',
|
|
sources: [
|
|
'wayland-cursor.c',
|
|
'os-compatibility.c',
|
|
'xcursor.c',
|
|
],
|
|
# To avoid an unnecessary SONAME bump, wayland 1.x.y produces
|
|
# libwayland-cursor.so.0.x.y.
|
|
version: '.'.join(['0', wayland_version[1], wayland_version[2]]),
|
|
dependencies: [ wayland_client_dep ],
|
|
c_args: [ '-DICONDIR="@0@"'.format(icondir) ],
|
|
install: true,
|
|
)
|
|
|
|
install_headers('wayland-cursor.h')
|
|
|
|
pkgconfig.generate(
|
|
name: 'Wayland Cursor',
|
|
description: 'Wayland cursor helper library',
|
|
version: meson.project_version(),
|
|
libraries: wayland_cursor,
|
|
filebase: 'wayland-cursor',
|
|
)
|