Sync versioning schemes between Meson and CMake

Use a computed soversion of 1.

This keeps compatibility with the version in the SONAME from openSUSE
and Fedora, which fixed the botched soname in bzip2's historical
tarballs.

See this post for details:
https://people.gnome.org/~federico/blog/preparing-the-bzip2-107-release.html
This commit is contained in:
Federico Mena Quintero 2019-06-21 17:23:16 -05:00
parent 29a935d589
commit 277548b072
2 changed files with 29 additions and 2 deletions

View File

@ -7,6 +7,8 @@ project(bzip2
# See versioning rule:
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
#
# KEEP THESE IN SYNC WITH meson.build OR STUFF WILL BREAK!
set(LT_CURRENT 1)
set(LT_REVISION 6)
set(LT_AGE 0)

View File

@ -27,13 +27,37 @@ endif
bz_sources = ['blocksort.c', 'huffman.c', 'crctable.c', 'randtable.c', 'compress.c', 'decompress.c', 'bzlib.c']
## Library versioning
##
## New package version:
## revision += 1
##
## New interfaces:
## current += 1
## revision = 0
## age += 1
##
## Deleted/changed interfaces:
## current += 1
## revision = 0
## age = 0
##
## KEEP THESE IN SYNC WITH CMakeLists.txt OR STUFF WILL BREAK!
bz2_lt_current = 1
bz2_lt_revision = 6
bz2_lt_age = 0
bz2_soversion = bz2_lt_current - bz2_lt_age
bz2_lt_version = '@0@.@1@.@2@'.format(bz2_soversion, bz2_lt_age, bz2_lt_revision)
if ['msvc', 'clang-cl', 'intel-cl'].contains(cc.get_id())
libbzip2 = library(
'bz2',
bz_sources,
c_args : c_args,
vs_module_defs : 'libbz2.def',
version : meson.project_version(),
version : bz2_lt_version,
soversion : bz2_soversion,
install : true,
)
else
@ -42,7 +66,8 @@ else
bz_sources,
c_args : c_args,
gnu_symbol_visibility : 'hidden',
version : meson.project_version(),
version : bz2_lt_version,
soversion : bz2_soversion,
install : true,
)
endif