Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: ajschult on August 07, 2016, 02:19:53 AM

Title: Fail to build RPM
Post by: ajschult on August 07, 2016, 02:19:53 AM
After the build updates, I'm unable to build RPMs (with --rpm).  I've attached the full .err file, which ends with

error: Directory not found: /home/andrew/build/avidemux/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/avidemux3-qt5-2.6.12-160806.x86_64/usr/include/avidemux/2.6/ADM_audioCodec

The directory does indeed not exist.  avidemux/2.6/ contains only qt5.  avidemux/2.6/qt5 contains

ADM_openGL
ADM_UIs
config.h
Title: Re: Fail to build RPM
Post by: Jan Gruuthuse on August 07, 2016, 05:19:47 AM
You have the developer libraries installed for audio codecs? List from ubuntu, don't know the equivalents of your system:

libaften-dev:          audio AC3 encoder - development files
libfaac-dev:           AAC audio encoder (development)
libfaad-dev:           freeware Advanced Audio Decoder - development files
libmp3lame-dev:        MP3 encoding library (development)
libasound2-dev:        shared library for ALSA applications -- development files
libdca-dev:            decoding library for DTS Coherent Acoustics streams (development)
libmad0-dev:           MPEG audio decoder development library
libogg-dev:            Ogg bitstream library development files
libopencore-amrnb-dev: Adaptive Multi Rate speech codec - development files
libopencore-amrwb-dev: Adaptive Multi-Rate - Wideband speech codec - development files
libopus-dev:           Opus codec library development files
libpulse-dev:          PulseAudio client development headers and libraries
libtwolame-dev:        MPEG Audio Layer 2 encoder (development files)
libvorbis-dev:         The Vorbis General Audio Compression Codec (development files)

Can't test any further (16.04.1) misses rpmbuild, 14.04 had this option.

You don't find a logbuildQT5 in your /tmp?
My understanding: that folder is being filled during the build with the needed components (rpm) to create the QT5 rpm installable?
Title: Re: Fail to build RPM
Post by: Jan Gruuthuse on August 07, 2016, 05:31:57 AM
After installing rpm, installing librpm-dev did not install rpm.
I could test further, rpm is building now.
this message is produced when building rpm:
error: Directory not found: /home/jan/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/avidemux3-qt5-2.6.12-160807.x86_64/usr/include/avidemux/2.6/ADM_audioCodec
    Directory not found: /home/jan/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/avidemux3-qt5-2.6.12-160807.x86_64/usr/include/avidemux/2.6/ADM_audioCodec
***
CPackRPM:Debug:    - /home/jan/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/rpmbuildavidemux3-qt5.out
CPackRPM:Debug: *** Building target platforms: x86_64
Building for target x86_64
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.FhfjXH
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.atVtFb
Processing files: avidemux3-qt5-2.6.12-1.r0.bootstrap.x86_64


RPM build errors:
***
CPack Error: Problem copying the package: /home/jan/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/avidemux3-qt5-2.6.12-160807.x86_64.rpm to /home/jan/avidemux2/buildQt5/avidemux3-qt5-2.6.12-160807.x86_64.rpm
CPack Error: Error when generating package: Avidemux_qt4
Makefile:97: recipe for target 'package' failed
make: *** [package] Error 1
** Failed at package**


with the same result as in the 1st post

Could this be an issue from ~/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/rpmbuildavidemux3-qt5.out
Processing files: avidemux3-qt5-2.6.12-1.r0.bootstrap.x86_64
Title: Re: Fail to build RPM
Post by: eumagga0x2a on August 07, 2016, 07:00:47 AM
Quote from: ajschult on August 07, 2016, 02:19:53 AM
After the build updates, I'm unable to build RPMs (with --rpm).

Yes, like in http://avidemux.org/smif/index.php/topic,16975.msg76038.html#msg76038 (http://avidemux.org/smif/index.php/topic,16975.msg76038.html#msg76038)

QuoteI've attached the full .err file, which ends with

error: Directory not found: /home/andrew/build/avidemux/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/avidemux3-qt5-2.6.12-160806.x86_64/usr/include/avidemux/2.6/ADM_audioCodec

The directory does indeed not exist.

