mirror of
https://github.com/lbonn/rofi
synced 2025-02-18 13:58:30 +00:00
meson: Use libnkutils git-version support
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
parent
743b393f15
commit
8deedd8645
3 changed files with 16 additions and 21 deletions
28
meson.build
28
meson.build
|
@ -76,20 +76,7 @@ header_conf.set_quoted('PACKAGE_URL', 'https://reddit.com/r/qtools/')
|
||||||
header_conf.set('THEME_CONVERTER', true)
|
header_conf.set('THEME_CONVERTER', true)
|
||||||
header_conf.set('_GNU_SOURCE', true)
|
header_conf.set('_GNU_SOURCE', true)
|
||||||
|
|
||||||
git = find_program('git', required: false)
|
header_conf.set('USE_NK_GIT_VERSION', true)
|
||||||
if git.found()
|
|
||||||
git_version = run_command(git, '--git-dir', join_paths(meson.source_root(), '.git'), 'describe', '--tags', '--always', '--dirty')
|
|
||||||
git_branch = run_command(git, '--git-dir', join_paths(meson.source_root(), '.git'), 'describe', '--tags', '--always', '--all')
|
|
||||||
if git_version.returncode() == 0 and git_branch.returncode() == 0
|
|
||||||
git_branch_parts = []
|
|
||||||
foreach b : git_branch.stdout().strip().split('/')
|
|
||||||
if b != 'heads'
|
|
||||||
git_branch_parts += b
|
|
||||||
endif
|
|
||||||
endforeach
|
|
||||||
header_conf.set_quoted('GIT_VERSION', '@0@ - @1@ (@2@)'.format(meson.project_version(), git_version.stdout().strip(), '/'.join(git_branch_parts)))
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
header_conf.set('ENABLE_DRUN', get_option('enable-drun'))
|
header_conf.set('ENABLE_DRUN', get_option('enable-drun'))
|
||||||
header_conf.set('WINDOW_MODE', get_option('enable-window'))
|
header_conf.set('WINDOW_MODE', get_option('enable-window'))
|
||||||
|
@ -102,15 +89,16 @@ header_conf.set_quoted('THEME_DIR', themedir)
|
||||||
|
|
||||||
config_h = configure_file(output: 'config.h', configuration: header_conf)
|
config_h = configure_file(output: 'config.h', configuration: header_conf)
|
||||||
|
|
||||||
nk_modules = [
|
nk_options = [
|
||||||
'bindings=true',
|
'bindings=true',
|
||||||
'xdg-theme=true',
|
'xdg-theme=true',
|
||||||
|
'git-root=@0@'.format(join_paths(meson.source_root(), '.git')),
|
||||||
]
|
]
|
||||||
nk = subproject('libnkutils', default_options: nk_modules)
|
nk = subproject('libnkutils', default_options: nk_options)
|
||||||
nk_options = nk.get_variable('nk_options')
|
nk_subproject_options = nk.get_variable('nk_options')
|
||||||
foreach o : nk_modules + nk_options
|
foreach o : nk_options + nk_subproject_options
|
||||||
if not nk_modules.contains(o) or not nk_options.contains(o)
|
if not nk_options.contains(o) or not nk_subproject_options.contains(o)
|
||||||
error('You must not change libnkutils options @0@ != @1@'.format('|'.join(nk_modules), '|'.join(nk_options)))
|
error('You must not change libnkutils options @0@ != @1@'.format('|'.join(nk_options), '|'.join(nk_subproject_options)))
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
deps += nk.get_variable('libnkutils')
|
deps += nk.get_variable('libnkutils')
|
||||||
|
|
|
@ -45,6 +45,13 @@
|
||||||
|
|
||||||
#include <libgwater-xcb.h>
|
#include <libgwater-xcb.h>
|
||||||
|
|
||||||
|
#ifdef USE_NK_GIT_VERSION
|
||||||
|
#include "nkutils-git-version.h"
|
||||||
|
#ifdef NK_GIT_VERSION
|
||||||
|
#define GIT_VERSION NK_GIT_VERSION
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "rofi.h"
|
#include "rofi.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit fa369c09a2d341f2cb9c9935a7291ea383840460
|
Subproject commit d10bf44787e80f3df5132637b934ec75dc347a1b
|
Loading…
Add table
Reference in a new issue