[packages/wayfire] upstream patch to ignore unsuccessful git commands

atler atler at pld-linux.org
Sat Oct 14 13:25:13 CEST 2023


commit 5590ce12bae0620ff7f86b4d102878eeea0eb9c3
Author: Jan Palus <atler at pld-linux.org>
Date:   Sat Oct 14 13:23:45 2023 +0200

    upstream patch to ignore unsuccessful git commands

 no-git-check.patch | 27 +++++++++++++++++++++++++++
 wayfire.spec       |  2 ++
 2 files changed, 29 insertions(+)
---
diff --git a/wayfire.spec b/wayfire.spec
index 61e7d6b..83ca680 100644
--- a/wayfire.spec
+++ b/wayfire.spec
@@ -10,6 +10,7 @@ License:	MIT
 Group:		Applications
 Source0:	https://github.com/WayfireWM/wayfire/releases/download/v%{version}/%{name}-%{version}.tar.xz
 # Source0-md5:	36e88c89c0be0e6af725ecab15049ecb
+Patch0:		no-git-check.patch
 URL:		https://wayfire.org/
 BuildRequires:	EGL-devel
 BuildRequires:	GLM >= 0.9.9.9
@@ -94,6 +95,7 @@ Static wayfire libraries.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %meson build \
diff --git a/no-git-check.patch b/no-git-check.patch
new file mode 100644
index 0000000..ab2c740
--- /dev/null
+++ b/no-git-check.patch
@@ -0,0 +1,27 @@
+From 515603f2ff5e0a342679119d0995bf49abfc3f62 Mon Sep 17 00:00:00 2001
+From: Scott Moreau <oreaus at gmail.com>
+Date: Sat, 7 Oct 2023 11:42:02 -0600
+Subject: [PATCH] build: Tell meson to ignore the return value of git commands
+
+We grab the commit hash and branch name for use in the log,
+but this does not work when building from a tarball. Tell meson
+to ignore the return value by setting 'check: false' for git commands.
+---
+ meson.build | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 85993a190..eb2733cad 100644
+--- a/meson.build
++++ b/meson.build
+@@ -86,8 +86,8 @@ conf_data = configuration_data()
+ version = '"@0@"'.format(meson.project_version())
+ git = find_program('git', native: true, required: false)
+ if git.found()
+-	git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'], check: true)
+-	git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'], check: true)
++	git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'], check: false)
++	git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'], check: false)
+ 	if git_commit.returncode() == 0 and git_branch.returncode() == 0
+ 		version = '"@0 at -@1@ (" __DATE__ ", branch \'@2@\')"'.format(
+ 			meson.project_version(),
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/wayfire.git/commitdiff/5590ce12bae0620ff7f86b4d102878eeea0eb9c3



More information about the pld-cvs-commit mailing list