[packages/domoticz] - don't require git to build, all those commands are noop

baggins baggins at pld-linux.org
Sat Jun 6 12:20:57 CEST 2020


commit d051ba149786400e7eb5fe13edf037b60ae1dd34
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sat Jun 6 12:20:28 2020 +0200

    - don't require git to build, all those commands are noop

 domoticz.spec |   2 ++
 no-git.patch  | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 109 insertions(+)
---
diff --git a/domoticz.spec b/domoticz.spec
index 72aa9fe..ec03add 100644
--- a/domoticz.spec
+++ b/domoticz.spec
@@ -18,6 +18,7 @@ Patch3:		%{name}-openzwave.patch
 Patch4:		%{name}-openzwave-Dev.patch
 # Fix python detection (https://github.com/domoticz/domoticz/pull/1749)
 Patch5:		%{name}-python.patch
+Patch6:		no-git.patch
 BuildRequires:	boost-devel
 BuildRequires:	cereal-devel
 BuildRequires:	cmake
@@ -87,6 +88,7 @@ echo "#define APPDATE ${APPDATE}" >> appversion.h
 %patch3 -p1 -b.openzwave
 #%patch4 -p1 -b.openzwave-Dev
 %patch5 -p1 -b.python
+%patch6 -p1
 
 rm -f hardware/openzwave/*.h
 rm -rf hardware/openzwave/aes
diff --git a/no-git.patch b/no-git.patch
new file mode 100644
index 0000000..6c7586c
--- /dev/null
+++ b/no-git.patch
@@ -0,0 +1,107 @@
+--- domoticz-2020.2/CMakeLists.txt.orig	2020-06-06 12:02:05.000000000 +0200
++++ domoticz-2020.2/CMakeLists.txt	2020-06-06 12:19:29.867654435 +0200
+@@ -88,40 +88,13 @@
+   ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/History.txt)
+ ENDMACRO(History_GET_REVISION)
+ 
+-MACRO(Gitversion_GET_REVISION dir variable)
+-  EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} --git-dir ./.git rev-list HEAD --count
+-    WORKING_DIRECTORY ${dir}
+-    OUTPUT_VARIABLE ${variable}
+-    OUTPUT_STRIP_TRAILING_WHITESPACE)
+-ENDMACRO(Gitversion_GET_REVISION)
+-
+ find_package(Git QUIET)
+ 
+-Gitversion_GET_REVISION("${CMAKE_SOURCE_DIR}" ProjectRevision)
+-IF(NOT ProjectRevision)
+-  MESSAGE(STATUS "Failed to get ProjectRevision from git")
+-  History_GET_REVISION(ProjectRevision)
+-ELSE(NOT ProjectRevision)
+-  MATH(EXPR ProjectRevision "${ProjectRevision}+2107")
+-ENDIF(NOT ProjectRevision)
+-
++History_GET_REVISION(ProjectRevision)
+ 
+ ### SUBMODULE / BUNDLED SOFTWARE
+ #
+ #
+-if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
+-# Update submodules as needed
+-    if(GIT_SUBMODULE)
+-        message(STATUS "Submodule update")
+-    execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
+-                        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+-                        RESULT_VARIABLE GIT_SUBMOD_RESULT)
+-        if(NOT GIT_SUBMOD_RESULT EQUAL "0")
+-            message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
+-        endif()
+-    endif()
+-endif()
+-
+ if(USE_BUILTIN_JSONCPP AND NOT EXISTS "${PROJECT_SOURCE_DIR}/extern/jsoncpp/CMakeLists.txt")
+   message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
+ endif()
+--- domoticz-2020.2/getgit.cmake.orig	2020-04-26 15:49:25.000000000 +0200
++++ domoticz-2020.2/getgit.cmake	2020-06-06 12:19:42.567678153 +0200
+@@ -23,55 +23,11 @@
+   ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/History.txt)
+ ENDMACRO(History_GET_REVISION)
+ 
+-MACRO(Gitversion_GET_REVISION dir variable)
+-  EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} --git-dir ./.git rev-list HEAD --count
+-    WORKING_DIRECTORY ${dir}
+-    OUTPUT_VARIABLE ${variable}
+-    OUTPUT_STRIP_TRAILING_WHITESPACE)
+-ENDMACRO(Gitversion_GET_REVISION)
+-
+-MACRO(Gitversion_GET_HASH dir variable)
+-  EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} --git-dir ./.git rev-parse --short HEAD
+-    WORKING_DIRECTORY ${dir}
+-    OUTPUT_VARIABLE ${variable}
+-    OUTPUT_STRIP_TRAILING_WHITESPACE)
+-ENDMACRO(Gitversion_GET_HASH)
+-
+-MACRO(Gitversion_GET_DATE dir variable)
+-  EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} --git-dir ./.git show -s --format=%ct
+-    WORKING_DIRECTORY ${dir}
+-    OUTPUT_VARIABLE ${variable}
+-    OUTPUT_STRIP_TRAILING_WHITESPACE)
+-ENDMACRO(Gitversion_GET_DATE)
+-
+-MACRO(Gitversion_CHECK_DIRTY dir variable)
+-  EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} --git-dir ./.git diff-index -m --name-only HEAD
+-    WORKING_DIRECTORY ${dir}
+-    OUTPUT_VARIABLE ${variable}
+-    OUTPUT_STRIP_TRAILING_WHITESPACE)
+-ENDMACRO(Gitversion_CHECK_DIRTY)
+-
+-Gitversion_GET_REVISION("${SOURCE_DIR}" ProjectRevision)
+-IF(NOT ProjectRevision)
+-  History_GET_REVISION(ProjectRevision)
+-ELSE(NOT ProjectRevision)
+-  MATH(EXPR ProjectRevision "${ProjectRevision}+2107")
+-ENDIF(NOT ProjectRevision)
+-Gitversion_GET_HASH("${SOURCE_DIR}" ProjectHash)
+-IF(NOT ProjectHash)
+-  MESSAGE(STATUS "Failed to get ProjectHash from git, set it to 0")
+-  set (ProjectHash 0)
+-ENDIF(NOT ProjectHash)
+-Gitversion_GET_DATE("${SOURCE_DIR}" ProjectDate)
+-IF(NOT ProjectDate)
+-  MESSAGE(STATUS "Failed to get ProjectDate from git, set it to 0")
+-  set (ProjectDate 0)
+-ENDIF(NOT ProjectDate)
+-Gitversion_CHECK_DIRTY("${SOURCE_DIR}" ProjectDirty)
+-IF(ProjectDirty)
+-  MESSAGE(STATUS "domoticz has been modified locally: adding \"-modified\" to hash")
+-  set (ProjectHash "${ProjectHash}-modified")
+-ENDIF(ProjectDirty)
++History_GET_REVISION(ProjectRevision)
++MESSAGE(STATUS "Failed to get ProjectHash from git, set it to 0")
++set (ProjectHash 0)
++MESSAGE(STATUS "Failed to get ProjectDate from git, set it to 0")
++set (ProjectDate 0)
+ 
+ # write a file with the APPVERSION define
+ file(WRITE ${SOURCE_DIR}/appversion.h.txt "#define APPVERSION ${ProjectRevision}\n#define APPHASH \"${ProjectHash}\"\n#define APPDATE ${ProjectDate}\n")
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/domoticz.git/commitdiff/d051ba149786400e7eb5fe13edf037b60ae1dd34



More information about the pld-cvs-commit mailing list