up Avidemux to 2.8.0

This commit is contained in:
Kolan Sh 2022-03-20 05:21:08 +03:00
parent 2cc1172f57
commit a959e6cd62
9 changed files with 452 additions and 6 deletions

View File

@ -0,0 +1,99 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_MAKEFILE_GENERATOR="emake"
inherit cmake flag-o-matic toolchain-funcs
DESCRIPTION="Core libraries for simple video cutting, filtering and encoding tasks"
HOMEPAGE="http://fixounet.free.fr/avidemux"
SRC_URI="https://github.com/mean00/avidemux2/archive/${PV}.tar.gz -> avidemux-${PV}.tar.gz"
# Multiple licenses because of all the bundled stuff.
LICENSE="GPL-1 GPL-2 MIT PSF-2 public-domain"
SLOT="2.7"
KEYWORDS="~amd64 ~x86"
IUSE="debug nls nvenc sdl system-ffmpeg vaapi vdpau xv"
# Trying to use virtual; ffmpeg misses aac,cpudetection USE flags now though, are they needed?
DEPEND="
dev-db/sqlite:3
nvenc? ( media-video/nvidia_video_sdk )
sdl? ( media-libs/libsdl:0 )
system-ffmpeg? ( >=media-video/ffmpeg-9:0[mp3,theora] )
vaapi? ( x11-libs/libva:0= )
vdpau? ( x11-libs/libvdpau:0 )
xv? ( x11-libs/libXv:0 )
"
RDEPEND="
${DEPEND}
!<media-libs/avidemux-core-${PV}
!<media-video/avidemux-${PV}
nls? ( virtual/libintl:0 )
"
BDEPEND="
virtual/pkgconfig
nls? ( sys-devel/gettext )
!system-ffmpeg? ( dev-lang/yasm[nls=] )
"
PATCHES=( "${FILESDIR}"/avidemux-core-2.7.6-ffmpeg-flags.patch )
S="${WORKDIR}/avidemux2-${PV}"
CMAKE_USE_DIR="${S}/${PN/-/_}"
src_prepare() {
cmake_src_prepare
if use system-ffmpeg ; then
# Preparations to support the system ffmpeg. Currently fails because
# it depends on files the system ffmpeg doesn't install.
local error="Failed to remove bundled ffmpeg."
rm -r cmake/admFFmpeg* cmake/ffmpeg* avidemux_core/ffmpeg_package buildCore/ffmpeg || die "${error}"
sed -e 's/include(admFFmpegUtil)//g' -e '/registerFFmpeg/d' -i avidemux/commonCmakeApplication.cmake || die "${error}"
sed -e 's/include(admFFmpegBuild)//g' -i avidemux_core/CMakeLists.txt || die "${error}"
else
local ffmpeg_args=(
--cc=$(tc-getCC)
--cxx=$(tc-getCXX)
--ar=$(tc-getAR)
--nm=$(tc-getNM)
--ranlib=$(tc-getRANLIB)
"--optflags='${CFLAGS}'"
)
sed -i -e "s/@@GENTOO_FFMPEG_FLAGS@@/${ffmpeg_args[*]}/" cmake/ffmpeg_configure.sh.cmake || die
fi
}
src_configure() {
# See bug 432322.
use x86 && replace-flags -O0 -O1
# Bug 768210
append-cxxflags -std=gnu++14
local mycmakeargs=(
-DAVIDEMUX_SOURCE_DIR='${S}'
-DGETTEXT="$(usex nls)"
-DNVENC="$(usex nvenc)"
-DSDL="$(usex sdl)"
-DLIBVA="$(usex vaapi)"
-DVDPAU="$(usex vdpau)"
-DXVIDEO="$(usex xv)"
)
use debug && mycmakeargs+=( -DVERBOSE=1 -DADM_DEBUG=1 )
cmake_src_configure
}
src_compile() {
cmake_src_compile
}
src_install() {
cmake_src_install
}

View File

@ -0,0 +1,8 @@
--- a/cmake/ffmpeg_configure.sh.cmake
+++ b/cmake/ffmpeg_configure.sh.cmake
@@ -1,2 +1,2 @@
export PATH=${FF_ENV_PATH}:$PATH
-${FFMPEG_SOURCE_DIR}/configure ${FFMPEG_FLAGS}
\ No newline at end of file
+${FFMPEG_SOURCE_DIR}/configure ${FFMPEG_FLAGS} @@GENTOO_FFMPEG_FLAGS@@
\ No newline at end of file

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>media-video@gentoo.org</email>
@ -10,6 +10,6 @@
<flag name="system-ffmpeg">Use the ffmpeg provided by the system.</flag>
</use>
<upstream>
<remote-id type="sourceforge">avidemux</remote-id>
<remote-id type="github">mean00/avidemux2</remote-id>
</upstream>
</pkgmetadata>

