#============================================================================================================ # Source: https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/334 # # From: Jeremy Huddleston Sequoia # Date: Sun, 19 Jun 2022 13:45:09 -0700 # Subject: [PATCH] meson: Setup darwin dylib versions # # autotools-builds of cairo had broken compat/current version management. They had current == compat # and bumped every release, making them not suitable for distribution as system libraries. In # transitioning to meson, we're resetting this to a sane versioning scheme. #============================================================================================================ --- meson.build +++ meson.build @@ -24,6 +24,9 @@ cairo_version_sonum = cairo_version_major + 1 cairo_version = cairo_version_major * 10000 + cairo_version_minor * 100 + cairo_version_micro +# ABI compatibility version should be that used for 1.17.x +cairo_version_compat = 11709 + if cairo_version_minor % 2 == 1 # unstable release cairo_libversion = '@0@.@1@.0'.format(cairo_version_sonum, cairo_version) @@ -32,6 +35,12 @@ cairo_libversion = '@0@.@1@.@2@'.format(cairo_version_sonum, cairo_version, cairo_version_micro) endif +cairo_dylib_ver_compat = '@0@.0.0'.format(cairo_version_compat) +cairo_dylib_ver_current = '@0@.0.0'.format(cairo_version) +message('cairo_dylib_ver_compat: ', cairo_dylib_ver_compat) +message('cairo_dylib_ver_current: ', cairo_dylib_ver_current) +cairo_darwin_versions = [cairo_dylib_ver_compat, cairo_dylib_ver_current] + conf = configuration_data() cc = meson.get_compiler('c') --- src/meson.build +++ src/meson.build @@ -267,6 +267,7 @@ libcairo = library('cairo', cairo_sources, link_args: extra_link_args, soversion: cairo_version_sonum, version: cairo_libversion, + darwin_versions: cairo_darwin_versions, install: true, include_directories: incbase, ) --- util/cairo-gobject/meson.build +++ util/cairo-gobject/meson.build @@ -12,6 +12,7 @@ dependencies: [glib_dep, gobject_dep, libcairo_dep], soversion: cairo_version_sonum, version: cairo_libversion, + darwin_versions: cairo_darwin_versions, gnu_symbol_visibility: 'hidden', c_args: ['-DCAIRO_COMPILATION'], link_args: extra_link_args, --- util/cairo-script/meson.build +++ util/cairo-script/meson.build @@ -30,6 +30,7 @@ dependencies: deps + [libcairo_dep, lzo_dep], soversion: cairo_version_sonum, version: cairo_libversion, + darwin_versions: cairo_darwin_versions, c_args: ['-DCAIRO_COMPILATION'], link_args: extra_link_args, install: true,