mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
build: replace version with soversion
This allows us to have a single number to update when doing a release. This drops WLR_VERSION_API_* definitions.
This commit is contained in:
parent
70a084c119
commit
1f722f5c80
3 changed files with 22 additions and 29 deletions
|
@ -3,31 +3,26 @@ old_version="$1"
|
||||||
new_version="$2"
|
new_version="$2"
|
||||||
sed -i meson.build -e "s/version: '$old_version'/version: '$new_version'/g"
|
sed -i meson.build -e "s/version: '$old_version'/version: '$new_version'/g"
|
||||||
|
|
||||||
printf "Backwards-incompatible ABI changes? (y/n) "
|
bugfix='n'
|
||||||
read inc_age
|
printf "Breaking API changes? (y/n) "
|
||||||
if [ "$inc_age" = 'n' ]
|
read breaking
|
||||||
|
if [ "$breaking" = 'n' ]
|
||||||
then
|
then
|
||||||
printf "Interface(s) added, removed, or changed? (y/n) "
|
printf "Bugfix release (no backwards-incompatible ABI changes)? (y/n) "
|
||||||
read inc_current
|
read bugfix
|
||||||
fi
|
fi
|
||||||
|
|
||||||
so_version=$(egrep '^so_version =' meson.build | cut -d'[' -f2- | cut -d']' -f1)
|
soversion=$(egrep '^soversion =' meson.build | cut -d'=' -f2-)
|
||||||
current=$(echo "$so_version" | cut -d',' -f1 | sed -e "s/'//g" -e "s/ //g")
|
soversion=$((soversion))
|
||||||
revision=$(echo "$so_version" | cut -d',' -f2 | sed -e "s/'//g" -e "s/ //g")
|
|
||||||
age=$(echo "$so_version" | cut -d',' -f3 | sed -e "s/'//g" -e "s/ //g")
|
|
||||||
|
|
||||||
if [ "$inc_age" = 'y' ]
|
if [ "$bugfix" != 'y' ]
|
||||||
then
|
then
|
||||||
age=$((age+1))
|
soversion=$((soversion+1))
|
||||||
current=$((current+1))
|
|
||||||
elif [ "$inc_current" = 'y' ]
|
|
||||||
then
|
|
||||||
current=$((current+1))
|
|
||||||
fi
|
fi
|
||||||
revision=$((revision+1))
|
|
||||||
|
|
||||||
sed -i meson.build \
|
sed -i meson.build \
|
||||||
-e "s/so_version = .*/so_version = ['$current', '$revision', '$age']/g"
|
-e "s/soversion = .*/soversion = $soversion/g"
|
||||||
|
|
||||||
|
exit 1
|
||||||
git add meson.build
|
git add meson.build
|
||||||
git commit -m "Update version to $new_version"
|
git commit -m "Update version to $new_version"
|
||||||
|
|
|
@ -4,9 +4,6 @@ version_data.set_quoted('WLR_VERSION_STR', meson.project_version())
|
||||||
version_data.set('WLR_VERSION_MAJOR', version_array[0])
|
version_data.set('WLR_VERSION_MAJOR', version_array[0])
|
||||||
version_data.set('WLR_VERSION_MINOR', version_array[1])
|
version_data.set('WLR_VERSION_MINOR', version_array[1])
|
||||||
version_data.set('WLR_VERSION_MICRO', version_array[2])
|
version_data.set('WLR_VERSION_MICRO', version_array[2])
|
||||||
version_data.set('WLR_VERSION_API_CURRENT', so_version[0])
|
|
||||||
version_data.set('WLR_VERSION_API_REVISION', so_version[1])
|
|
||||||
version_data.set('WLR_VERSION_API_AGE', so_version[2])
|
|
||||||
|
|
||||||
conf_h = configure_file(
|
conf_h = configure_file(
|
||||||
input: 'config.h.in',
|
input: 'config.h.in',
|
||||||
|
|
11
meson.build
11
meson.build
|
@ -11,10 +11,11 @@ project(
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
# Format of so_version is CURRENT, REVISION, AGE.
|
# When doing a major or minor release, *always* increase soversion. This isn't
|
||||||
# See: https://autotools.io/libtool/version.html
|
# necessary for bugfix releases. Increasing soversion is required because
|
||||||
# for a reference about clean library versioning.
|
# wlroots never guarantees ABI stability -- only API stability is guaranteed
|
||||||
so_version = ['5', '9', '1']
|
# between minor releases.
|
||||||
|
soversion = 5
|
||||||
|
|
||||||
add_project_arguments([
|
add_project_arguments([
|
||||||
'-DWLR_USE_UNSTABLE',
|
'-DWLR_USE_UNSTABLE',
|
||||||
|
@ -152,7 +153,7 @@ symbols_file = 'wlroots.syms'
|
||||||
symbols_flag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbols_file)
|
symbols_flag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbols_file)
|
||||||
lib_wlr = library(
|
lib_wlr = library(
|
||||||
meson.project_name(), wlr_files,
|
meson.project_name(), wlr_files,
|
||||||
version: '.'.join(so_version),
|
soversion: soversion,
|
||||||
dependencies: wlr_deps,
|
dependencies: wlr_deps,
|
||||||
include_directories: [wlr_inc, proto_inc],
|
include_directories: [wlr_inc, proto_inc],
|
||||||
install: true,
|
install: true,
|
||||||
|
|
Loading…
Reference in a new issue