[gnome-photos/wip/rishi/no-git-release-builds] build: Avoid requiring Git for release tarballs
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/no-git-release-builds] build: Avoid requiring Git for release tarballs
- Date: Sat, 13 Oct 2018 13:00:52 +0000 (UTC)
commit e9e5cb3ad19865b319fb7a86670b06f7fbe1c32d
Author: Debarshi Ray <debarshir gnome org>
Date: Sat Oct 13 14:23:21 2018 +0200
build: Avoid requiring Git for release tarballs
It's a tad nicer to not require Git when building release tarballs.
While Git is definitely widely available, it's just one more that would
have to be installed in the buildroots. Therefore, use of Git is
avoided for 'plain' builds.
meson.build | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/meson.build b/meson.build
index 3f6e1552..a0fdc369 100644
--- a/meson.build
+++ b/meson.build
@@ -30,10 +30,17 @@ po_dir = join_paths(source_root, 'po')
top_inc = include_directories('.')
-git = find_program('git')
+photos_commit_id = ''
if not photos_buildtype.contains('plain')
+ git = find_program('git')
+
run_command(git, '-C', source_root, 'submodule', 'sync', '--recursive')
run_command(git, '-C', source_root, 'submodule', 'update', '--init', '--recursive')
+
+ res = run_command(git, '-C', source_root, 'describe')
+ if res.returncode() == 0
+ photos_commit_id = res.stdout().strip()
+ endif
endif
cc = meson.get_compiler('c')
@@ -44,9 +51,8 @@ config_h.set_quoted('PACKAGE_TARNAME', meson.project_name())
config_h.set_quoted('PACKAGE_URL', 'https://wiki.gnome.org/Apps/Photos')
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
-res = run_command(git, '-C', source_root, 'describe')
-if res.returncode() == 0
- config_h.set_quoted('PACKAGE_COMMIT_ID', res.stdout().strip())
+if photos_commit_id != ''
+ config_h.set_quoted('PACKAGE_COMMIT_ID', photos_commit_id)
endif
config_h.set_quoted('G_LOG_DOMAIN', meson.project_name())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]