[packages/phantomjs/dev] add giflib5 patch
glen
glen at pld-linux.org
Sun Mar 2 15:17:12 CET 2014
commit 6385d1aa2338189ee02dcc0271314980026f23fa
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sun Mar 2 14:16:46 2014 +0000
add giflib5 patch
giflib5.patch | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
phantomjs.spec | 3 +++
2 files changed, 51 insertions(+)
---
diff --git a/phantomjs.spec b/phantomjs.spec
index d5a28e9..8e17480 100644
--- a/phantomjs.spec
+++ b/phantomjs.spec
@@ -6,6 +6,7 @@ License: BSD
Group: Applications/Networking
Source0: https://bitbucket.org/ariya/phantomjs/downloads/%{name}-%{version}-source.zip
# Source0-md5: 5d308d2db7d8b494f99dbb5664447547
+Patch0: giflib5.patch
Patch1: 0001-gifwriter-bgcolor-narrowing.patch
Patch2: 0002-unbundle-giflib.patch
Patch3: 0003-unbundle-mongoose.patch
@@ -49,7 +50,9 @@ rm -r src/qt
rm -r src/linenoise
rm -r src/qcommandline
rm -r src/coffee-script
+rm -r src/breakpad
+%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
diff --git a/giflib5.patch b/giflib5.patch
new file mode 100644
index 0000000..79b906a
--- /dev/null
+++ b/giflib5.patch
@@ -0,0 +1,48 @@
+https://github.com/ariya/phantomjs/pull/11760
+https://github.com/bmanojlovic/phantomjs/commit/f504f5316fe0a170bf41327b1715f806d8592d9a.patch
+
+From f504f5316fe0a170bf41327b1715f806d8592d9a Mon Sep 17 00:00:00 2001
+From: Boris Manojlovic <boris.manojlovic at zis.co.rs>
+Date: Mon, 18 Nov 2013 08:02:05 +0100
+Subject: [PATCH] add giflib5 support to codebase
+
+---
+ src/gif/gifwriter.cpp | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/src/gif/gifwriter.cpp b/src/gif/gifwriter.cpp
+index c0a010c..5a8647e 100644
+--- a/src/gif/gifwriter.cpp
++++ b/src/gif/gifwriter.cpp
+@@ -34,6 +34,12 @@
+ #include <QImage>
+ #include <QFile>
+
++#if defined GIFLIB_MAJOR && GIFLIB_MAJOR >=5
++#define EGifOpenFileName(a, b) EGifOpenFileName(a, b, NULL)
++#define EGifOpen(a, b) EGifOpen(a, b, NULL)
++#define QuantizeBuffer GifQuantizeBuffer
++#endif
++
+ static int saveGifBlock(GifFileType *gif, const GifByteType *data, int i)
+ {
+ QFile *file = (QFile*)(gif->UserData);
+@@ -100,9 +106,14 @@ bool exportGif(const QImage &img, const QString &fileName)
+ if (qAlpha(colorTable[c]) == 0)
+ bgcolor = c;
+ }
+- EGifSetGifVersion("87a");
+
++#if defined GIFLIB_MAJOR && GIFLIB_MAJOR >= 5
++ GifFileType *gif = EGifOpen(&file, saveGifBlock);
++ EGifSetGifVersion(gif, false);
++#else
++ EGifSetGifVersion("87a");
+ GifFileType *gif = EGifOpen(&file, saveGifBlock);
++#endif
+ gif->ImageCount = 1;
+ EGifPutScreenDesc(gif, image.width(), image.height(), 256, 0, &cmap);
+ if (bgcolor >= 0) {
+--
+1.8.5.5
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/phantomjs.git/commitdiff/6385d1aa2338189ee02dcc0271314980026f23fa
More information about the pld-cvs-commit
mailing list