1 |
commit: 73517ac75958a14ba307612decaae65a0c30699e |
2 |
Author: ChaosEngine <andrzej.pauli <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon Nov 21 15:25:39 2016 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 26 11:06:27 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73517ac7 |
7 |
|
8 |
media-video/qgifer: Port codebase to >=media-libs/giflib-5.1 |
9 |
|
10 |
Gentoo-bug: 536634 |
11 |
Closes: https://github.com/gentoo/gentoo/pull/2881 |
12 |
|
13 |
.../qgifer/files/qgifer-0.2.1-giflib5.patch | 157 +++++++++++++++++++++ |
14 |
media-video/qgifer/qgifer-0.2.1-r5.ebuild | 50 +++++++ |
15 |
2 files changed, 207 insertions(+) |
16 |
|
17 |
diff --git a/media-video/qgifer/files/qgifer-0.2.1-giflib5.patch b/media-video/qgifer/files/qgifer-0.2.1-giflib5.patch |
18 |
new file mode 100644 |
19 |
index 00000000..9ddfdac |
20 |
--- /dev/null |
21 |
+++ b/media-video/qgifer/files/qgifer-0.2.1-giflib5.patch |
22 |
@@ -0,0 +1,157 @@ |
23 |
+Port qgifer to giflib 5 API. |
24 |
+See also: https://bugs.gentoo.org/show_bug.cgi?id=536634 |
25 |
+ |
26 |
+--- a/src/gifcreator.cpp |
27 |
++++ b/src/gifcreator.cpp |
28 |
+@@ -38,7 +38,7 @@ |
29 |
+ j--; |
30 |
+ } |
31 |
+ for(int i=0;i<cmaps.size();i++) |
32 |
+- FreeMapObject(cmaps[i]); |
33 |
++ GifFreeMapObject(cmaps[i]); |
34 |
+ } |
35 |
+ |
36 |
+ |
37 |
+@@ -52,7 +52,7 @@ |
38 |
+ } |
39 |
+ |
40 |
+ |
41 |
+- GifFileType *GifFile = EGifOpenFileName(filename, FALSE); |
42 |
++ GifFileType *GifFile = EGifOpenFileName(filename, 0, NULL); |
43 |
+ |
44 |
+ if (!GifFile){ |
45 |
+ PrintGifError(); |
46 |
+@@ -74,7 +74,7 @@ |
47 |
+ { |
48 |
+ char nsle[12] = "NETSCAPE2.0"; |
49 |
+ char subblock[3]; |
50 |
+- if (EGifPutExtensionFirst(GifFile, APPLICATION_EXT_FUNC_CODE, 11, nsle) == GIF_ERROR) { |
51 |
++ if (EGifPutExtension(GifFile, APPLICATION_EXT_FUNC_CODE, 11, nsle) == GIF_ERROR) { |
52 |
+ PrintGifError(); |
53 |
+ return false; |
54 |
+ } |
55 |
+@@ -82,7 +82,7 @@ |
56 |
+ subblock[2] = loop_count % 256; |
57 |
+ subblock[1] = loop_count / 256; |
58 |
+ |
59 |
+- if (EGifPutExtensionLast(GifFile, APPLICATION_EXT_FUNC_CODE, 3, subblock) == GIF_ERROR) { |
60 |
++ if (EGifPutExtension(GifFile, APPLICATION_EXT_FUNC_CODE, 3, subblock) == GIF_ERROR) { |
61 |
+ PrintGifError(); |
62 |
+ return false; |
63 |
+ } |
64 |
+@@ -111,7 +111,7 @@ |
65 |
+ |
66 |
+ if (EGifPutImageDesc( |
67 |
+ GifFile, |
68 |
+- 0, 0, w, h, FALSE, cmaps.size() > ni ? cmaps.at(ni) : cmaps.at(cmaps.size()-1) |
69 |
++ 0, 0, w, h, 0, cmaps.size() > ni ? cmaps.at(ni) : cmaps.at(cmaps.size()-1) |
70 |
+ ) == GIF_ERROR) { |
71 |
+ PrintGifError(); |
72 |
+ endProgress(); |
73 |
+@@ -135,7 +135,7 @@ |
74 |
+ return false; |
75 |
+ } |
76 |
+ |
77 |
+- if (EGifCloseFile(GifFile) == GIF_ERROR) { |
78 |
++ if (EGifCloseFile(GifFile, NULL) == GIF_ERROR) { |
79 |
+ PrintGifError(); |
80 |
+ endProgress(); |
81 |
+ return false; |
82 |
+--- a/src/gifcreator.h |
83 |
++++ b/src/gifcreator.h |
84 |
+@@ -31,6 +31,12 @@ |
85 |
+ typedef vector<GifByteType> Frame; |
86 |
+ typedef unsigned char Byte; |
87 |
+ |
88 |
++static inline void |
89 |
++PrintGifError() |
90 |
++{ |
91 |
++ fprintf(stderr, "\nGIF-LIB error: %s.\n", GifErrorString(GIF_ERROR)); |
92 |
++} |
93 |
++ |
94 |
+ class GifCreator |
95 |
+ { |
96 |
+ |
97 |
+--- a/src/palettewidget.cpp |
98 |
++++ b/src/palettewidget.cpp |
99 |
+@@ -34,7 +34,7 @@ |
100 |
+ |
101 |
+ PaletteWidget::~PaletteWidget() |
102 |
+ { |
103 |
+- FreeMapObject(palette); |
104 |
++ GifFreeMapObject(palette); |
105 |
+ } |
106 |
+ |
107 |
+ void PaletteWidget::paintEvent(QPaintEvent*) |
108 |
+@@ -117,7 +117,7 @@ |
109 |
+ if(palette && mindiff > 1) |
110 |
+ { |
111 |
+ qDebug() << "deleting old palette, size: " << size << ", colors: " << palette->ColorCount; |
112 |
+- FreeMapObject(palette); |
113 |
++ GifFreeMapObject(palette); |
114 |
+ qDebug() << "done"; |
115 |
+ palette = NULL; |
116 |
+ } |
117 |
+@@ -157,7 +157,7 @@ |
118 |
+ } |
119 |
+ |
120 |
+ ColorMapObject* previous = palette; |
121 |
+- palette = MakeMapObject(size, NULL); |
122 |
++ palette = GifMakeMapObject(size, NULL); |
123 |
+ if (!palette) |
124 |
+ { |
125 |
+ qDebug() << "NULL palette!"; |
126 |
+@@ -165,7 +165,7 @@ |
127 |
+ } |
128 |
+ |
129 |
+ |
130 |
+- if (QuantizeBuffer(fimg.width(), fimg.height(), &size, |
131 |
++ if (GifQuantizeBuffer(fimg.width(), fimg.height(), &size, |
132 |
+ &(r[0]),&(g[0]),&(b[0]), &(output[0]), |
133 |
+ palette->Colors) == GIF_ERROR) |
134 |
+ { |
135 |
+@@ -178,11 +178,11 @@ |
136 |
+ //qDebug() << "difference: " << df; |
137 |
+ if(previous && df < mindiff) |
138 |
+ { |
139 |
+- FreeMapObject(palette); |
140 |
++ GifFreeMapObject(palette); |
141 |
+ palette = previous; |
142 |
+ } |
143 |
+ else if(df >= mindiff) |
144 |
+- FreeMapObject(previous); |
145 |
++ GifFreeMapObject(previous); |
146 |
+ |
147 |
+ // qDebug() << "palette (" << palette->ColorCount << ") :"; |
148 |
+ // for(int i=0;i<size;i++) |
149 |
+@@ -230,8 +230,8 @@ |
150 |
+ { |
151 |
+ QStringList rgb = QString(str).split(";", QString::SkipEmptyParts); |
152 |
+ if(palette) |
153 |
+- FreeMapObject(palette); |
154 |
+- palette = MakeMapObject(rgb.size(), NULL); |
155 |
++ GifFreeMapObject(palette); |
156 |
++ palette = GifMakeMapObject(rgb.size(), NULL); |
157 |
+ if(!palette) |
158 |
+ return false; |
159 |
+ size = rgb.size(); |
160 |
+--- a/src/palettewidget.h |
161 |
++++ b/src/palettewidget.h |
162 |
+@@ -30,7 +30,7 @@ |
163 |
+ PaletteWidget(QWidget* parent=0, Qt::WindowFlags f=0); |
164 |
+ virtual ~PaletteWidget(); |
165 |
+ ColorMapObject* map() {return palette;} |
166 |
+- ColorMapObject* mapCopy() {return MakeMapObject(palette->ColorCount, palette->Colors);} |
167 |
++ ColorMapObject* mapCopy() {return GifMakeMapObject(palette->ColorCount, palette->Colors);} |
168 |
+ bool fromImage(const QImage& img, int palette_size, float mindiff = 2); |
169 |
+ void setColumnCount(int cc){cols = cc;} |
170 |
+ bool toFile(const QString& path); |
171 |
+@@ -38,7 +38,7 @@ |
172 |
+ QString toString(); |
173 |
+ bool fromString(const QString& str); |
174 |
+ int getSize() const {return size;} |
175 |
+- void clear() {if(palette) FreeMapObject(palette); palette = NULL; update();} |
176 |
++ void clear() {if(palette) GifFreeMapObject(palette); palette = NULL; update();} |
177 |
+ private: |
178 |
+ int size; |
179 |
+ int cols; |
180 |
|
181 |
diff --git a/media-video/qgifer/qgifer-0.2.1-r5.ebuild b/media-video/qgifer/qgifer-0.2.1-r5.ebuild |
182 |
new file mode 100644 |
183 |
index 00000000..554e243 |
184 |
--- /dev/null |
185 |
+++ b/media-video/qgifer/qgifer-0.2.1-r5.ebuild |
186 |
@@ -0,0 +1,50 @@ |
187 |
+# Copyright 1999-2016 Gentoo Foundation |
188 |
+# Distributed under the terms of the GNU General Public License v2 |
189 |
+# $Id$ |
190 |
+ |
191 |
+EAPI=6 |
192 |
+ |
193 |
+inherit cmake-utils |
194 |
+ |
195 |
+DESCRIPTION="A video-based animated GIF creator" |
196 |
+HOMEPAGE="https://sourceforge.net/projects/qgifer/" |
197 |
+SRC_URI="mirror://sourceforge/${PN}/${P}-source.tar.gz" |
198 |
+ |
199 |
+LICENSE="GPL-3+" |
200 |
+SLOT="0" |
201 |
+KEYWORDS="~amd64 ~x86" |
202 |
+ |
203 |
+IUSE="debug imagemagick opencv3" |
204 |
+ |
205 |
+RDEPEND=" |
206 |
+ >=media-libs/giflib-5.1:= |
207 |
+ dev-qt/qtcore:4 |
208 |
+ dev-qt/qtgui:4 |
209 |
+ virtual/ffmpeg:0 |
210 |
+ imagemagick? ( media-gfx/imagemagick:0 ) |
211 |
+ !opencv3? ( <media-libs/opencv-3.0.0:0=[ffmpeg] ) |
212 |
+ opencv3? ( >=media-libs/opencv-3.0.0:0=[ffmpeg] )" |
213 |
+DEPEND="${RDEPEND}" |
214 |
+ |
215 |
+S="${WORKDIR}/${P}-source" |
216 |
+ |
217 |
+PATCHES=( |
218 |
+ "${FILESDIR}/${P}-desktop.patch" |
219 |
+ # Port to giflib 5 API |
220 |
+ "${FILESDIR}/${P}-giflib5.patch" |
221 |
+) |
222 |
+ |
223 |
+src_prepare(){ |
224 |
+ use opencv3 && PATCHES+=( "${FILESDIR}/${P}-opencv3.patch" ) |
225 |
+ cmake-utils_src_prepare |
226 |
+ |
227 |
+ # Fix the doc path |
228 |
+ sed -i -e "s|share/doc/qgifer|share/doc/${PF}|" CMakeLists.txt || die |
229 |
+} |
230 |
+ |
231 |
+src_configure() { |
232 |
+ local mycmakeargs=( |
233 |
+ $(usex debug '-DRELEASE_MODE=OFF' '') |
234 |
+ ) |
235 |
+ cmake-utils_src_configure |
236 |
+} |