Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libopenshot/
Date: Sat, 13 Oct 2018 17:36:07
Message-Id: 1539452108.d5ae9c76c16c29c6f4d4407b34d1b108dd5092d8.pacho@gentoo
1 commit: d5ae9c76c16c29c6f4d4407b34d1b108dd5092d8
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 13 17:31:59 2018 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 13 17:35:08 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5ae9c76
7
8 media-libs/libopenshot: Commit the patch, drop old
9
10 Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
11 Package-Manager: Portage-2.3.51, Repoman-2.3.11
12
13 media-libs/libopenshot/Manifest | 2 -
14 media-libs/libopenshot/libopenshot-0.1.3.ebuild | 84 ----------------------
15 media-libs/libopenshot/libopenshot-0.1.7.ebuild | 83 ---------------------
16 .../libopenshot-0.2.2-imagemagick7.patch | 78 ++++++++++++++++++++
17 4 files changed, 78 insertions(+), 169 deletions(-)
18
19 diff --git a/media-libs/libopenshot/Manifest b/media-libs/libopenshot/Manifest
20 index be122d9c41a..d1299bd05fb 100644
21 --- a/media-libs/libopenshot/Manifest
22 +++ b/media-libs/libopenshot/Manifest
23 @@ -1,4 +1,2 @@
24 -DIST libopenshot-0.1.3.tar.gz 11019740 BLAKE2B a706889f709024300ef79518406da861111a8445b5ce23364b8492a72e74e7944c88ba9b4a29da356ca21500253d19e8c32abe7b5aaa0ac35bebec85e52ba970 SHA512 d59817505812868db408a88dc1d30b5b1833910f45dd0df03937110b7d4cbd85a270773008e75a1501f4b3b89a09ea798ed9b580755adf3ae79ac24d403f6982
25 -DIST libopenshot-0.1.7.tar.gz 11022594 BLAKE2B f3e0836ebb6dd89ce42085dc9d18dd3bce9ab3011550958bec41eead2c62b454459d219d2efeece1a43eb0536cb99866eaf9b478205d717da4c173e954772a46 SHA512 4c8871ff30c03a14766e35a64052695768311afd81ecc55598720ad146f53c122ef3b1293467670f7dd48da77bf6cb4f4f14a18c298a649b8827f901ed653709
26 DIST libopenshot-0.1.8.tar.gz 11019495 BLAKE2B a86994a09328e24705fe06ec3c47cbedb89815e6ec1440237dc58babfc066655f1c7dacc19257b02b645a9415c63cd4e0c1191fa452b7632cf531d98a1b073c3 SHA512 02630d7ce9fd378ad648d034622d4f971728a2074691d7facc8a36dcd52b87c1372dd5a9588c0ba852589105bdbf78941083fd6b1eb1bcc0a33d4ca49634162c
27 DIST libopenshot-0.2.2.tar.gz 11037768 BLAKE2B c307e41bf17d40ae421a541bbdf4cd53c6ef4d97041a476c6910bd156c10815aa5a5811813b24fdc472401516f29cf8cb68fbda17a0b434767c3f3aa63d6f222 SHA512 b89189e57e82da68a063417bba9c94704c04b0546c0aed227daa23a794eee56341a05988d8e28dbd339edfcdeeaed48103b347060eccf94f32fe1a4bf23d6553
28
29 diff --git a/media-libs/libopenshot/libopenshot-0.1.3.ebuild b/media-libs/libopenshot/libopenshot-0.1.3.ebuild
30 deleted file mode 100644
31 index cc13df34d2a..00000000000
32 --- a/media-libs/libopenshot/libopenshot-0.1.3.ebuild
33 +++ /dev/null
34 @@ -1,84 +0,0 @@
35 -# Copyright 1999-2017 Gentoo Foundation
36 -# Distributed under the terms of the GNU General Public License v2
37 -
38 -EAPI=6
39 -
40 -PYTHON_COMPAT=( python3_{4,5} )
41 -
42 -inherit cmake-utils python-single-r1 toolchain-funcs versionator
43 -
44 -DESCRIPTION="Video editing library used by OpenShot"
45 -HOMEPAGE="http://www.openshotvideo.com/"
46 -SRC_URI="https://github.com/OpenShot/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
47 -
48 -LICENSE="GPL-3"
49 -SLOT="0"
50 -KEYWORDS="~amd64 ~x86"
51 -IUSE="+imagemagick libav +python test"
52 -# https://github.com/OpenShot/libopenshot/issues/43
53 -RESTRICT="test"
54 -
55 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
56 -
57 -RDEPEND="
58 - net-libs/cppzmq
59 - dev-qt/qtcore:5
60 - dev-qt/qtgui:5
61 - dev-qt/qtmultimedia:5[widgets]
62 - media-libs/libopenshot-audio
63 - imagemagick? ( media-gfx/imagemagick:0=[cxx] )
64 - libav? ( media-video/libav:=[encode,x264,xvid,vpx,mp3,theora] )
65 - !libav? ( media-video/ffmpeg:0=[encode,x264,xvid,vpx,mp3,theora] )
66 - python? ( ${PYTHON_DEPS} )
67 -"
68 -DEPEND="
69 - ${RDEPEND}
70 - python? ( dev-lang/swig )
71 - test? ( dev-libs/unittest++ )
72 -"
73 -
74 -# https://github.com/OpenShot/libopenshot/pull/45
75 -PATCHES=( ${FILESDIR}/${P}-fix-tests.patch )
76 -
77 -pkg_pretend() {
78 - if [[ ${MERGE_TYPE} != binary ]] && ! tc-has-openmp; then
79 - eerror "${P} requires a compiler with OpenMP support. Your current"
80 - eerror "compiler does not support it. If you use gcc, you can"
81 - eerror "re-emerge it with the 'openmp' use flag enabled."
82 - die "The current compiler does not support OpenMP"
83 - fi
84 -}
85 -
86 -pkg_setup() {
87 - use python && python-single-r1_pkg_setup
88 -}
89 -
90 -src_prepare() {
91 - # https://github.com/OpenShot/libopenshot/issues/17
92 - use test || cmake_comment_add_subdirectory tests
93 - cmake-utils_src_prepare
94 -}
95 -
96 -src_configure() {
97 - local mycmakeargs=(
98 - -DENABLE_RUBY=OFF # TODO: add ruby support
99 - -DENABLE_PYTHON=$(usex python)
100 - -DCMAKE_DISABLE_FIND_PACKAGE_ImageMagick=$(usex !imagemagick)
101 - )
102 - use python && mycmakeargs+=(
103 - -DPYTHON_EXECUTABLE="${PYTHON}"
104 - -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
105 - -DPYTHON_LIBRARY="$(python_get_library_path)"
106 - )
107 - cmake-utils_src_configure
108 -}
109 -
110 -src_test() {
111 - cd "${BUILD_DIR}" || die
112 - emake test
113 -}
114 -
115 -src_install() {
116 - cmake-utils_src_install
117 - python_optimize
118 -}
119
120 diff --git a/media-libs/libopenshot/libopenshot-0.1.7.ebuild b/media-libs/libopenshot/libopenshot-0.1.7.ebuild
121 deleted file mode 100644
122 index 4f9643afa9b..00000000000
123 --- a/media-libs/libopenshot/libopenshot-0.1.7.ebuild
124 +++ /dev/null
125 @@ -1,83 +0,0 @@
126 -# Copyright 1999-2017 Gentoo Foundation
127 -# Distributed under the terms of the GNU General Public License v2
128 -
129 -EAPI=6
130 -
131 -PYTHON_COMPAT=( python3_{4,5,6} )
132 -
133 -inherit cmake-utils python-single-r1 toolchain-funcs versionator
134 -
135 -DESCRIPTION="Video editing library used by OpenShot"
136 -HOMEPAGE="http://www.openshotvideo.com/"
137 -SRC_URI="https://github.com/OpenShot/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
138 -
139 -LICENSE="GPL-3"
140 -SLOT="0"
141 -KEYWORDS="~amd64 ~x86"
142 -IUSE="+imagemagick libav +python test"
143 -# https://github.com/OpenShot/libopenshot/issues/43
144 -RESTRICT="test"
145 -
146 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
147 -
148 -RDEPEND="
149 - net-libs/cppzmq
150 - dev-qt/qtcore:5
151 - dev-qt/qtgui:5
152 - dev-qt/qtmultimedia:5[widgets]
153 - media-libs/libopenshot-audio
154 - imagemagick? ( <media-gfx/imagemagick-7:0=[cxx] )
155 - libav? ( media-video/libav:=[encode,x264,xvid,vpx,mp3,theora] )
156 - !libav? ( media-video/ffmpeg:0=[encode,x264,xvid,vpx,mp3,theora] )
157 - python? ( ${PYTHON_DEPS} )
158 -"
159 -DEPEND="
160 - ${RDEPEND}
161 - python? ( dev-lang/swig )
162 - test? ( dev-libs/unittest++ )
163 -"
164 -
165 -# https://github.com/OpenShot/libopenshot/pull/45
166 -PATCHES=( ${FILESDIR}/${PN}-0.1.3-fix-tests.patch )
167 -
168 -pkg_pretend() {
169 - if [[ ${MERGE_TYPE} != binary ]] && ! tc-has-openmp; then
170 - eerror "${P} requires a compiler with OpenMP support. Your current"
171 - eerror "compiler does not support it. If you use gcc, you can"
172 - eerror "re-emerge it with the 'openmp' use flag enabled."
173 - die "The current compiler does not support OpenMP"
174 - fi
175 -}
176 -
177 -pkg_setup() {
178 - use python && python-single-r1_pkg_setup
179 -}
180 -
181 -src_prepare() {
182 - # https://github.com/OpenShot/libopenshot/issues/17
183 - use test || cmake_comment_add_subdirectory tests
184 - cmake-utils_src_prepare
185 -}
186 -
187 -src_configure() {
188 - local mycmakeargs=(
189 - -DENABLE_RUBY=OFF # TODO: add ruby support
190 - -DENABLE_PYTHON=$(usex python)
191 - -DCMAKE_DISABLE_FIND_PACKAGE_ImageMagick=$(usex !imagemagick)
192 - )
193 - use python && mycmakeargs+=(
194 - -DPYTHON_EXECUTABLE="${PYTHON}"
195 - -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
196 - -DPYTHON_LIBRARY="$(python_get_library_path)"
197 - )
198 - cmake-utils_src_configure
199 -}
200 -
201 -src_test() {
202 - cmake-utils_src_make test
203 -}
204 -
205 -src_install() {
206 - cmake-utils_src_install
207 - python_optimize
208 -}
209
210 diff --git a/media-libs/libopenshot/libopenshot-0.2.2-imagemagick7.patch b/media-libs/libopenshot/libopenshot-0.2.2-imagemagick7.patch
211 new file mode 100644
212 index 00000000000..bc5f738d7f6
213 --- /dev/null
214 +++ b/media-libs/libopenshot/libopenshot-0.2.2-imagemagick7.patch
215 @@ -0,0 +1,78 @@
216 +diff -Nru a/include/TextReader.h b/include/TextReader.h
217 +--- a/include/TextReader.h 2018-09-22 21:47:46.000000000 +0200
218 ++++ b/include/TextReader.h 2018-09-23 16:17:21.212888285 +0200
219 +@@ -91,7 +91,7 @@
220 + string text_color;
221 + string background_color;
222 + std::shared_ptr<Magick::Image> image;
223 +- list<Magick::Drawable> lines;
224 ++ vector<Magick::Drawable> lines;
225 + bool is_open;
226 + GravityType gravity;
227 +
228 +diff -Nru a/src/Frame.cpp b/src/Frame.cpp
229 +--- a/src/Frame.cpp 2018-09-22 21:47:46.000000000 +0200
230 ++++ b/src/Frame.cpp 2018-09-23 16:21:44.921563711 +0200
231 +@@ -29,6 +29,9 @@
232 +
233 + using namespace std;
234 + using namespace openshot;
235 ++#ifdef USE_IMAGEMAGICK
236 ++using namespace Magick;
237 ++#endif
238 +
239 + // Constructor - blank frame (300x200 blank image, 48kHz audio silence)
240 + Frame::Frame() : number(1), pixel_ratio(1,1), channels(2), width(1), height(1), color("#000000"),
241 +@@ -904,7 +907,7 @@
242 + // Give image a transparent background color
243 + magick_image->backgroundColor(Magick::Color("none"));
244 + magick_image->virtualPixelMethod(Magick::TransparentVirtualPixelMethod);
245 +- magick_image->matte(true);
246 ++ magick_image->alpha(true);
247 +
248 + return magick_image;
249 + }
250 +@@ -926,13 +929,14 @@
251 + // Iterate through the pixel packets, and load our own buffer
252 + // Each color needs to be scaled to 8 bit (using the ImageMagick built-in ScaleQuantumToChar function)
253 + int numcopied = 0;
254 +- Magick::PixelPacket *pixels = new_image->getPixels(0,0, new_image->columns(), new_image->rows());
255 ++ const Quantum *pixels = new_image->getConstPixels(0,0, new_image->columns(), new_image->rows());
256 + for (int n = 0, i = 0; n < new_image->columns() * new_image->rows(); n += 1, i += 4) {
257 +- buffer[i+0] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].red);
258 +- buffer[i+1] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].green);
259 +- buffer[i+2] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].blue);
260 +- buffer[i+3] = 255 - MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].opacity);
261 ++ buffer[i+0] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelRed(new_image->image(), pixels));
262 ++ buffer[i+1] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelGreen(new_image->image(), pixels));
263 ++ buffer[i+2] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelBlue(new_image->image(), pixels));
264 ++ buffer[i+3] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelAlpha(new_image->image(), pixels));
265 + numcopied+=4;
266 ++ pixels += MagickCore::GetPixelChannels(new_image->image());
267 + }
268 +
269 + // Create QImage of frame data
270 +diff -Nru a/src/ImageReader.cpp b/src/ImageReader.cpp
271 +--- a/src/ImageReader.cpp 2018-09-22 21:47:46.000000000 +0200
272 ++++ b/src/ImageReader.cpp 2018-09-23 16:22:32.330865516 +0200
273 +@@ -59,7 +59,7 @@
274 +
275 + // Give image a transparent background color
276 + image->backgroundColor(Magick::Color("none"));
277 +- image->matte(true);
278 ++ image->alpha(true);
279 + }
280 + catch (Magick::Exception e) {
281 + // raise exception
282 +diff -Nru a/src/ImageWriter.cpp b/src/ImageWriter.cpp
283 +--- a/src/ImageWriter.cpp 2018-09-22 21:47:46.000000000 +0200
284 ++++ b/src/ImageWriter.cpp 2018-09-23 16:22:58.380031419 +0200
285 +@@ -97,7 +97,7 @@
286 + std::shared_ptr<Magick::Image> frame_image = frame->GetMagickImage();
287 + frame_image->magick( info.vcodec );
288 + frame_image->backgroundColor(Magick::Color("none"));
289 +- frame_image->matte(true);
290 ++ frame_image->alpha(true);
291 + frame_image->quality(image_quality);
292 + frame_image->animationDelay(info.video_timebase.ToFloat() * 100);
293 + frame_image->animationIterations(number_of_loops);