1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 PLOCALES="ca cs de el es fr it ja pt_BR ru sr sr@latin tr"
9 inherit cmake-utils eutils flag-o-matic l10n
13 DESCRIPTION="Video editor designed for simple cutting, filtering and encoding tasks"
14 HOMEPAGE="http://fixounet.free.fr/${PN}"
16 # Multiple licenses because of all the bundled stuff.
17 LICENSE="GPL-1 GPL-2 MIT PSF-2 public-domain"
18 IUSE="debug opengl nls qt4 sdl vaapi vdpau video_cards_fglrx xv"
19 KEYWORDS="~amd64 ~x86"
21 if [[ ${PV} == *9999* ]] ; then
23 EGIT_REPO_URI="git://gitorious.org/${PN}2-6/${PN}2-6.git https://git.gitorious.org/${PN}2-6/${PN}2-6.git"
28 SRC_URI="mirror://sourceforge/${PN}/${PN}/${PV}/${MY_P}.tar.gz"
32 ~media-libs/avidemux-core-${PV}:${SLOT}[nls?,sdl?,vaapi?,vdpau?,video_cards_fglrx?,xv?]
33 opengl? ( virtual/opengl:0 )
34 qt4? ( >=dev-qt/qtgui-4.8.3:4 )
35 vaapi? ( x11-libs/libva:0 )
37 || ( >=x11-drivers/ati-drivers-14.12-r3
38 x11-libs/xvba-video:0 )
41 PDEPEND="~media-libs/avidemux-plugins-${PV}:${SLOT}[opengl?,qt4?]"
43 S="${WORKDIR}/${MY_P}"
46 cmake-utils_src_prepare
48 # Fix icon name -> avidemux-2.6.png
49 sed -i -e "/^Icon/ s:${PN}:${PN}-2.6:" ${PN}2.desktop || die "Icon name fix failed."
51 # The desktop file is broken. It uses avidemux2 instead of avidemux3
52 # so it will actually launch avidemux-2.5 if it is installed.
53 sed -i -e "/^Exec/ s:${PN}2:${PN}3:" ${PN}2.desktop || die "Desktop file fix failed."
54 sed -i -re '/^Exec/ s:(avidemux3_)gtk:\1qt4:' ${PN}2.desktop || die "Desktop file fix failed."
56 # Fix QA warnings that complain a trailing ; is missing and Application is deprecated.
57 sed -i -e 's/Application;AudioVideo/AudioVideo;/g' ${PN}2.desktop || die "Desktop file fix failed."
59 # Now rename the desktop file to not collide with 2.5.
60 mv ${PN}2.desktop ${PN}-2.6.desktop || die "Collision rename failed."
62 # Remove "Build Option" dialog because it doesn't reflect what the GUI can or has been built with. (Bug #463628)
63 sed -i -e '/Build Option/d' avidemux/common/ADM_commonUI/myOwnMenu.h || die "Couldn't remove \"Build Option\" dialog."
68 -DAVIDEMUX_SOURCE_DIR='${S}'
69 $(cmake-utils_use nls GETTEXT)
70 $(cmake-utils_use sdl)
71 $(cmake-utils_use vaapi LIBVA)
72 $(cmake-utils_use vdpau)
73 $(cmake-utils_use video_cards_fglrx XVBA)
74 $(cmake-utils_use xv XVIDEO)
78 mycmakeargs+=" -DVERBOSE=1 -DCMAKE_BUILD_TYPE=Debug -DADM_DEBUG=1"
81 processes="buildCli:avidemux/cli"
82 use qt4 && processes+=" buildQt4:avidemux/qt4"
84 for process in ${processes} ; do
85 local build="${process%%:*}"
87 mkdir "${S}"/${build} || die "Can't create build folder."
88 cd "${S}"/${build} || die "Can't enter build folder."
89 CMAKE_USE_DIR="${S}"/${process#*:} BUILD_DIR="${S}"/${build} cmake-utils_src_configure
92 # Add lax vector typing for PowerPC.
93 if use ppc || use ppc64 ; then
94 append-cflags -flax-vector-conversions
98 use x86 && replace-flags -O0 -O1
102 for process in ${processes} ; do
103 BUILD_DIR="${S}/${process%%:*}" cmake-utils_src_compile
107 DOCS=( AUTHORS README )
110 for process in ${processes} ; do
111 BUILD_DIR="${S}/${process%%:*}" cmake-utils_src_install
114 if [[ -f "${ED}"/usr/bin/avidemux3_cli ]] ; then
115 fperms +x /usr/bin/avidemux3_cli
118 if [[ -f "${ED}"/usr/bin/avidemux3_jobs ]] ; then
119 fperms +x /usr/bin/avidemux3_jobs
122 cd "${S}" || die "Can't enter source folder."
123 newicon ${PN}_icon.png ${PN}-2.6.png
126 fperms +x /usr/bin/avidemux3_qt4
127 domenu ${PN}-2.6.desktop