View File

@ -0,0 +1,166 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_MAKEFILE_GENERATOR="emake"
PYTHON_COMPAT=( python3_{8..10} )
inherit cmake flag-o-matic python-single-r1
DESCRIPTION="Plugins for the video editor media-video/avidemux"
HOMEPAGE="http://fixounet.free.fr/avidemux"
SRC_URI="https://github.com/mean00/avidemux2/archive/${PV}.tar.gz -> avidemux-${PV}.tar.gz"
# Multiple licenses because of all the bundled stuff.
LICENSE="GPL-1 GPL-2 MIT PSF-2 public-domain"
SLOT="2.7"
IUSE="a52 aac aften alsa amr dcaenc debug dts fdk fontconfig fribidi jack lame libsamplerate cpu_flags_x86_mmx nvenc opengl opus oss pulseaudio qt5 truetype twolame vdpau vorbis vpx x264 x265 xv xvid"
KEYWORDS="~amd64 ~x86"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
# dev-lang/spidermonkey is not required anymore
# see https://github.com/mean00/avidemux2/blob/master/avidemux_plugins/ADM_scriptEngines/CMakeLists.txt
COMMON_DEPEND="
${PYTHON_DEPS}
~media-libs/avidemux-core-${PV}:${SLOT}[vdpau?]
~media-video/avidemux-${PV}:${SLOT}[opengl?,qt5?]
dev-libs/libxml2:2
media-libs/a52dec
media-libs/libass:0=
media-libs/libmad
media-libs/libmp4v2
media-libs/libpng:0=
virtual/libiconv
aac? (
media-libs/faac
media-libs/faad2
)
aften? ( media-libs/aften )
alsa? ( media-libs/alsa-lib )
amr? ( media-libs/opencore-amr )
dcaenc? ( media-sound/dcaenc )
dts? ( media-libs/libdca )
fdk? ( media-libs/fdk-aac:0= )
fontconfig? ( media-libs/fontconfig:1.0 )
fribidi? ( dev-libs/fribidi )
jack? (
virtual/jack
libsamplerate? ( media-libs/libsamplerate )
)
lame? ( media-sound/lame )
nvenc? ( amd64? ( media-video/nvidia_video_sdk ) )
opus? ( media-libs/opus )
pulseaudio? ( media-sound/pulseaudio )
qt5? (
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtwidgets:5
)
truetype? ( media-libs/freetype:2 )
twolame? ( media-sound/twolame )
vorbis? ( media-libs/libvorbis )
vpx? ( media-libs/libvpx:0= )
x264? ( media-libs/x264:0= )
x265? ( media-libs/x265:0= )
xv? (
x11-libs/libX11
x11-libs/libXext
x11-libs/libXv
)
xvid? ( media-libs/xvid )
"
DEPEND="
${COMMON_DEPEND}
oss? ( virtual/os-headers )
"
RDEPEND="
${COMMON_DEPEND}
!<media-libs/avidemux-plugins-${PV}
"
S="${WORKDIR}/avidemux2-${PV}"
PATCHES=( "${FILESDIR}/${PN}-2.8.0-optional-pulse.patch" )
src_prepare() {
default
# Don't reapply PATCHES during cmake_src_prepare
unset PATCHES
processes="buildPluginsCommon:avidemux_plugins
buildPluginsCLI:avidemux_plugins"
use qt5 && processes+=" buildPluginsQt4:avidemux_plugins"
for process in ${processes} ; do
CMAKE_USE_DIR="${S}"/${process#*:} cmake_src_prepare
done
}
src_configure() {
# See bug 432322.
use x86 && replace-flags -O0 -O1
for process in ${processes} ; do
local build="${WORKDIR}/${P}_build/${process%%:*}"
local mycmakeargs=(
-DAVIDEMUX_SOURCE_DIR='${S}'
-DPLUGIN_UI=$(echo ${build/buildPlugins/} | tr '[:lower:]' '[:upper:]')
-DFAAC="$(usex aac)"
-DFAAD="$(usex aac)"
-DALSA="$(usex alsa)"
-DAFTEN="$(usex aften)"
-DDCAENC="$(usex dcaenc)"
-DFDK_AAC="$(usex fdk)"
-DOPENCORE_AMRWB="$(usex amr)"
-DOPENCORE_AMRNB="$(usex amr)"
-DLIBDCA="$(usex dts)"
-DFONTCONFIG="$(usex fontconfig)"
-DJACK="$(usex jack)"
-DLAME="$(usex lame)"
-DNVENC="$(usex nvenc)"
-DOPENGL="$(usex opengl)"
-DOPUS="$(usex opus)"
-DOSS="$(usex oss)"
-DPULSEAUDIO="$(usex pulseaudio)"
-DENABLE_QT4=OFF
-DENABLE_QT6=OFF
-DFREETYPE2="$(usex truetype)"
-DTWOLAME="$(usex twolame)"
-DX264="$(usex x264)"
-DX265="$(usex x265)"
-DXVIDEO="$(usex xv)"
-DXVID="$(usex xvid)"
-DVDPAU="$(usex vdpau)"
-DVORBIS="$(usex vorbis)"
-DLIBVORBIS="$(usex vorbis)"
-DVPXDEC="$(usex vpx)"
-DUSE_EXTERNAL_LIBA52=yes
-DUSE_EXTERNAL_LIBASS=yes
-DUSE_EXTERNAL_LIBMAD=yes
-DUSE_EXTERNAL_LIBMP4V2=yes
)
use qt5 && mycmakeargs+=( -DENABLE_QT5=True )
use debug && mycmakeargs+=( -DVERBOSE=1 -DADM_DEBUG=1 )
CMAKE_USE_DIR="${S}"/${process#*:} BUILD_DIR="${build}" cmake_src_configure
done
}
src_compile() {
for process in ${processes} ; do
local build="${WORKDIR}/${P}_build/${process%%:*}"
BUILD_DIR="${build}" cmake_src_compile
done
}
src_install() {
for process in ${processes} ; do
local build="${WORKDIR}/${P}_build/${process%%:*}"
BUILD_DIR="${build}" cmake_src_install
done
}

View File

@ -0,0 +1,21 @@
diff -ur avidemux2-2.8.0.orig/cmake/admCheckAudioDeviceLibs.cmake avidemux2-2.8.0/cmake/admCheckAudioDeviceLibs.cmake
--- avidemux2-2.8.0.orig/cmake/admCheckAudioDeviceLibs.cmake 2021-12-24 09:16:23.000000000 +0100
+++ avidemux2-2.8.0/cmake/admCheckAudioDeviceLibs.cmake 2022-01-16 23:37:10.653810353 +0100
@@ -194,6 +194,7 @@
APPEND_SUMMARY_LIST("Audio Device" "PulseAudioS" "${USE_PULSE_SIMPLE}")
]]
OPTION(PULSEAUDIO "" ON)
+ IF (PULSEAUDIO)
MESSAGE(STATUS "Checking for PulseAudio")
include(FindPkgConfig)
pkg_check_modules(PULSEAUDIO libpulse)
@@ -203,6 +204,9 @@
ELSE (PULSEAUDIO_FOUND)
MESSAGE(STATUS "Could not find PulseAudio")
ENDIF (PULSEAUDIO_FOUND)
+ ELSE (PULSEAUDIO)
+ MESSAGE("${MSG_DISABLE_OPTION}")
+ ENDIF (PULSEAUDIO)
APPEND_SUMMARY_LIST("Audio Device" "PulseAudio" "${USE_PULSE}")
ELSE (UNIX AND NOT APPLE)
SET(PULSEAUDIOSIMPLE_CAPABLE FALSE)

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>media-video@gentoo.org</email>
@ -12,7 +12,6 @@
<flag name="fdk">Adds support for encoding AAC using <pkg>media-libs/fdk-aac</pkg>.</flag>
<flag name="fribidi">Enable unicode bidirectional algorithm support via <pkg>dev-libs/fribidi</pkg>.</flag>
<flag name="nvenc">Adds support for NVIDIA Encoder (NVENC) API for hardware accelerated encoding on NVIDIA cards.</flag>
<flag name="opus">Adds support for the Opus codec via <pkg>media-libs/opus</pkg>.</flag>
<flag name="twolame">Enable TwoLAME support via <pkg>media-sound/twolame</pkg>, an optimised MPEG Audio Layer 2 (MP2) encoder.</flag>
<flag name="vpx">Enable WebM VP8 Codec SDK support via <pkg>media-libs/libvpx</pkg>.</flag>
<flag name="x265">Enables HEVC support with <pkg>media-libs/x265</pkg>.</flag>

