summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Pierre Lejeune <superheron@gmail.com> 2015-01-17 22:08:59 +0100
committerAvatar Pierre Lejeune <superheron@gmail.com> 2015-01-31 19:16:05 +0100
commit40d44fcba419dd9e807ace414f0691a5a4618e06 (patch)
tree4bc5d7f1a84c045198e5cca58f10787c74cedcab
parent03b5e55e696b932bfcd09f7ba88b5cf3c580f712 (diff)
downloadmono-40d44fcba419dd9e807ace414f0691a5a4618e06.tar.gz
mono-40d44fcba419dd9e807ace414f0691a5a4618e06.tar.xz
dev-dotnet/libgdiplus: Fix compilation with giflib-5
-rw-r--r--packages/dev-dotnet/libgdiplus/files/libgdiplus-3.12-giflib-5.patch142
-rw-r--r--packages/dev-dotnet/libgdiplus/libgdiplus-3.12.exheres-02
2 files changed, 144 insertions, 0 deletions
diff --git a/packages/dev-dotnet/libgdiplus/files/libgdiplus-3.12-giflib-5.patch b/packages/dev-dotnet/libgdiplus/files/libgdiplus-3.12-giflib-5.patch
new file mode 100644
index 0000000..3d0bfcb
--- /dev/null
+++ b/packages/dev-dotnet/libgdiplus/files/libgdiplus-3.12-giflib-5.patch
@@ -0,0 +1,142 @@
+Source: from ArchLinux: https://projects.archlinux.org/svntogit/packages.git/tree/trunk/libgdiplus0-giflib5.patch?h=packages/libgdiplus
+Upstream: submitted, GitHub pull request #26: https://github.com/mono/libgdiplus/pull/26
+Reason: Fix compilation with giflib-5
+
+---
+ src/gifcodec.c | 50 +++++++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 41 insertions(+), 9 deletions(-)
+
+Index: libgdiplus-2.10.9/src/gifcodec.c
+===================================================================
+--- libgdiplus-2.10.9.orig/src/gifcodec.c
++++ libgdiplus-2.10.9/src/gifcodec.c
+@@ -105,7 +112,7 @@ gdip_gif_inputfunc (GifFileType *gif, Gi
+ */
+
+ static int
+-AddExtensionBlockMono(SavedImage *New, int Len, BYTE ExtData[])
++AddExtensionBlockMono(SavedImage *New, int Len, int func, BYTE ExtData[])
+ {
+ ExtensionBlock *ep;
+
+@@ -129,7 +136,7 @@ AddExtensionBlockMono(SavedImage *New, i
+
+ if (ExtData) {
+ memcpy(ep->Bytes, ExtData, Len);
+- ep->Function = New->Function;
++ ep->Function = func;
+ }
+
+ return (GIF_OK);
+@@ -232,20 +239,20 @@ DGifSlurpMono(GifFileType * GifFile, Sav
+ }
+
+ case EXTENSION_RECORD_TYPE: {
+- if (DGifGetExtension(GifFile, &temp_save.Function, &ExtData) == GIF_ERROR) {
++ int func;
++ if (DGifGetExtension(GifFile, &func, &ExtData) == GIF_ERROR) {
+ return (GIF_ERROR);
+ }
+
+ while (ExtData != NULL) {
+ /* Create an extension block with our data */
+- if (AddExtensionBlockMono(&temp_save, ExtData[0], &ExtData[1]) == GIF_ERROR) {
++ if (AddExtensionBlockMono(&temp_save, func, ExtData[0], &ExtData[1]) == GIF_ERROR) {
+ return (GIF_ERROR);
+ }
+
+ if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR) {
+ return (GIF_ERROR);
+ }
+- temp_save.Function = 0;
+ }
+ break;
+ }
+@@ -303,12 +310,19 @@ gdip_load_gif_image (void *stream, GpIma
+ result = NULL;
+ loop_counter = FALSE;
+
++#if GIFLIB_MAJOR < 5
+ if (from_file) {
+ gif = DGifOpen(stream, &gdip_gif_fileinputfunc);
+ } else {
+ gif = DGifOpen (stream, &gdip_gif_inputfunc);
+ }
+-
++#else
++ if (from_file)
++ gif = DGifOpen(stream, &gdip_gif_fileinputfunc, NULL);
++ else
++ gif = DGifOpen(stream, &gdip_gif_inputfunc, NULL);
++#endif
++
+ if (gif == NULL) {
+ goto error;
+ }
+@@ -581,7 +595,7 @@ gdip_load_gif_image (void *stream, GpIma
+ }
+
+ FreeExtensionMono(&global_extensions);
+- DGifCloseFile (gif);
++ DGifCloseFile (gif, NULL);
+
+ *image = result;
+ return Ok;
+@@ -597,7 +611,7 @@ error:
+
+ if (gif != NULL) {
+ FreeExtensionMono (&global_extensions);
+- DGifCloseFile (gif);
++ DGifCloseFile (gif, NULL);
+ }
+
+ *image = NULL;
+@@ -660,11 +674,22 @@ gdip_save_gif_image (void *stream, GpIma
+ return InvalidParameter;
+ }
+
++#if GIFLIB_MAJOR < 5
+ if (from_file) {
+ fp = EGifOpenFileName (stream, 0);
+ } else {
+ fp = EGifOpen (stream, gdip_gif_outputfunc);
+ }
++#else
++ if (from_file)
++ fp = EGifOpenFileName (stream, 0, NULL);
++ else
++ fp = EGifOpen (stream, gdip_gif_outputfunc, NULL);
++#define MakeMapObject GifMakeMapObject
++#define FreeMapObject GifFreeMapObject
++#define QuantizeBuffer GifQuantizeBuffer
++#define BitSize GifBitSize
++#endif
+
+ if (!fp) {
+ return FileNotFound;
+@@ -848,8 +873,15 @@ gdip_save_gif_image (void *stream, GpIma
+ Buffer[0] = 1;
+ Buffer[1] = ptr[0];
+ Buffer[2] = ptr[1];
++#if GIFLIB_MAJOR < 5
+ EGifPutExtensionFirst(fp, APPLICATION_EXT_FUNC_CODE, 11, "NETSCAPE2.0");
+ EGifPutExtensionLast(fp, APPLICATION_EXT_FUNC_CODE, 3, Buffer);
++#else
++ EGifPutExtensionLeader(fp, APPLICATION_EXT_FUNC_CODE);
++ EGifPutExtensionBlock(fp, 11, "NETSCAPE2.0");
++ EGifPutExtensionBlock(fp, 3, Buffer);
++ EGifPutExtensionTrailer(fp);
++#endif
+ }
+ }
+
+@@ -923,7 +955,7 @@ gdip_save_gif_image (void *stream, GpIma
+ }
+ }
+
+- EGifCloseFile (fp);
++ EGifCloseFile (fp, NULL);
+
+ return Ok;
+
+
diff --git a/packages/dev-dotnet/libgdiplus/libgdiplus-3.12.exheres-0 b/packages/dev-dotnet/libgdiplus/libgdiplus-3.12.exheres-0
index 542f2c3..e264a4f 100644
--- a/packages/dev-dotnet/libgdiplus/libgdiplus-3.12.exheres-0
+++ b/packages/dev-dotnet/libgdiplus/libgdiplus-3.12.exheres-0
@@ -32,6 +32,8 @@ DEPENDENCIES="
tiff? ( media-libs/tiff )
"
+DEFAULT_SRC_PREPARE_PATCHES=( "${FILES}"/${PNV}-giflib-5.patch )
+
DEFAULT_SRC_CONFIGURE_PARAMS=( --with-libjpeg )
DEFAULT_SRC_CONFIGURE_OPTION_WITHS=(
'exif libexif'