meson: Check for repository with python (not git executable)
authorBruno Lopes <brunvonlope@outlook.com>
Thu, 11 Dec 2025 13:48:39 +0000 (10:48 -0300)
committerJeremy Bícha <jbicha@ubuntu.com>
Sun, 14 Dec 2025 02:02:40 +0000 (21:02 -0500)
Closes: #114
As per line 415 of the Meson file, git is not a mandatory dep.

(cherry picked from commit 4efc8b827e008417c4995a93ae3310697318cfab)

Origin: upstream, after 0.1.118

Gbp-Pq: Name meson-Check-for-repository-with-python-not-git-executable.patch

meson.build

index 8206d36861b049a2a41a8507b72cdec1e7551653..387ed629c283923bb09f30f68a852d894cd84732 100644 (file)
@@ -497,11 +497,9 @@ configure_file(
 # updated. If git is not available, don't do anything if git-version.h
 # already exists because then we are probably working with a tarball
 # in which case the git-version.h we ship is correct.
-is_git_repository = run_command(
-    git_bin,
-    'rev-parse',
-    '--is-inside-work-tree',
-    check: false,
+is_git_repository = run_command(python, '-c',
+  'import sys,os; sys.exit(0 if os.path.exists(".git") else 1)',
+  check: false
 ).returncode() == 0
 
 has_version_h = run_command(python, '-c',