Add patch to allow building without 'git' installed
authorIOhannes m zmölnig (Debian/GNU) <umlaeute@debian.org>
Wed, 30 Aug 2023 08:25:47 +0000 (10:25 +0200)
committerIOhannes m zmölnig (Debian/GNU) <umlaeute@debian.org>
Wed, 30 Aug 2023 08:26:22 +0000 (10:26 +0200)
debian/patches/build-without-git.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/build-without-git.patch b/debian/patches/build-without-git.patch
new file mode 100644 (file)
index 0000000..ea88a3f
--- /dev/null
@@ -0,0 +1,30 @@
+Description: Allow building without git installed
+ Upstream runs 'git' during configure to inject commit info into the binary.
+ We don't have 'git' installed on our buildds.
+Author: IOhannes m zmölnig
+Origin: Debian
+Bug: https://github.com/jacktrip/jacktrip/issues/1184
+Last-Update: 2023-08-30
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- jacktrip.orig/meson.build
++++ jacktrip/meson.build
+@@ -36,12 +36,15 @@
+       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',
index 0d8f1eeb376a6eca67dd4b6f6f3d1fdbb709a602..508f6e07d8dc113f09e810ae4416251ca37a831d 100644 (file)
@@ -1 +1,2 @@
+build-without-git.patch
 gui-launcher.patch