svn commit: r375672 - in head: graphics/swftools/files java/openjdk8/files net-im/kmess-kde4/files
Antoine Brodin
antoine at FreeBSD.org
Sat Dec 27 07:38:02 UTC 2014
Author: antoine
Date: Sat Dec 27 07:37:59 2014
New Revision: 375672
URL: https://svnweb.freebsd.org/changeset/ports/375672
QAT: https://qat.redports.org/buildarchive/r375672/
Log:
Allow building with either giflib 4.2 or 5.0
Added:
head/java/openjdk8/files/patch-jdk_src_share_native_sun_awt_splashscreen_splashscreen__gif.c (contents, props changed)
head/net-im/kmess-kde4/files/patch-contrib_isf-qt_src_isfqt.cpp (contents, props changed)
Modified:
head/graphics/swftools/files/patch-gif2swf.c
Modified: head/graphics/swftools/files/patch-gif2swf.c
==============================================================================
--- head/graphics/swftools/files/patch-gif2swf.c Sat Dec 27 01:27:50 2014 (r375671)
+++ head/graphics/swftools/files/patch-gif2swf.c Sat Dec 27 07:37:59 2014 (r375672)
@@ -1,37 +1,76 @@
---- src/gif2swf.c.orig 2011-01-02 04:30:29.000000000 +0100
-+++ src/gif2swf.c 2012-06-03 06:43:44.000000000 +0200
-@@ -65,6 +65,16 @@
+--- src/gif2swf.c.orig 2011-01-02 03:30:29 UTC
++++ src/gif2swf.c
+@@ -65,6 +65,25 @@ enum disposal_method {
RESTORE_TO_PREVIOUS
};
+static void
++#if GIFLIB_MAJOR >= 5
++localPrintGifError(int ErrorCode)
++#else
+localPrintGifError(void)
++#endif
+{
++#if GIFLIB_MAJOR >= 5
++ char *Err = GifErrorString(ErrorCode);
++#else
+ char *Err = GifErrorString();
++ int ErrorCode = GifError();
++#endif
+
+ if (Err != NULL)
+ fprintf(stderr, "\nGIF-LIB error: %s.\n", Err);
+ else
-+ fprintf(stderr, "\nGIF-LIB undefined error %d.\n", GifError());
++ fprintf(stderr, "\nGIF-LIB undefined error %d.\n", ErrorCode);
+}
void SetFrameAction(TAG ** t, const char *src, int ver)
{
-@@ -236,7 +246,7 @@
+@@ -230,13 +249,21 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, c
+ }
+ fclose(fi);
+
++#if GIFLIB_MAJOR >= 5
++ if ((gft = DGifOpenFileName(sname, NULL)) == NULL) {
++#else
+ if ((gft = DGifOpenFileName(sname)) == NULL) {
++#endif
+ fprintf(stderr, "%s is not a GIF file!\n", sname);
+ return t;
}
if (DGifSlurp(gft) != GIF_OK) {
- PrintGifError();
++#if GIFLIB_MAJOR >= 5
++ localPrintGifError(gft->Error);
++#else
+ localPrintGifError();
++#endif
return t;
}
-@@ -499,7 +509,7 @@
+@@ -488,7 +515,11 @@ int CheckInputFile(char *fname, char **r
+ }
+ fclose(fi);
+
++#if GIFLIB_MAJOR >= 5
++ if ((gft = DGifOpenFileName(s, NULL)) == NULL) {
++#else
+ if ((gft = DGifOpenFileName(s)) == NULL) {
++#endif
+ fprintf(stderr, "%s is not a GIF file!\n", fname);
+ return -1;
+ }
+@@ -499,7 +530,11 @@ int CheckInputFile(char *fname, char **r
global.max_image_height = gft->SHeight;
if (DGifSlurp(gft) != GIF_OK) {
- PrintGifError();
++#if GIFLIB_MAJOR >= 5
++ localPrintGifError(gft->Error);
++#else
+ localPrintGifError();
++#endif
return -1;
}
// After DGifSlurp() call, gft->ImageCount become available
Added: head/java/openjdk8/files/patch-jdk_src_share_native_sun_awt_splashscreen_splashscreen__gif.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/java/openjdk8/files/patch-jdk_src_share_native_sun_awt_splashscreen_splashscreen__gif.c Sat Dec 27 07:37:59 2014 (r375672)
@@ -0,0 +1,14 @@
+--- jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c.orig 2014-03-04 02:59:38 UTC
++++ jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c
+@@ -318,7 +318,11 @@ SplashDecodeGif(Splash * splash, GifFile
+ int
+ SplashDecodeGifStream(Splash * splash, SplashStream * stream)
+ {
++#if GIFLIB_MAJOR >= 5
++ GifFileType *gif = DGifOpen((void *) stream, SplashStreamGifInputFunc, NULL);
++#else
+ GifFileType *gif = DGifOpen((void *) stream, SplashStreamGifInputFunc);
++#endif
+
+ if (!gif)
+ return 0;
Added: head/net-im/kmess-kde4/files/patch-contrib_isf-qt_src_isfqt.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-im/kmess-kde4/files/patch-contrib_isf-qt_src_isfqt.cpp Sat Dec 27 07:37:59 2014 (r375672)
@@ -0,0 +1,92 @@
+--- contrib/isf-qt/src/isfqt.cpp.orig 2012-02-18 16:28:01 UTC
++++ contrib/isf-qt/src/isfqt.cpp
+@@ -489,7 +489,11 @@ QByteArray Stream::writerGif( const Draw
+
+ // Open the gif file
+ gifData.open( QIODevice::WriteOnly );
++#if GIFLIB_MAJOR >= 5
++ gifImage = EGifOpen( (void*)&gifData, GifWriteToByteArray, NULL );
++#else
+ gifImage = EGifOpen( (void*)&gifData, GifWriteToByteArray );
++#endif
+ if( gifImage == 0 )
+ {
+ qWarning() << "Couldn't initialize gif library!";
+@@ -503,7 +507,11 @@ QByteArray Stream::writerGif( const Draw
+ numColors = 256;
+ }
+
++#if GIFLIB_MAJOR >= 5
++ cmap = GifMakeMapObject( numColors, NULL );
++#else
+ cmap = MakeMapObject( numColors, NULL );
++#endif
+ if( cmap == 0 && isfImage.numColors() > 1 )
+ {
+ qWarning() << "Couldn't create map object for gif conversion (colors:" << isfImage.numColors() << ")!";
+@@ -576,7 +584,11 @@ QByteArray Stream::writerGif( const Draw
+ else
+ {
+ // Write the extension
++#if GIFLIB_MAJOR >= 5
++ if( EGifPutExtensionLeader( gifImage, COMMENT_EXT_FUNC_CODE ) == GIF_ERROR )
++#else
+ if( EGifPutExtensionFirst( gifImage, COMMENT_EXT_FUNC_CODE, MAX_GIF_BYTE, isfData.left( MAX_GIF_BYTE ).data() ) == GIF_ERROR )
++#endif
+ {
+ qWarning() << "EGifPutExtensionFirst failed!";
+ goto writeError;
+@@ -590,7 +602,11 @@ QByteArray Stream::writerGif( const Draw
+ // Write all the full data blocks
+ while( length >= MAX_GIF_BYTE )
+ {
++#if GIFLIB_MAJOR >= 5
++ if( EGifPutExtensionBlock( gifImage, MAX_GIF_BYTE, isfData.mid( pos, MAX_GIF_BYTE ).data() ) == GIF_ERROR )
++#else
+ if( EGifPutExtensionNext( gifImage, 0, MAX_GIF_BYTE, isfData.mid( pos, MAX_GIF_BYTE ).data() ) == GIF_ERROR )
++#endif
+ {
+ qWarning() << "EGifPutExtensionNext failed!";
+ goto writeError;
+@@ -603,7 +619,11 @@ QByteArray Stream::writerGif( const Draw
+ // Write the last block
+ if( length > 0 )
+ {
++#if GIFLIB_MAJOR >= 5
++ if( EGifPutExtensionTrailer( gifImage ) == GIF_ERROR )
++#else
+ if( EGifPutExtensionLast( gifImage, 0, length, isfData.mid( pos, MAX_GIF_BYTE ).data() ) == GIF_ERROR )
++#endif
+ {
+ qWarning() << "EGifPutExtensionLast (n) failed!";
+ goto writeError;
+@@ -611,7 +631,11 @@ QByteArray Stream::writerGif( const Draw
+ }
+ else
+ {
++#if GIFLIB_MAJOR >= 5
++ if( EGifPutExtensionTrailer( gifImage ) == GIF_ERROR )
++#else
+ if( EGifPutExtensionLast( gifImage, 0, 0, 0 ) == GIF_ERROR )
++#endif
+ {
+ qWarning() << "EGifPutExtensionLast (0) failed!";
+ goto writeError;
+@@ -624,12 +648,16 @@ QByteArray Stream::writerGif( const Draw
+ writeError:
+ // Clean up the GIF converter etc
+ EGifCloseFile( gifImage );
++#if GIFLIB_MAJOR >= 5
++ GifFreeMapObject( cmap );
++#else
+ FreeMapObject( cmap );
++#endif
+ gifData.close();
+
+ if( gifError )
+ {
+- qWarning() << "GIF error code:" << GifLastError();
++ qWarning() << "GIF error";
+ }
+ else
+ {
More information about the svn-ports-head
mailing list