mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-26 21:58:08 +01:00
Set version in project file
Let's set the version in the meson file instead of declaring it outside. In case git is installed we use the git hash as version. Instead it isn't (like on a clean build system), let's use the version defined in the project.
This commit is contained in:
parent
478b128c26
commit
77587ee632
2 changed files with 4 additions and 9 deletions
12
meson.build
12
meson.build
|
@ -1,6 +1,7 @@
|
||||||
project(
|
project(
|
||||||
'sway',
|
'sway',
|
||||||
'c',
|
'c',
|
||||||
|
version: '1.0',
|
||||||
license: 'MIT',
|
license: 'MIT',
|
||||||
meson_version: '>=0.48.0',
|
meson_version: '>=0.48.0',
|
||||||
default_options: [
|
default_options: [
|
||||||
|
@ -127,17 +128,12 @@ endif
|
||||||
|
|
||||||
add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
|
add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
|
||||||
|
|
||||||
version = get_option('sway-version')
|
if git.found()
|
||||||
if version != ''
|
|
||||||
version = '"@0@"'.format(version)
|
|
||||||
else
|
|
||||||
if not git.found()
|
|
||||||
error('git is required to make the version string')
|
|
||||||
endif
|
|
||||||
|
|
||||||
git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags']).stdout().strip()
|
git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags']).stdout().strip()
|
||||||
git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip()
|
git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip()
|
||||||
version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch)
|
version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch)
|
||||||
|
else
|
||||||
|
version = '"@0@"'.format(meson.project_version())
|
||||||
endif
|
endif
|
||||||
add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
|
add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
option('sway-version', type : 'string', description: 'The version string reported in `sway --version`.')
|
|
||||||
option('default-wallpaper', type: 'boolean', value: true, description: 'Install the default wallpaper.')
|
option('default-wallpaper', type: 'boolean', value: true, description: 'Install the default wallpaper.')
|
||||||
option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.')
|
option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.')
|
||||||
option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.')
|
option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.')
|
||||||
|
|
Loading…
Reference in a new issue