Accepting request 827595 from Mono:Factory

- Update to version 6.0.4
  * No changelog upstream.
- Drop libgdiplus-giflib5.patch, upstreamed
- Drop libgdiplus-libjpeg_prefix.patch, upstreamed
- Disable tests for now, some newly introduced tests
  didn't run at all

OBS-URL: https://build.opensuse.org/request/show/827595
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libgdiplus?expand=0&rev=3
This commit is contained in:
Dominique Leuenberger 2020-08-23 07:19:10 +00:00 committed by Git OBS Bridge
commit f34bcc6114
6 changed files with 25 additions and 321 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e61c4dc1bc2ba993e4f79029472efcf5760eb9e60eb20d9cd31f0ebe9113bfc9
size 688120

3
libgdiplus-6.0.4.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b75c38c9765d5b3e2fb3da4435f169c732983878c0f94b8bf9012137022abf29
size 1390998

View File

@ -1,251 +0,0 @@
From 0da7cde2a9d8248fe8f6472777d63ba5ba5d4303 Mon Sep 17 00:00:00 2001
Message-Id: <0da7cde2a9d8248fe8f6472777d63ba5ba5d4303.1428776341.git.mailaender@opensuse.org>
From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= <mailaender@opensuse.org>
Date: Sat, 11 Apr 2015 18:09:13 +0200
Subject: [PATCH] fix compilation with giflib version 5
---
src/gifcodec.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 71 insertions(+), 17 deletions(-)
diff --git a/src/gifcodec.c b/src/gifcodec.c
index e1a0697..6f8dedb 100644
--- a/src/gifcodec.c
+++ b/src/gifcodec.c
@@ -39,10 +39,6 @@ GUID gdip_gif_image_format_guid = {0xb96b3cb0U, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0
#include "gifcodec.h"
-#ifdef EgifOpen
-/* giflib declares this incorrectly as EgifOpen */
-extern GifFileType *EGifOpen(void *userData, OutputFunc writeFunc);
-#endif
/* Data structure used for callback */
typedef struct
@@ -107,7 +103,7 @@ gdip_gif_inputfunc (GifFileType *gif, GifByteType *data, int len)
*/
static int
-AddExtensionBlockMono(SavedImage *New, int Len, BYTE ExtData[])
+AddExtensionBlockMono(SavedImage *New, int Function, int Len, BYTE ExtData[])
{
ExtensionBlock *ep;
@@ -123,15 +119,15 @@ AddExtensionBlockMono(SavedImage *New, int Len, BYTE ExtData[])
ep = &New->ExtensionBlocks[New->ExtensionBlockCount++];
+ ep->Function = Function;
ep->ByteCount=Len;
- ep->Bytes = (char *)GdipAlloc(ep->ByteCount);
+ ep->Bytes = (GifByteType *)GdipAlloc(ep->ByteCount);
if (ep->Bytes == NULL) {
return (GIF_ERROR);
}
if (ExtData) {
memcpy(ep->Bytes, ExtData, Len);
- ep->Function = New->Function;
}
return (GIF_OK);
@@ -168,6 +164,7 @@ static int
DGifSlurpMono(GifFileType * GifFile, SavedImage *TrailingExtensions)
{
int ImageSize;
+ int Function;
GifRecordType RecordType;
SavedImage *sp;
GifByteType *ExtData;
@@ -234,20 +231,19 @@ DGifSlurpMono(GifFileType * GifFile, SavedImage *TrailingExtensions)
}
case EXTENSION_RECORD_TYPE: {
- if (DGifGetExtension(GifFile, &temp_save.Function, &ExtData) == GIF_ERROR) {
+ if (DGifGetExtension(GifFile, &Function, &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, Function, ExtData[0], &ExtData[1]) == GIF_ERROR) {
return (GIF_ERROR);
}
if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR) {
return (GIF_ERROR);
}
- temp_save.Function = 0;
}
break;
}
@@ -306,9 +302,17 @@ gdip_load_gif_image (void *stream, GpImage **image, BOOL from_file)
loop_counter = FALSE;
if (from_file) {
+#if GIFLIB_MAJOR >= 5
+ gif = DGifOpen(stream, &gdip_gif_fileinputfunc, NULL);
+#else
gif = DGifOpen(stream, &gdip_gif_fileinputfunc);
+#endif
} else {
+#if GIFLIB_MAJOR >= 5
+ gif = DGifOpen (stream, &gdip_gif_inputfunc, NULL);
+#else
gif = DGifOpen (stream, &gdip_gif_inputfunc);
+#endif
}
if (gif == NULL) {
@@ -583,8 +587,11 @@ gdip_load_gif_image (void *stream, GpImage **image, BOOL from_file)
}
FreeExtensionMono(&global_extensions);
+#if (GIFLIB_MAJOR > 5) || ((GIFLIB_MAJOR == 5) && (GIFLIB_MINOR >= 1))
+ DGifCloseFile (gif, NULL);
+#else
DGifCloseFile (gif);
-
+#endif
*image = result;
return Ok;
@@ -599,7 +606,11 @@ error:
if (gif != NULL) {
FreeExtensionMono (&global_extensions);
+#if (GIFLIB_MAJOR > 5) || ((GIFLIB_MAJOR == 5) && (GIFLIB_MINOR >= 1))
+ DGifCloseFile (gif, NULL);
+#else
DGifCloseFile (gif);
+#endif
}
*image = NULL;
@@ -663,9 +674,17 @@ gdip_save_gif_image (void *stream, GpImage *image, BOOL from_file)
}
if (from_file) {
+#if GIFLIB_MAJOR >= 5
+ fp = EGifOpenFileName (stream, 0, NULL);
+#else
fp = EGifOpenFileName (stream, 0);
+#endif
} else {
+#if GIFLIB_MAJOR >= 5
+ fp = EGifOpen (stream, gdip_gif_outputfunc, NULL);
+#else
fp = EGifOpen (stream, gdip_gif_outputfunc);
+#endif
}
if (!fp) {
@@ -704,8 +723,11 @@ gdip_save_gif_image (void *stream, GpImage *image, BOOL from_file)
goto error;
}
+#if GIFLIB_MAJOR >= 5
+ cmap = GifMakeMapObject(cmap_size, 0);
+#else
cmap = MakeMapObject(cmap_size, 0);
-
+#endif
pixbuf = GdipAlloc(pixbuf_size);
if (pixbuf == NULL) {
goto error;
@@ -795,8 +817,11 @@ gdip_save_gif_image (void *stream, GpImage *image, BOOL from_file)
pixbuf = pixbuf_org;
} else {
cmap_size = 256;
+#if GIFLIB_MAJOR >= 5
+ cmap = GifMakeMapObject (cmap_size, 0);
+#else
cmap = MakeMapObject (cmap_size, 0);
-
+#endif
red = GdipAlloc(pixbuf_size);
green = GdipAlloc(pixbuf_size);
blue = GdipAlloc(pixbuf_size);
@@ -826,13 +851,23 @@ gdip_save_gif_image (void *stream, GpImage *image, BOOL from_file)
v += 4;
}
}
- if (QuantizeBuffer(bitmap_data->width, bitmap_data->height, &cmap_size,
+ if (
+#if GIFLIB_MAJOR >= 5
+ GifQuantizeBuffer(
+#else
+ QuantizeBuffer(
+#endif
+ bitmap_data->width, bitmap_data->height, &cmap_size,
red, green, blue, pixbuf, cmap->Colors) == GIF_ERROR) {
goto error;
}
}
+#if GIFLIB_MAJOR >= 5
+ cmap->BitsPerPixel = GifBitSize (cmap_size);
+#else
cmap->BitsPerPixel = BitSize (cmap_size);
+#endif
cmap->ColorCount = 1 << cmap->BitsPerPixel;
if ((frame == 0) && (k == 0)) {
@@ -850,8 +885,15 @@ gdip_save_gif_image (void *stream, GpImage *image, BOOL from_file)
Buffer[0] = 1;
Buffer[1] = ptr[0];
Buffer[2] = ptr[1];
- EGifPutExtensionFirst(fp, APPLICATION_EXT_FUNC_CODE, 11, "NETSCAPE2.0");
- EGifPutExtensionLast(fp, APPLICATION_EXT_FUNC_CODE, 3, Buffer);
+#if GIFLIB_MAJOR >= 5
+ EGifPutExtensionLeader(fp, APPLICATION_EXT_FUNC_CODE);
+ EGifPutExtensionBlock(fp, 11, "NETSCAPE2.0");
+ EGifPutExtensionBlock(fp, 3, Buffer);
+ EGifPutExtensionTrailer(fp);
+#else
+ EGifPutExtensionFirst(fp, APPLICATION_EXT_FUNC_CODE, 11, "NETSCAPE2.0");
+ EGifPutExtensionLast(fp, APPLICATION_EXT_FUNC_CODE, 3, Buffer);
+#endif
}
}
@@ -903,7 +945,11 @@ gdip_save_gif_image (void *stream, GpImage *image, BOOL from_file)
pixbuf += bitmap_data->width;
}
+#if GIFLIB_MAJOR >= 5
+ GifFreeMapObject (cmap);
+#else
FreeMapObject (cmap);
+#endif
if (red != NULL) {
GdipFree (red);
}
@@ -925,13 +971,21 @@ gdip_save_gif_image (void *stream, GpImage *image, BOOL from_file)
}
}
- EGifCloseFile (fp);
+#if (GIFLIB_MAJOR > 5) || ((GIFLIB_MAJOR == 5) && (GIFLIB_MINOR >= 1))
+ EGifCloseFile (fp, NULL);
+#else
+ EGifCloseFile (fp);
+#endif
return Ok;
error:
if (cmap != NULL) {
+#if GIFLIB_MAJOR >= 5
+ GifFreeMapObject (cmap);
+#else
FreeMapObject (cmap);
+#endif
}
if (red != NULL) {
--
2.1.4

View File

@ -1,46 +0,0 @@
Index: libgdiplus-3.12/configure.ac
===================================================================
--- libgdiplus-3.12.orig/configure.ac
+++ libgdiplus-3.12/configure.ac
@@ -203,10 +203,6 @@ AC_ARG_WITH([libjpeg],
[libjpeg_prefix="$withval"], [libjpeg_prefix="${prefix}"])
if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
- JPEG_CFLAGS="-I${libjpeg_prefix}/include"
- JPEG_LIBS="-L${libjpeg_prefix}/lib"
- save_cflags=$CFLAGS; CFLAGS=$JPEG_CFLAGS
- save_libs=$LIBS; LIBS=$JPEG_LIBS
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
jpeg_ok=yes,
jpeg_ok=no
@@ -223,7 +219,7 @@ AC_ARG_WITH([libjpeg],
jpeg_ok=no)
AC_MSG_RESULT($jpeg_ok)
if test "$jpeg_ok" = yes; then
- JPEG='jpeg'; LIBJPEG='-L${libjpeg_prefix}/lib -ljpeg'
+ JPEG='jpeg'; LIBJPEG='-ljpeg'
else
AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
fi
@@ -246,10 +242,6 @@ AC_ARG_WITH([libtiff],
[libtiff_prefix="$withval"], [libtiff_prefix="${prefix}"])
if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
- TIFF_CFLAGS="-I${libjpeg_prefix}/include -I${libtiff_prefix}/include"
- TIFF_LIBS="-L${libjpeg_prefix}/lib -L${libtiff_prefix}/lib"
- save_cflags=$CFLAGS; CFLAGS=$TIFF_CFLAGS
- save_libs=$LIBS; LIBS=$TIFF_LIBS
AC_CHECK_LIB(tiff, TIFFReadScanline,
[AC_CHECK_HEADER(tiffio.h,
TIFF='tiff'; LIBTIFF='-ltiff'; tiff_ok=yes,
@@ -281,10 +273,6 @@ AC_ARG_WITH([libgif],
[libgif_prefix="$withval"], [libgif_prefix="${prefix}"])
if test x$with_libgif != xno && test -z "$LIBGIF"; then
- GIF_CFLAGS="-I${libgif_prefix}/include"
- GIF_LIBS="-L${libgif_prefix}/lib"
- save_cflags=$CFLAGS; CFLAGS=$GIF_CFLAGS
- save_libs=$LIBS; LIBS=$GIF_LIBS
AC_CHECK_LIB(gif, DGifOpenFileName,
[AC_CHECK_HEADER(gif_lib.h,
GIF='gif'; LIBGIF='-lgif'; gif_ok=yes,

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Tue Mar 3 07:40:44 UTC 2020 - Marguerite Su <i@marguerite.su>
- Update to version 6.0.4
* No changelog upstream.
- Drop libgdiplus-giflib5.patch, upstreamed
- Drop libgdiplus-libjpeg_prefix.patch, upstreamed
- Disable tests for now, some newly introduced tests
didn't run at all
-------------------------------------------------------------------
Wed Mar 20 15:51:46 UTC 2019 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@ -1,7 +1,7 @@
#
# spec file for package libgdiplus
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -12,27 +12,23 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define soname 0
Name: libgdiplus
Version: 3.12
Version: 6.0.4
Release: 0
Summary: Open Source Implementation of the GDI+ API
License: (LGPL-2.1+ or MPL-1.1) and MIT
License: (LGPL-2.1-or-later OR MPL-1.1) AND MIT
Group: Development/Libraries/Mono
Url: https://github.com/mono/libgdiplus
URL: https://github.com/mono/libgdiplus
Source: http://download.mono-project.com/sources/%{name}/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM libgdiplus0-giflib5.patch https://github.com/mono/libgdiplus/pull/32
Patch: libgdiplus-giflib5.patch
# PATCH-FIX-UPSTREAM boo#944912
Patch1: libgdiplus-libjpeg_prefix.patch
BuildRequires: giflib-devel
BuildRequires: libjpeg-devel
BuildRequires: libtool
BuildRequires: pkg-config
BuildRequires: pkgconfig
BuildRequires: pkgconfig(cairo)
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(freetype2)
@ -42,7 +38,6 @@ BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libtiff-4)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xrender)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Mono library that provide a GDI+ comptible API on non-Windows
@ -67,33 +62,29 @@ using System.Drawing.
%prep
%setup -q
%patch -p1
%patch1 -p1
sed -i 's/-Wall/-Wall %{optflags}/' src/Makefile.am
%build
autoreconf -fiv
%configure
make %{?_smp_mflags}
%make_build
%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
%make_install
rm -rf %{buildroot}%{_libdir}/%{name}.{a,la}
%check
make %{?_smp_mflags} check
#%check
#%make_build check
%post -n libgdiplus%{soname} -p /sbin/ldconfig
%postun -n libgdiplus%{soname} -p /sbin/ldconfig
%files -n libgdiplus%{soname}
%defattr(-,root,root)
%{_libdir}/libgdiplus.so.*
%doc AUTHORS COPYING ChangeLog* NEWS README
%license COPYING
%doc AUTHORS ChangeLog* NEWS README.md
%files devel
%defattr(-,root,root)
%{_libdir}/libgdiplus.so
%{_libdir}/pkgconfig/libgdiplus.pc