app-dicts/gnome-dictionary: dropped ~x86-freebsd
[gentoo.git] / media-video / avidemux / avidemux-2.6.8.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 PLOCALES="ca cs de el es fr it ja pt_BR ru sr sr@latin tr"
8
9 inherit cmake-utils eutils flag-o-matic l10n
10
11 SLOT="2.6"
12
13 DESCRIPTION="Video editor designed for simple cutting, filtering and encoding tasks"
14 HOMEPAGE="http://fixounet.free.fr/${PN}"
15
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"
20
21 if [[ ${PV} == *9999* ]] ; then
22         KEYWORDS=""
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"
24
25         inherit git-2
26 else
27         MY_P="${PN}_${PV}"
28         SRC_URI="mirror://sourceforge/${PN}/${PN}/${PV}/${MY_P}.tar.gz"
29 fi
30
31 DEPEND="
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 )
36         video_cards_fglrx? (
37                 || ( >=x11-drivers/ati-drivers-14.12-r3
38                         x11-libs/xvba-video:0 )
39                 )"
40 RDEPEND="$DEPEND"
41 PDEPEND="~media-libs/avidemux-plugins-${PV}:${SLOT}[opengl?,qt4?]"
42
43 S="${WORKDIR}/${MY_P}"
44
45 src_prepare() {
46         cmake-utils_src_prepare
47
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."
50
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."
55
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."
58
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."
61
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."
64 }
65
66 src_configure() {
67         local mycmakeargs="
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)
75         "
76
77         if use debug ; then
78                 mycmakeargs+=" -DVERBOSE=1 -DCMAKE_BUILD_TYPE=Debug -DADM_DEBUG=1"
79         fi
80
81         processes="buildCli:avidemux/cli"
82         use qt4 && processes+=" buildQt4:avidemux/qt4"
83
84         for process in ${processes} ; do
85                 local build="${process%%:*}"
86
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
90         done
91
92         # Add lax vector typing for PowerPC.
93         if use ppc || use ppc64 ; then
94                 append-cflags -flax-vector-conversions
95         fi
96
97         # See bug 432322.
98         use x86 && replace-flags -O0 -O1
99 }
100
101 src_compile() {
102         for process in ${processes} ; do
103                 BUILD_DIR="${S}/${process%%:*}" cmake-utils_src_compile
104         done
105 }
106
107 DOCS=( AUTHORS README )
108
109 src_install() {
110         for process in ${processes} ; do
111                 BUILD_DIR="${S}/${process%%:*}" cmake-utils_src_install
112         done
113
114         if [[ -f "${ED}"/usr/bin/avidemux3_cli ]] ; then
115                 fperms +x /usr/bin/avidemux3_cli
116         fi
117
118         if [[ -f "${ED}"/usr/bin/avidemux3_jobs ]] ; then
119                 fperms +x /usr/bin/avidemux3_jobs
120         fi
121
122         cd "${S}" || die "Can't enter source folder."
123         newicon ${PN}_icon.png ${PN}-2.6.png
124
125         if use qt4 ; then
126                 fperms +x /usr/bin/avidemux3_qt4
127                 domenu ${PN}-2.6.desktop
128         fi
129 }