From 7b6258f416cb9851c980665bae4b6b1cb2b072f8 Mon Sep 17 00:00:00 2001 From: Debian Multimedia Maintainers Date: Wed, 30 Aug 2023 11:52:26 +0200 Subject: [PATCH] Allow building without git installed Origin: Debian Bug: https://github.com/jacktrip/jacktrip/issues/1184 Last-Update: 2023-08-30 Upstream runs 'git' during configure to inject commit info into the binary. We don't have 'git' installed on our buildds. Last-Update: 2023-08-30 Gbp-Pq: Name build-without-git.patch --- meson.build | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index d4d2c94..6d22d33 100644 --- a/meson.build +++ b/meson.build @@ -36,12 +36,15 @@ if get_option('buildtype') == 'release' c_defines += ['-DNDEBUG'] endif -git_tags_cmd = run_command('git', 'describe', '--tags', check: false) -git_hash_cmd = run_command('git', 'rev-parse', '--short', 'HEAD', check: false) -if git_tags_cmd.returncode() == 0 and git_hash_cmd.returncode() == 0 +git = find_program('git', required: false) +if git.found() + git_tags_cmd = run_command(git, 'describe', '--tags', check: false) + git_hash_cmd = run_command(git, 'rev-parse', '--short', 'HEAD', check: false) + if git_tags_cmd.returncode() == 0 and git_hash_cmd.returncode() == 0 git_tags = git_tags_cmd.stdout().strip() git_hash = git_hash_cmd.stdout().strip() defines += ['-DJACKTRIP_BUILD_INFO=' + git_tags + '-' + git_hash] + endif endif src = [ 'src/DataProtocol.cpp', -- 2.30.2