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

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2632
Re: Fail to build RPM
« Reply #15 on: August 08, 2016, 08:55:23 PM »
My apologies, I was bloody wrong, https://github.com/mean00/avidemux2/commit/493c06480278b65305cf684a4b426999086c4a33.patch 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 "****************")
 IF(RELEASE OR AVIDEMUX_EXTERNAL_BUILD)
         SET( ADM_SUBVERSION 0)
 ELSE()
-        admGetRevision( ${CMAKE_SOURCE_DIR} ADM_SUBVERSION)
+        admGetRevision( ${CMAKE_SOURCE_DIR}/.. ADM_SUBVERSION)
 ENDIF()
 MESSAGE("")
 include(avidemuxVersion)

(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.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2632
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 https://github.com/mean00/avidemux2/commit/493c06480278b65305cf684a4b426999086c4a33 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.