The question is, why this directory gets included into the SPEC file for avidemux3-qt5 in the first place. avidemux3-qt5 should not own it.
Title: Re: Fail to build RPM
Post by: Jan Gruuthuse on August 07, 2016, 09:37:18 AM
after todays commits:
fc448bd   [common] Audiocodec is now in core
27c22d4   [build] Search lrelease-FLAVOR when lrelease is not there
c84e984   [build] Fedora style build all
Quote** Preparing debs **
Preparing packages
** debs directory ready **
total 10804
-rw-rw-r-- 1 jan jan 1594296 aug  7 11:33 avidemux3-cli-2.6.12-160807.x86_64.rpm
-rw-rw-r-- 1 jan jan 4900591 aug  7 11:33 avidemux3-core-2.6.12-160807.x86_64.rpm
-rw-rw-r-- 1 jan jan   53509 aug  7 11:33 avidemux3-plugins-CLI-2.6.12-160807.x86_64.rpm
-rw-rw-r-- 1 jan jan 1530746 aug  7 11:33 avidemux3-plugins-COMMON-2.6.12-160807.x86_64.rpm
-rw-rw-r-- 1 jan jan  371741 aug  7 11:33 avidemux3-plugins-qt5-2.6.12-160807.x86_64.rpm
-rw-rw-r-- 1 jan jan 2528345 aug  7 11:33 avidemux3-qt5-2.6.12-160807.x86_64.rpm
-rw-rw-r-- 1 jan jan   66766 aug  7 11:33 avidemux3-settings-2.6.12-160807.x86_64.rpm
** ALL DONE **
** The installable packages are in the debs folder **
Title: Re: Fail to build RPM
Post by: eumagga0x2a on August 07, 2016, 09:38:17 AM
RPM packaging confirmed fixed by https://github.com/mean00/avidemux2/commit/fc448bdca4de801785fc19730c770e642be202d0 (https://github.com/mean00/avidemux2/commit/fc448bdca4de801785fc19730c770e642be202d0), thanks.

BTW:

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/../common/ADM_audioCodec/include)

in avidemux/admAppSettings.cmake looks out of place, isn't it?
Title: Re: Fail to build RPM
Post by: ajschult on August 07, 2016, 03:03:43 PM
Right, the RPMs are built now, but their version is not quite happy,


# rpm -qp debs/avidemux3-qt5-2.6.12-160807.x86_64.rpm
avidemux3-qt5-2.6.12-1.r0.bootstrap.x86_64


that's coming from cmake/admCPackRpm.cmake,


SET(CPACK_RPM_PACKAGE_RELEASE "1.r${ADM_SUBVERSION}.bootstrap")


and ADM_SUBVERSION comes from cmake/admMainChecks.cmake


IF(RELEASE OR AVIDEMUX_EXTERNAL_BUILD)
        SET( ADM_SUBVERSION 0)
ELSE()
        admGetRevision( ${CMAKE_SOURCE_DIR} ADM_SUBVERSION)
ENDIF()


RELEASE is not set in cmake/avidemuxVersion.cmake, so I'm not sure what the issue is.
Title: Re: Fail to build RPM
Post by: eumagga0x2a on August 07, 2016, 05:21:03 PM
Quote from: ajschult on August 07, 2016, 03:03:43 PM
Right, the RPMs are built now, but their version is not quite happy,


# rpm -qp debs/avidemux3-qt5-2.6.12-160807.x86_64.rpm
avidemux3-qt5-2.6.12-1.r0.bootstrap.x86_64

I'm not sure ATM either:

for i in avidemux*.rpm; do echo -n $i:\ \  && rpm -qp $i; done
avidemux3-cli-2.6.12-160807.x86_64.rpm:  avidemux3-cli-2.6.12-1.r0.bootstrap.x86_64
avidemux3-core-2.6.12-160807.x86_64.rpm:  avidemux3-core-2.6.12-1.r160807_60937d79a0a.bootstrap.x86_64
avidemux3-plugins-CLI-2.6.12-160807.x86_64.rpm:  avidemux3-plugins-CLI-2.6.12-1.r160807_60937d79a0a.bootstrap.x86_64
avidemux3-plugins-COMMON-2.6.12-160807.x86_64.rpm:  avidemux3-plugins-COMMON-2.6.12-1.r160807_60937d79a0a.bootstrap.x86_64
avidemux3-plugins-qt5-2.6.12-160807.x86_64.rpm:  avidemux3-plugins-qt5-2.6.12-1.r160807_60937d79a0a.bootstrap.x86_64
avidemux3-qt5-2.6.12-160807.x86_64.rpm:  avidemux3-qt5-2.6.12-1.r0.bootstrap.x86_64
avidemux3-settings-2.6.12-160807.x86_64.rpm:  avidemux3-settings-2.6.12-1.r160807_60937d79a0a.bootstrap.x86_64


This is with

diff --git a/cmake/admMainChecks.cmake b/cmake/admMainChecks.cmake
index 58f6291..79dfed2 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)


as probably the source directory doesn't get set correctly.
Title: Re: Fail to build RPM
Post by: mean on August 07, 2016, 05:48:35 PM
yes, side effects of source split
Thanks
Title: Re: Fail to build RPM
Post by: mean on August 07, 2016, 05:50:07 PM
That will not work for all components though
Title: Re: Fail to build RPM
Post by: eumagga0x2a on August 07, 2016, 06:01:52 PM
Yes, it can't work because cli and qt reside one folder level deeper the core and plugins.
Title: Re: Fail to build RPM
Post by: eumagga0x2a on August 07, 2016, 06:52:36 PM
I have no idea whether it is ugly or not, but this fixes RPM version generation for me:

diff --git a/avidemux/cli/CMakeLists.txt b/avidemux/cli/CMakeLists.txt
index 67738ae..ae3c9da 100644
--- a/avidemux/cli/CMakeLists.txt
+++ b/avidemux/cli/CMakeLists.txt
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6)

