Changes of Revision 6

obs-studio.spec Changed
x
 
1
@@ -7,6 +7,8 @@
2
 License:        GPL-2.0
3
 URL:            https://obsproject.com/
4
 Source:         %{name}-%{version}.tar.xz
5
+# PATCH-FIX-OPENSUSE obs-studio-allow-OBS_VERSION-to-be-set.patch jimmy@boombatower.com -- Allow OBS_VERSION to be set to assist in packaging.
6
+Patch0:         obs-studio-allow-OBS_VERSION-to-be-set.patch
7
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-build
8
 
9
 BuildRequires:  cmake
10
@@ -39,6 +41,7 @@
11
 
12
 %prep
13
 %setup -q
14
+%patch0 -p1
15
 
16
 %build
17
 mkdir -p build && cd build
18
obs-studio-allow-OBS_VERSION-to-be-set.patch Added
47
 
1
@@ -0,0 +1,45 @@
2
+From 0245e3b43ed3c48871522cd7720b78673415ddb8 Mon Sep 17 00:00:00 2001
3
+From: Jimmy Berry <jimmy@boombatower.com>
4
+Date: Fri, 30 Jan 2015 14:04:54 -0600
5
+Subject: [PATCH] Allow OBS_VERSION to be set to assist in packaging.
6
+
7
+---
8
+ cmake/Modules/ObsCpack.cmake | 20 +++++++++++++-------
9
+ 1 file changed, 13 insertions(+), 7 deletions(-)
10
+
11
+diff --git a/cmake/Modules/ObsCpack.cmake b/cmake/Modules/ObsCpack.cmake
12
+index cb5e85a..6de6019 100644
13
+--- a/cmake/Modules/ObsCpack.cmake
14
++++ b/cmake/Modules/ObsCpack.cmake
15
+@@ -14,15 +14,21 @@ set(CPACK_PACKAGE_VERSION_MINOR "0")
16
+ set(CPACK_PACKAGE_VERSION_PATCH "1")
17
+ set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
18
+ 
19
+-if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
20
+-  execute_process(COMMAND git describe --always --tags --dirty=-modified
21
+-      OUTPUT_VARIABLE OBS_VERSION
22
+-      WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
23
+-      OUTPUT_STRIP_TRAILING_WHITESPACE)
24
+-else()
25
+-  set(OBS_VERSION "${CPACK_PACKAGE_VERSION}")
26
++if(NOT DEFINED OBS_VERSION)
27
++  if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
28
++      execute_process(COMMAND git describe --always --tags --dirty=-modified
29
++          OUTPUT_VARIABLE OBS_VERSION
30
++          WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
31
++          OUTPUT_STRIP_TRAILING_WHITESPACE)
32
++  endif()
33
++
34
++  # Fallback to static version when git is either not available or fails.
35
++  if("${OBS_VERSION}" STREQUAL "")
36
++      set(OBS_VERSION "${CPACK_PACKAGE_VERSION}")
37
++  endif()
38
+ endif()
39
+ 
40
++MESSAGE(STATUS "OBS_VERSION: ${OBS_VERSION}")
41
+ 
42
+ if(INSTALLER_RUN)
43
+   set(CPACK_PACKAGE_EXECUTABLES
44
+-- 
45
+2.1.4
46
+
47