View File

@ -1,2 +1,3 @@
DIST avidemux-2.7.8.tar.gz 22080267 SHA512 6cd5527ab34517a07bf73e46d01f15b7ff023ff34ed70ee54f1d7dbfb6cf57364a323b4ecb89bb9aadeb9bc05473aacb40d8c4eecc522840a3c1c4b3a8756d82
DIST avidemux-i18n-2.7.8.tar.gz 2488165 SHA512 a62b06a3d95577cf805be36f991ccb63d044b7c3633ada65bd5810f0e7d8eb41aa874ef5dd63de4fcacc0be073935bed827b2f0bceba77ab735ac8673c1ad39f
DIST avidemux-2.7.8.tar.gz 22080267 SHA256 8467b4e76c4b627997e56c65ce87053eac1d80dfe49c7bbf457aa969350d81bb SHA512 6cd5527ab34517a07bf73e46d01f15b7ff023ff34ed70ee54f1d7dbfb6cf57364a323b4ecb89bb9aadeb9bc05473aacb40d8c4eecc522840a3c1c4b3a8756d82 WHIRLPOOL 33167cd8fc318bdd16c7623e924bdbd803c5db8a916941c093760773174620440ac2b983682bcf5cf3728044102c23ec23c4cdba71f45e6426cc76b352444fdb
DIST avidemux-2.8.0.tar.gz 22901276 SHA256 910c466f2bfe902f0d4750d23d3da3419bbfb846c1c411082ce8ce8f3d7b3cc4 SHA512 271209ab38c397da68542cfa28dcef8a68f97aeb94b9401111ea1f48d157f12a328518ae96142e70480beda71a19cced466bd9e0d8a627854f5c47a7fc6fe157 WHIRLPOOL 0bfca8ca6af18507e8378e873d85d4ce6cf0fadb4c70537e3996646536472f0785616a35796bb2176b589a456c60f3afc6b662b7c8a23633653036b2daedf9da
DIST avidemux-i18n-2.7.8.tar.gz 2488165 SHA256 76ca2f7ebb9f4e634cdd0f8d097ae37cbc63ce7d1ca4aacf5ca62e846fc7dea6 SHA512 a62b06a3d95577cf805be36f991ccb63d044b7c3633ada65bd5810f0e7d8eb41aa874ef5dd63de4fcacc0be073935bed827b2f0bceba77ab735ac8673c1ad39f WHIRLPOOL dddb0ee3c0cb30f5c9a4d1991f0e0091861fdf7b21f6995d13befc2431e6d6aa7c11e61cea378628fdfb6d230924cb9b8f8344f6c35a13bdb139388de11cbc4d