SET(AVIDEMUX_API_VERSION 2.6)
SET(ADM_PROJECT Avidemux_cli)
+SET(AVIDEMUX_TOP_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../../)

MESSAGE("")
MESSAGE("#########################################")
diff --git a/avidemux/qt4/CMakeLists.txt b/avidemux/qt4/CMakeLists.txt
index ee0d936..2ce46a9 100644
--- a/avidemux/qt4/CMakeLists.txt
+++ b/avidemux/qt4/CMakeLists.txt
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 2.6)
SET(AVIDEMUX_API_VERSION 2.6)
SET(ADM_PROJECT Avidemux_qt4)
+SET(AVIDEMUX_TOP_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../../)

MESSAGE("")
MESSAGE("#########################################")
diff --git a/avidemux_plugins/CMakeLists.txt b/avidemux_plugins/CMakeLists.txt
index 0333abd..86fad1a 100644
--- a/avidemux_plugins/CMakeLists.txt
+++ b/avidemux_plugins/CMakeLists.txt
@@ -46,6 +46,7 @@ MESSAGE(STATUS "Found cmake subfolder.good.")
########################################
# Where is the top dir ?
########################################
+SET(AVIDEMUX_TOP_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../)

# Common definitions...
include(commonCmakeApplication)
diff --git a/cmake/admMainChecks.cmake b/cmake/admMainChecks.cmake
index 58f6291..2c8c604 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( ${AVIDEMUX_TOP_SOURCE_DIR} ADM_SUBVERSION)
ENDIF()
MESSAGE("")
include(avidemuxVersion)


With this patch I get:

find build* -name "*.spec" | xargs grep Release
buildCli/_CPack_Packages/Linux/RPM/SPECS/avidemux3-cli.spec:Release:        1.r160807_60937d79a0a.bootstrap
buildCore/_CPack_Packages/Linux/RPM/SPECS/avidemux3-core.spec:Release:        1.r160807_60937d79a0a.bootstrap
buildPluginsCLI/_CPack_Packages/Linux/RPM/SPECS/avidemux3-plugins-CLI.spec:Release:        1.r160807_60937d79a0a.bootstrap
buildPluginsCommon/_CPack_Packages/Linux/RPM/SPECS/avidemux3-plugins-COMMON.spec:Release:        1.r160807_60937d79a0a.bootstrap
buildPluginsQt5/_CPack_Packages/Linux/RPM/SPECS/avidemux3-plugins-qt5.spec:Release:        1.r160807_60937d79a0a.bootstrap
buildPluginsSettings/_CPack_Packages/Linux/RPM/SPECS/avidemux3-settings.spec:Release:        1.r160807_60937d79a0a.bootstrap
buildQt5/_CPack_Packages/Linux/RPM/SPECS/avidemux3-qt5.spec:Release:        1.r160807_60937d79a0a.bootstrap
Title: Re: Fail to build RPM
Post by: eumagga0x2a on August 08, 2016, 04:57:50 PM
I see now that my attempt at fixing the revision extraction partially reverts changes made in https://github.com/mean00/avidemux2/commit/fb4a0341c8f470a36741faa4fc2393125f8af143 (https://github.com/mean00/avidemux2/commit/fb4a0341c8f470a36741faa4fc2393125f8af143). Anyway, there is only one .git folder, so the modules must know how to get there to query the revision. Any working solution would serve not only RPM packaging but generally ensure that the git revision is shown in the GUI in the "Help" menu -> "About" even without any packaging (once I saw the CPack-generated *.spec files, I stopped using rpms and simply copied the content of the install/usr folder instead).

Just for the sake of correctness I attach a version of the same patch with a better chosen place for insertions and a short comment.
Title: Re: Fail to build RPM
Post by: eumagga0x2a on August 08, 2016, 06:16:00 PM
I'm sorry, but https://github.com/mean00/avidemux2/commit/493c06480278b65305cf684a4b426999086c4a33 (https://github.com/mean00/avidemux2/commit/493c06480278b65305cf684a4b426999086c4a33) doesn't fix the issue.

                 admGetGitRevision( ${_dir} ADM_GIT_SVN_REVISION)

${_dir} doesn't get set to the parent directory if the current doesn't contain a .git folder.

BTW, do you like the idea that a script tests the parent directory simply if there is no .git folder in the current? What if there is no .git directory in the top source directory on purpose? What if there is an unrelated .git folder in the parent of the Avidemux top source directory?
Title: Re: Fail to build RPM
Post by: mean on August 08, 2016, 07:10:28 PM
I dont like it, but i dislike also having to propagate the top folder from the top cmakelists
I'm open to ideas
Title: Re: Fail to build RPM
Post by: eumagga0x2a on August 08, 2016, 08:55:23 PM
My apologies, I was bloody wrong, https://github.com/mean00/avidemux2/commit/493c06480278b65305cf684a4b426999086c4a33.patch (https://github.com/mean00/avidemux2/commit/493c06480278b65305cf684a4b426999086c4a33.patch) does work as advertised on top of

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:

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.
Title: Re: Fail to build RPM
Post by: eumagga0x2a 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 (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.

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.