Author Topic: Fail to build RPM  (Read 3180 times)


  • Moderator
  • Hero Member
  • *****
  • Posts: 3188
Re: Fail to build RPM
« Reply #15 on: August 08, 2016, 08:55:23 PM »
My apologies, I was bloody wrong, does work as advertised on top of

Code: [Select]
diff --git a/cmake/admMainChecks.cmake b/cmake/admMainChecks.cmake
index 58f6291..3d86ee2 100644
--- a/cmake/admMainChecks.cmake
+++ b/cmake/admMainChecks.cmake
@@ -131,7 +131,7 @@ MESSAGE(STATUS "****************")
-        admGetRevision( ${CMAKE_SOURCE_DIR} ADM_SUBVERSION)
+        admGetRevision( ${CMAKE_SOURCE_DIR}/.. ADM_SUBVERSION)

(currently it is still just one folder level too deep) and has a distinctly different result than the logic before the build modularisation:

Code: [Select]
find build* -name "*.spec" | xargs grep Release
buildCli/_CPack_Packages/Linux/RPM/SPECS/avidemux3-cli.spec:Release:        1.r160808_40a20a0265f.bootstrap
buildCore/_CPack_Packages/Linux/RPM/SPECS/avidemux3-core.spec:Release:        1.r160808_ed7aa6bdbff.bootstrap
buildPluginsCLI/_CPack_Packages/Linux/RPM/SPECS/avidemux3-plugins-CLI.spec:Release:        1.r160808_ed7aa6bdbff.bootstrap
buildPluginsCommon/_CPack_Packages/Linux/RPM/SPECS/avidemux3-plugins-COMMON.spec:Release:        1.r160808_ed7aa6bdbff.bootstrap
buildPluginsQt5/_CPack_Packages/Linux/RPM/SPECS/avidemux3-plugins-qt5.spec:Release:        1.r160808_ed7aa6bdbff.bootstrap
buildPluginsSettings/_CPack_Packages/Linux/RPM/SPECS/avidemux3-settings.spec:Release:        1.r160808_ed7aa6bdbff.bootstrap
buildQt5/_CPack_Packages/Linux/RPM/SPECS/avidemux3-qt5.spec:Release:        1.r160808_40a20a0265f.bootstrap

The git revision for the modules gets set to the latest git revision which touched their respective folder, not to the latest revision present in the repository as a whole. This is probably how it should work now.


  • Moderator
  • Hero Member
  • *****
  • Posts: 3188
Re: Fail to build RPM
« Reply #16 on: August 10, 2016, 10:53:20 PM »
It turned out to be that there was nothing wrong with admGetRevision() in cmake/admMainChecks.cmake, the failures should be attributed only to the checks in cmake/admGetRevision.cmake which is after still one folder level off when called from avidemux/{cli,qt4}/CMakeLists.txt, even when looking for ${_dir}/../.git.

Code: [Select]
diff --git a/cmake/admGetRevision.cmake b/cmake/admGetRevision.cmake
index 79fce16..849be72 100644
--- a/cmake/admGetRevision.cmake
+++ b/cmake/admGetRevision.cmake
@@ -9,15 +9,15 @@ if (EXISTS "${_dir}/.svn")
         Subversion_WC_INFO( ${_dir} ADM_SVN)
         SET(${_rev} ${ADM_SVN_WC_LAST_CHANGED_REV})
 else (EXISTS "${_dir}/.svn")
-        if (EXISTS "${_dir}/.git" OR EXISTS "${_dir}/../.git")
+        if (EXISTS "${_dir}/../.git" OR EXISTS "${_dir}/../../.git")
                 MESSAGE(STATUS "Seems to be git or git-svn...")
                 include( FindGitSvn)
                 admGetGitRevision( ${_dir} ADM_GIT_SVN_REVISION)
                 SET(${_rev} ${ADM_GIT_SVN_REVISION})
-        ELSE (EXISTS "${_dir}/.git" OR EXISTS "${_dir}/../.git")
+        ELSE (EXISTS "${_dir}/../.git" OR EXISTS "${_dir}/../../.git")
                 MESSAGE(STATUS "Dont know what SCM is used")
                 SET(${_rev} "0")
-        ENDIF (EXISTS "${_dir}/.git" OR EXISTS "${_dir}/../.git")
+        ENDIF (EXISTS "${_dir}/../.git" OR EXISTS "${_dir}/../../.git")
 endif (EXISTS "${_dir}/.svn")
                 #MESSAGE( STATUS "revision : ${${_rev}}" )
 ENDMACRO(admGetRevision _dir _rev)

gets it right, finally (I don't know why the tests for .svn are still there).

Ideally, the logic whould check if ${_dir}/../ already points to $AVIDEMUX_TOP_SOURCE_DIR and avoid going up one level in this case, but I can't say this in cmake.