View File

@ -0,0 +1,141 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_MAKEFILE_GENERATOR="emake"
I18N_PV=2.7.8
inherit cmake desktop flag-o-matic qmake-utils xdg
DESCRIPTION="Video editor designed for simple cutting, filtering and encoding tasks"
HOMEPAGE="http://fixounet.free.fr/avidemux"
SRC_URI="
https://github.com/mean00/avidemux2/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
https://github.com/mean00/avidemux2_i18n/archive/refs/tags/${I18N_PV}.tar.gz -> ${PN}-i18n-${I18N_PV}.tar.gz
"
# Multiple licenses because of all the bundled stuff.
LICENSE="GPL-1 GPL-2 MIT PSF-2 public-domain"
SLOT="2.7"
KEYWORDS="~amd64 ~x86"
IUSE="debug nls nvenc opengl qt5 sdl vaapi vdpau xv"
BDEPEND="
dev-lang/yasm
qt5? ( dev-qt/linguist-tools:5 )
"
DEPEND="
~media-libs/avidemux-core-${PV}:${SLOT}[nls?,sdl?,vaapi?,vdpau?,xv?,nvenc?]
nvenc? ( amd64? ( media-video/nvidia_video_sdk:0 ) )
opengl? ( virtual/opengl:0 )
qt5? (
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtnetwork:5
dev-qt/qtopengl:5
dev-qt/qtwidgets:5
)
vaapi? ( x11-libs/libva:0= )
"
RDEPEND="
${DEPEND}
nls? ( virtual/libintl:0 )
!<media-video/avidemux-${PV}
"
PDEPEND="~media-libs/avidemux-plugins-${PV}:${SLOT}[opengl?,qt5?]"
S="${WORKDIR}/avidemux2-${PV}"
src_unpack() {
default
mv -f -T avidemux2_i18n-"${I18N_PV}" "${S}"/avidemux/qt4/i18n >/dev/null || die
}
src_prepare() {
eapply "${FILESDIR}/${PN}-2.7.4-qt-5.15.patch"
processes="buildCli:avidemux/cli"
use qt5 && processes+=" buildQt4:avidemux/qt4"
for process in ${processes} ; do
CMAKE_USE_DIR="${S}"/${process#*:} cmake_src_prepare
done
if use qt5; then
# Fix icon name -> avidemux-2.7
sed -i -e "/^Icon/ s:${PN}\.png:${PN}-${SLOT}:" appImage/"${PN}".desktop || die "Icon name fix failed."
# The desktop file is broken. It uses avidemux3_portable instead of avidemux3_qt5
sed -i -re '/^Exec/ s:(avidemux3_)portable:\1qt5:' appImage/"${PN}".desktop || die "Desktop file fix failed."
# QA warnings: missing trailing ';' and 'Application' is deprecated.
sed -i -e 's/Application;AudioVideo/AudioVideo;/g' appImage/"${PN}".desktop || die "Desktop file fix failed."
# Now rename the desktop file to not collide with 2.6.
mv appImage/"${PN}".desktop "${PN}-${SLOT}".desktop || die "Collision rename failed."
fi
# Remove "Build Option" dialog because it doesn't reflect
# what the GUI can or has been built with. (Bug #463628)
sed -i -e '/Build Option/d' avidemux/common/ADM_commonUI/myOwnMenu.h || die "Couldn't remove \"Build Option\" dialog."
}
src_configure() {
# See bug 432322.
use x86 && replace-flags -O0 -O1
# The build relies on an avidemux-core header that uses 'nullptr'
# which is from >=C++11. Let's use the GCC-6 default C++ dialect.
append-cxxflags -std=c++14
local mycmakeargs=(
-DGETTEXT="$(usex nls)"
-DSDL="$(usex sdl)"
-DLIBVA="$(usex vaapi)"
-DOPENGL="$(usex opengl)"
-DVDPAU="$(usex vdpau)"
-DXVIDEO="$(usex xv)"
-DENABLE_QT4=OFF
-DENABLE_QT6=OFF
)
use qt5 && mycmakeargs+=(
-DENABLE_QT5="$(usex qt5)"
)
use debug && mycmakeargs+=( -DVERBOSE=1 -DADM_DEBUG=1 )
for process in ${processes} ; do
local build="${WORKDIR}/${P}_build/${process%%:*}"
CMAKE_USE_DIR="${S}"/${process#*:} BUILD_DIR="${build}" cmake_src_configure
done
}
src_compile() {
for process in ${processes} ; do
local build="${WORKDIR}/${P}_build/${process%%:*}"
BUILD_DIR="${build}" cmake_src_compile
done
}
src_test() {
for process in ${processes} ; do
local build="${WORKDIR}/${P}_build/${process%%:*}"
BUILD_DIR="${build}" cmake_src_test
done
}
src_install() {
for process in ${processes} ; do
local build="${WORKDIR}/${P}_build/${process%%:*}"
BUILD_DIR="${build}" cmake_src_install
done
if use qt5; then
cd "${S}" || die "Can't enter source folder"
newicon "${PN}"_icon.png "${PN}-${SLOT}".png
domenu "${PN}-${SLOT}".desktop
fi
}

View File

@ -0,0 +1,11 @@
diff -ur avidemux2-2.7.4.orig/avidemux/qt4/ADM_UIs/src/T_RubberControl.cpp avidemux2-2.7.4/avidemux/qt4/ADM_UIs/src/T_RubberControl.cpp
--- a/avidemux/qt4/ADM_UIs/src/T_RubberControl.cpp 2019-08-14 19:11:18.000000000 +0200
+++ b/avidemux/qt4/ADM_UIs/src/T_RubberControl.cpp 2020-05-30 20:45:53.304702855 +0200
@@ -8,6 +8,7 @@
***************************************************************************///
#include <QPainter>
+#include <QPainterPath>
#include <QRubberBand>
#include <QBoxLayout>
#include <QSizeGrip>