diff options
-rw-r--r-- | meson.build | 28 | ||||
-rw-r--r-- | source/rofi.c | 7 | ||||
m--------- | subprojects/libnkutils | 0 |
3 files changed, 15 insertions, 20 deletions
diff --git a/meson.build b/meson.build index 8f53d42a..64be4b37 100644 --- a/meson.build +++ b/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('_GNU_SOURCE', true) -git = find_program('git', required: false) -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('USE_NK_GIT_VERSION', true) header_conf.set('ENABLE_DRUN', get_option('enable-drun')) 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) -nk_modules = [ +nk_options = [ 'bindings=true', 'xdg-theme=true', + 'git-root=@0@'.format(join_paths(meson.source_root(), '.git')), ] -nk = subproject('libnkutils', default_options: nk_modules) -nk_options = nk.get_variable('nk_options') -foreach o : nk_modules + nk_options - if not nk_modules.contains(o) or not nk_options.contains(o) - error('You must not change libnkutils options @0@ != @1@'.format('|'.join(nk_modules), '|'.join(nk_options))) +nk = subproject('libnkutils', default_options: nk_options) +nk_subproject_options = nk.get_variable('nk_options') +foreach o : nk_options + nk_subproject_options + 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_options), '|'.join(nk_subproject_options))) endif endforeach deps += nk.get_variable('libnkutils') diff --git a/source/rofi.c b/source/rofi.c index ada5b76d..d4b31ad8 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -45,6 +45,13 @@ #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 "display.h" diff --git a/subprojects/libnkutils b/subprojects/libnkutils -Subproject fa369c09a2d341f2cb9c9935a7291ea38384046 +Subproject d10bf44787e80f3df5132637b934ec75dc347a1 |