Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/avidemux/
Date: Tue, 09 Jan 2018 17:33:18
Message-Id: 1515518888.ed3f9f1643b2a79b26f2b13ceadff172e7754cc1.asturm@gentoo
1 commit: ed3f9f1643b2a79b26f2b13ceadff172e7754cc1
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 9 15:49:03 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 9 17:28:08 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed3f9f16
7
8 media-video/avidemux: Only sed avidemux2.desktop if USE=qt5
9
10 Package-Manager: Portage-2.3.19, Repoman-2.3.6
11
12 media-video/avidemux/avidemux-2.6.20-r1.ebuild | 166 +++++++++++++++++++++++++
13 1 file changed, 166 insertions(+)
14
15 diff --git a/media-video/avidemux/avidemux-2.6.20-r1.ebuild b/media-video/avidemux/avidemux-2.6.20-r1.ebuild
16 new file mode 100644
17 index 00000000000..75412c73705
18 --- /dev/null
19 +++ b/media-video/avidemux/avidemux-2.6.20-r1.ebuild
20 @@ -0,0 +1,166 @@
21 +# Copyright 1999-2018 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=6
25 +
26 +inherit cmake-utils qmake-utils xdg-utils
27 +
28 +DESCRIPTION="Video editor designed for simple cutting, filtering and encoding tasks"
29 +HOMEPAGE="http://fixounet.free.fr/${PN}"
30 +
31 +# Multiple licenses because of all the bundled stuff.
32 +LICENSE="GPL-1 GPL-2 MIT PSF-2 public-domain"
33 +SLOT="2.6"
34 +IUSE="debug opengl nls nvenc qt5 sdl vaapi vdpau xv"
35 +
36 +if [[ ${PV} == *9999* ]] ; then
37 + MY_P="${P}"
38 + EGIT_REPO_URI="https://github.com/mean00/avidemux2.git"
39 +
40 + inherit git-r3
41 +else
42 + MY_P="${PN}_${PV}"
43 + SRC_URI="mirror://sourceforge/${PN}/${PN}/${PV}/${MY_P}.tar.gz"
44 + KEYWORDS="~amd64 ~x86"
45 +fi
46 +
47 +COMMON_DEPEND="
48 + ~media-libs/avidemux-core-${PV}:${SLOT}[nls?,sdl?,vaapi?,vdpau?,xv?,nvenc?]
49 + opengl? ( virtual/opengl:0 )
50 + qt5? ( dev-qt/qtgui:5 )
51 + vaapi? ( x11-libs/libva:0 )
52 + nvenc? ( amd64? ( media-video/nvidia_video_sdk:0 ) )
53 +"
54 +DEPEND="${COMMON_DEPEND}
55 + qt5? ( dev-qt/linguist-tools:5 )
56 +"
57 +RDEPEND="${COMMON_DEPEND}
58 + nls? ( virtual/libintl:0 )
59 +"
60 +PDEPEND="~media-libs/avidemux-plugins-${PV}:${SLOT}[opengl?,qt5?]"
61 +
62 +S="${WORKDIR}/${MY_P}"
63 +
64 +src_prepare() {
65 + default
66 +
67 + processes="buildCli:avidemux/cli"
68 + if use qt5 ; then
69 + processes+=" buildQt4:avidemux/qt4"
70 + fi
71 +
72 + for process in ${processes} ; do
73 + CMAKE_USE_DIR="${S}"/${process#*:} cmake-utils_src_prepare
74 + done
75 +
76 + # Fix icon name -> avidemux-2.6.png
77 + sed -i -e "/^Icon/ s:${PN}:${PN}-2.6:" ${PN}2.desktop || die "Icon name fix failed."
78 +
79 + # The desktop file is broken. It uses avidemux2 instead of avidemux3
80 + # so it will actually launch avidemux-2.5 if it is installed.
81 + sed -i -e "/^Exec/ s:${PN}2:${PN}3:" ${PN}2.desktop || die "Desktop file fix failed."
82 + if use qt5; then
83 + sed -i -re '/^Exec/ s:(avidemux3_)gtk:\1qt5:' ${PN}2.desktop || \
84 + die "Desktop file fix failed."
85 + fi
86 +
87 + # Fix QA warnings that complain a trailing ; is missing and Application is deprecated.
88 + sed -i -e 's/Application;AudioVideo/AudioVideo;/g' ${PN}2.desktop || die "Desktop file fix failed."
89 +
90 + # Now rename the desktop file to not collide with 2.5.
91 + mv ${PN}2.desktop ${PN}-2.6.desktop || die "Collision rename failed."
92 +
93 + # Remove "Build Option" dialog because it doesn't reflect what the GUI can or has been built with. (Bug #463628)
94 + sed -i -e '/Build Option/d' avidemux/common/ADM_commonUI/myOwnMenu.h || die "Couldn't remove \"Build Option\" dialog."
95 +}
96 +
97 +src_configure() {
98 + # Add lax vector typing for PowerPC.
99 + if use ppc || use ppc64 ; then
100 + append-cflags -flax-vector-conversions
101 + fi
102 +
103 + # See bug 432322.
104 + use x86 && replace-flags -O0 -O1
105 +
106 + # The build relies on an avidemux-core header that uses 'nullptr'
107 + # which is from >=C++11. Let's use the GCC-6 default C++ dialect.
108 + append-cxxflags -std=c++14
109 +
110 + local mycmakeargs=(
111 + -DAVIDEMUX_SOURCE_DIR='${S}'
112 + -DGETTEXT="$(usex nls)"
113 + -DSDL="$(usex sdl)"
114 + -DLIBVA="$(usex vaapi)"
115 + -DVDPAU="$(usex vdpau)"
116 + -DXVIDEO="$(usex xv)"
117 + )
118 +
119 + if use qt5 ; then
120 + mycmakeargs+=(
121 + -DENABLE_QT5="$(usex qt5)"
122 + -DLRELEASE_EXECUTABLE="$(qt5_get_bindir)/lrelease"
123 + )
124 + fi
125 +
126 + if use debug ; then
127 + mycmakeargs+=( -DVERBOSE=1 -DADM_DEBUG=1 )
128 + fi
129 +
130 + for process in ${processes} ; do
131 + local build="${WORKDIR}/${P}_build/${process%%:*}"
132 + CMAKE_USE_DIR="${S}"/${process#*:} BUILD_DIR="${build}" cmake-utils_src_configure
133 + done
134 +}
135 +
136 +src_compile() {
137 + for process in ${processes} ; do
138 + local build="${WORKDIR}/${P}_build/${process%%:*}"
139 + BUILD_DIR="${build}" cmake-utils_src_compile
140 + done
141 +}
142 +
143 +src_test() {
144 + for process in ${processes} ; do
145 + local build="${WORKDIR}/${P}_build/${process%%:*}"
146 + BUILD_DIR="${build}" cmake-utils_src_test
147 + done
148 +}
149 +
150 +src_install() {
151 + for process in ${processes} ; do
152 + local build="${WORKDIR}/${P}_build/${process%%:*}"
153 + BUILD_DIR="${build}" cmake-utils_src_install
154 + done
155 +
156 + if [[ -f "${ED}"/usr/bin/avidemux3_cli ]] ; then
157 + fperms +x /usr/bin/avidemux3_cli
158 + fi
159 +
160 + if [[ -f "${ED}"/usr/bin/avidemux3_jobs ]] ; then
161 + fperms +x /usr/bin/avidemux3_jobs
162 + fi
163 +
164 + cd "${S}" || die "Can't enter source folder."
165 + newicon ${PN}_icon.png ${PN}-2.6.png
166 +
167 + if [[ -f "${ED}"/usr/bin/avidemux3_qt5 ]] ; then
168 + fperms +x /usr/bin/avidemux3_qt5
169 + fi
170 +
171 + if [[ -f "${ED}"/usr/bin/avidemux3_jobs_qt5 ]] ; then
172 + fperms +x /usr/bin/avidemux3_jobs_qt5
173 + fi
174 +
175 + if use qt5 ; then
176 + domenu ${PN}-2.6.desktop
177 + fi
178 +}
179 +
180 +pkg_postinst() {
181 + xdg_desktop_database_update
182 +}
183 +
184 +pkg_postrm() {
185 + xdg_desktop_database_update
186 +}