rebuilt with libgif instead of libungif [release 2.10.9-2mamba;Fri May 31 2013]

This commit is contained in:
Silvan Calarco 2024-01-06 04:20:58 +01:00
parent da00e9b920
commit 6b853a5c11
6 changed files with 514 additions and 0 deletions

View File

@ -1,2 +1,5 @@
# libgdiplus
Libgdiplus is an Open Source implementation of the GDI+ API.
It is part of the Mono Project.

View File

@ -0,0 +1,38 @@
diff -ru libgdiplus-1.2.4/cairo/src/cairo-glitz-private.h libgdiplus-1.2.4-fix/cairo/src/cairo-glitz-private.h
--- libgdiplus-1.2.4/cairo/src/cairo-glitz-private.h 2006-12-01 07:48:14.000000000 +0100
+++ libgdiplus-1.2.4-fix/cairo/src/cairo-glitz-private.h 2006-12-21 10:20:00.000000000 +0100
@@ -34,7 +34,7 @@
#define CAIRO_GLITZ_PRIVATE_H
#include "cairoint.h"
-#include "cairo-glitz.h"
+#include "cairo/cairo-glitz.h"
slim_hidden_proto (cairo_glitz_surface_create);
diff -ru libgdiplus-1.2.4/cairo/src/cairo-glitz-surface.c libgdiplus-1.2.4-fix/cairo/src/cairo-glitz-surface.c
--- libgdiplus-1.2.4/cairo/src/cairo-glitz-surface.c 2006-12-01 07:48:14.000000000 +0100
+++ libgdiplus-1.2.4-fix/cairo/src/cairo-glitz-surface.c 2006-12-21 10:19:42.000000000 +0100
@@ -25,7 +25,7 @@
*/
#include "cairoint.h"
-#include "cairo-glitz.h"
+#include "cairo/cairo-glitz.h"
#include "cairo-glitz-private.h"
typedef struct _cairo_glitz_surface {
diff -ru libgdiplus-1.2.4/cairo/src/cairo-xcb-surface.c libgdiplus-1.2.4-fix/cairo/src/cairo-xcb-surface.c
--- libgdiplus-1.2.4/cairo/src/cairo-xcb-surface.c 2006-12-01 07:48:14.000000000 +0100
+++ libgdiplus-1.2.4-fix/cairo/src/cairo-xcb-surface.c 2006-12-21 10:19:42.000000000 +0100
@@ -35,7 +35,7 @@
*/
#include "cairoint.h"
-#include "cairo-xcb.h"
+#include "cairo/cairo-xcb.h"
-#include "cairo-xcb-xrender.h"
+#include "cairo/cairo-xcb-xrender.h"
#include "cairo-clip-private.h"
#include <xcb/xcb_renderutil.h>

View File

@ -0,0 +1,12 @@
diff -ruN libgdiplus-1.1.18./cairo/configure.in libgdiplus-1.1.18/cairo/configure.in
--- libgdiplus-1.1.18./cairo/configure.in 2006-10-16 20:09:54.000000000 +0200
+++ libgdiplus-1.1.18/cairo/configure.in 2006-10-16 20:10:56.746805587 +0200
@@ -233,7 +233,7 @@
if test "x$no_x" = xyes; then
use_xlib="no (requires X development libraries)"
else
- xlib_NONPKGCONFIG_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
+ xlib_NONPKGCONFIG_LIBS="$X_LIBS -lX11 $X_EXTRA_LIBS"
xlib_NONPKGCONFIG_CFLAGS=$X_CFLAGS
fi])
])

View File

@ -0,0 +1,144 @@
--- ./src/gifcodec.c.orig 2013-03-03 12:43:38.113264271 +0000
+++ ./src/gifcodec.c 2013-03-03 14:47:26.708290541 +0000
@@ -39,9 +39,6 @@
#include "gifcodec.h"
-/* giflib declares this incorrectly as EgifOpen */
-extern GifFileType *EGifOpen(void *userData, OutputFunc writeFunc);
-
/* Data structure used for callback */
typedef struct
{
@@ -105,7 +102,7 @@
*/
static int
-AddExtensionBlockMono(SavedImage *New, int Len, BYTE ExtData[])
+AddExtensionBlockMono(SavedImage *New, int ExtCode, int Len, BYTE ExtData[])
{
ExtensionBlock *ep;
@@ -129,7 +126,7 @@
if (ExtData) {
memcpy(ep->Bytes, ExtData, Len);
- ep->Function = New->Function;
+ ep->Function = ExtCode;
}
return (GIF_OK);
@@ -232,20 +229,20 @@
}
case EXTENSION_RECORD_TYPE: {
- if (DGifGetExtension(GifFile, &temp_save.Function, &ExtData) == GIF_ERROR) {
+ int ExtCode;
+ if (DGifGetExtension(GifFile, &ExtCode, &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, ExtCode, ExtData[0], &ExtData[1]) == GIF_ERROR) {
return (GIF_ERROR);
}
-
+
if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR) {
return (GIF_ERROR);
}
- temp_save.Function = 0;
}
break;
}
@@ -304,9 +301,9 @@
loop_counter = FALSE;
if (from_file) {
- gif = DGifOpen(stream, &gdip_gif_fileinputfunc);
+ gif = DGifOpen(stream, &gdip_gif_fileinputfunc,NULL);
} else {
- gif = DGifOpen (stream, &gdip_gif_inputfunc);
+ gif = DGifOpen (stream, &gdip_gif_inputfunc,NULL);
}
if (gif == NULL) {
@@ -661,9 +658,9 @@
}
if (from_file) {
- fp = EGifOpenFileName (stream, 0);
+ fp = EGifOpenFileName (stream, 0, NULL);
} else {
- fp = EGifOpen (stream, gdip_gif_outputfunc);
+ fp = EGifOpen (stream, gdip_gif_outputfunc,NULL);
}
if (!fp) {
@@ -702,7 +699,7 @@
goto error;
}
- cmap = MakeMapObject(cmap_size, 0);
+ cmap = GifMakeMapObject(cmap_size, 0);
pixbuf = GdipAlloc(pixbuf_size);
if (pixbuf == NULL) {
@@ -793,7 +790,7 @@
pixbuf = pixbuf_org;
} else {
cmap_size = 256;
- cmap = MakeMapObject (cmap_size, 0);
+ cmap = GifMakeMapObject (cmap_size, 0);
red = GdipAlloc(pixbuf_size);
green = GdipAlloc(pixbuf_size);
@@ -824,13 +821,13 @@
v += 4;
}
}
- if (QuantizeBuffer(bitmap_data->width, bitmap_data->height, &cmap_size,
+ if (GifQuantizeBuffer(bitmap_data->width, bitmap_data->height, &cmap_size,
red, green, blue, pixbuf, cmap->Colors) == GIF_ERROR) {
goto error;
}
}
- cmap->BitsPerPixel = BitSize (cmap_size);
+ cmap->BitsPerPixel = GifBitSize (cmap_size);
cmap->ColorCount = 1 << cmap->BitsPerPixel;
if ((frame == 0) && (k == 0)) {
@@ -848,8 +845,10 @@
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);
+ EGifPutExtensionLeader(fp, APPLICATION_EXT_FUNC_CODE);
+ EGifPutExtensionBlock(fp, 11, "NETSCAPE2.0");
+ EGifPutExtensionBlock(fp, 3, Buffer);
+ EGifPutExtensionTrailer(fp);
}
}
@@ -901,7 +900,7 @@
pixbuf += bitmap_data->width;
}
- FreeMapObject (cmap);
+ GifFreeMapObject (cmap);
if (red != NULL) {
GdipFree (red);
}
@@ -929,7 +928,7 @@
error:
if (cmap != NULL) {
- FreeMapObject (cmap);
+ GifFreeMapObject (cmap);
}
if (red != NULL) {

View File

@ -0,0 +1,164 @@
$NetBSD: patch-aa,v 1.8 2011/01/21 10:21:51 wiz Exp $
Fix build with png-1.5.
--- src/pngcodec.c.orig 2010-11-03 16:52:54.000000000 +0000
+++ src/pngcodec.c
@@ -116,10 +116,15 @@ gdip_load_png_properties (png_structp pn
bitmap_data->dpi_horz = png_get_x_pixels_per_inch(png_ptr, info_ptr);
bitmap_data->dpi_vert = png_get_y_pixels_per_inch(png_ptr, info_ptr);
#elif defined(PNG_pHYs_SUPPORTED)
- if ((info_ptr->valid & PNG_INFO_pHYs) && (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)) {
- bitmap_data->image_flags |= ImageFlagsHasRealDPI;
- bitmap_data->dpi_horz = info_ptr->x_pixels_per_unit * 0.0254;
- bitmap_data->dpi_vert = info_ptr->y_pixels_per_unit * 0.0254;
+ if (png_get_valid (png_ptr, info_ptr, PNG_INFO_pHYs)) {
+ png_uint_32 res_x, res_y;
+ int unit_type;
+ png_get_pHYs (png_ptr, info_ptr, &res_x, &res_y, &unit_type);
+ if (unit_type == PNG_RESOLUTION_METER) {
+ bitmap_data->image_flags |= ImageFlagsHasRealDPI;
+ bitmap_data->dpi_horz = res_x * 0.0254;
+ bitmap_data->dpi_vert = res_y * 0.0254;
+ }
}
#endif
/* default to screen resolution (if nothing was provided or available) */
@@ -130,7 +135,7 @@ gdip_load_png_properties (png_structp pn
#if defined(PNG_iCCP_SUPPORTED)
{
png_charp name;
- png_charp profile;
+ png_bytep profile;
png_uint_32 proflen;
int compression_type;
@@ -292,6 +297,11 @@ gdip_load_png_image_from_file_or_stream
ImageFlags colourspace_flag;
int i;
int j;
+ png_colorp png_palette;
+ int png_num_palette;
+ png_bytep trans_alpha;
+ int num_trans;
+ png_color_16p trans_color;
width = png_get_image_width (png_ptr, info_ptr);
height = png_get_image_height (png_ptr, info_ptr);
@@ -309,6 +319,8 @@ gdip_load_png_image_from_file_or_stream
}
/* Copy palette. */
+ png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette);
+
num_colours = 1 << bit_depth;
if (png_get_color_type (png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY) {
@@ -321,8 +333,8 @@ gdip_load_png_image_from_file_or_stream
colourspace_flag = ImageFlagsColorSpaceRGB;
palette_entries = num_colours;
- if (palette_entries > info_ptr->num_palette) {
- palette_entries = info_ptr->num_palette;
+ if (palette_entries > png_num_palette) {
+ palette_entries = png_num_palette;
}
palette = GdipAlloc (sizeof(ColorPalette) + (num_colours - 1) * sizeof(ARGB));
@@ -331,29 +343,30 @@ gdip_load_png_image_from_file_or_stream
for (i=0; i < palette_entries; i++) {
set_pixel_bgra (&palette->Entries[i], 0,
- info_ptr->palette[i].blue,
- info_ptr->palette[i].green,
- info_ptr->palette[i].red,
+ png_palette[i].blue,
+ png_palette[i].green,
+ png_palette[i].red,
0xFF); /* alpha */
}
}
+ png_get_tRNS (png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color);
/* Make sure transparency is respected. */
- if (info_ptr->num_trans > 0) {
+ if (num_trans > 0) {
palette->Flags |= PaletteFlagsHasAlpha;
colourspace_flag |= ImageFlagsHasAlpha;
- if (info_ptr->num_trans > info_ptr->num_palette) {
- info_ptr->num_trans = info_ptr->num_palette;
+ if (num_trans > png_num_palette) {
+ num_trans = png_num_palette;
}
- for (i=0; i < info_ptr->num_trans; i++) {
+ for (i=0; i < num_trans; i++) {
set_pixel_bgra(&palette->Entries[i], 0,
- info_ptr->palette[i].blue,
- info_ptr->palette[i].green,
- info_ptr->palette[i].red,
+ png_palette[i].blue,
+ png_palette[i].green,
+ png_palette[i].red,
#if PNG_LIBPNG_VER > 10399
- info_ptr->trans_alpha [i]); /* alpha */
+ trans_alpha [i]); /* alpha */
#else
info_ptr->trans[i]); /* alpha */
#endif
@@ -398,6 +411,8 @@ gdip_load_png_image_from_file_or_stream
BYTE bit_depth;
int stride;
int interlace;
+ png_colorp png_palette;
+ int png_num_palette;
png_bytep *row_pointers;
BYTE *rawptr;
int i, j;
@@ -490,32 +505,33 @@ gdip_load_png_image_from_file_or_stream
png_byte palette = 0;
png_byte pix = *rowp++;
+ png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette);
palette = (pix >> 6) & 0x03;
set_pixel_bgra (rawptr, 0,
- info_ptr->palette[palette].blue,
- info_ptr->palette[palette].green,
- info_ptr->palette[palette].red,
+ png_palette[palette].blue,
+ png_palette[palette].green,
+ png_palette[palette].red,
0xFF); /* alpha */
palette = (pix >> 4) & 0x03;
set_pixel_bgra (rawptr, 4,
- info_ptr->palette[palette].blue,
- info_ptr->palette[palette].green,
- info_ptr->palette[palette].red,
+ png_palette[palette].blue,
+ png_palette[palette].green,
+ png_palette[palette].red,
0xFF); /* alpha */
palette = (pix >> 2) & 0x03;
set_pixel_bgra (rawptr, 8,
- info_ptr->palette[palette].blue,
- info_ptr->palette[palette].green,
- info_ptr->palette[palette].red,
+ png_palette[palette].blue,
+ png_palette[palette].green,
+ png_palette[palette].red,
0xFF); /* alpha */
palette = pix & 0x03;
set_pixel_bgra (rawptr, 12,
- info_ptr->palette[palette].blue,
- info_ptr->palette[palette].green,
- info_ptr->palette[palette].red,
+ png_palette[palette].blue,
+ png_palette[palette].green,
+ png_palette[palette].red,
0xFF); /* alpha */
rawptr += 16;
}

153
libgdiplus.spec Normal file
View File

@ -0,0 +1,153 @@
# the glitz surface backend is still an unstable API
%define with_glitz 1
# the XCB surface backend is still an unstable API
%define with_xcb 1
Name: libgdiplus
Version: 2.10.9
Release: 2mamba
Summary: An Open Source implementation of the GDI+ API
Group: System/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.mono-project.com/Libgdiplus
Source: http://download.mono-project.com/sources/libgdiplus/libgdiplus-%{version}.tar.bz2
Patch1: %{name}-1.2.4-cairo_glitz_path.patch
Patch2: %{name}-1.2.4-fix_link.patch
Patch3: %{name}-2.10.9-libpng14.patch
Patch4: libgdiplus-2.10.9-libgif-5.patch
License: LGPL, MPL 1.1, MIT
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libcairo-devel
BuildRequires: libexif-devel
BuildRequires: libfontconfig-devel
BuildRequires: libfreetype-devel
BuildRequires: libgif-devel
BuildRequires: libglib-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng14-devel
BuildRequires: libtiff-devel
BuildRequires: libX11-devel
BuildRequires: libXext-devel
BuildRequires: libXrender-devel
## AUTOBUILDREQ-END
BuildRequires: pkgconfig
BuildRequires: libcairo-devel
BuildRequires: libpoppler-devel
%if %{with_glitz}
BuildRequires: libglitz-devel
%endif
%if %{with_xcb}
BuildRequires: libxcb-devel >= 1.1
BuildRequires: libxcb-util-devel
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Libgdiplus is an Open Source implementation of the GDI+ API.
It is part of the Mono Project.
%package devel
Group: Development/Libraries
Summary: Static libraries and headers for %{name}
Requires: %{name} = %{version}-%{release}
%description devel
Libgdiplus is an Open Source implementation of the GDI+ API.
It is part of the Mono Project.
This package contains static libraries and header files need for development.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p0
%patch4 -p1
%build
export CFLAGS="-lX11 -lXext -lglib-2.0"
%configure \
%if %{with_glitz}
--enable-glitz \
%else
--disable-glitz \
%endif
%if %{with_xcb}
--enable-xcb \
%else
--disable-xcb \
%endif
sed -ie "s,-Werror,,g" src/Makefile
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
# note: mono requires libgdiplus.so
%{_libdir}/*.so*
%doc AUTHORS COPYING ChangeLog LICENSE MPL-1.1.html NEWS README TODO
%files devel
%defattr(-,root,root)
%{_libdir}/*.a
%{_libdir}/*.la
%{_libdir}/pkgconfig/*.pc
%changelog
* Fri May 31 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.10.9-2mamba
- rebuilt with libgif instead of libungif
* Tue Jun 26 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.10.9-1mamba
- update to 2.10.9
* Fri Jul 22 2011 Automatic Build System <autodist@mambasoft.it> 2.10-1mamba
- automatic update to 3.0.3.0 by autodist
* Mon Nov 22 2010 Automatic Build System <autodist@mambasoft.it> 2.8.1-1mamba
- automatic update by autodist
* Tue Nov 09 2010 Automatic Build System <autodist@mambasoft.it> 2.8-1mamba
- automatic update by autodist
* Tue Aug 10 2010 Automatic Build System <autodist@mambasoft.it> 2.6.7-1mamba
- automatic update by autodist
* Sat Jun 26 2010 Automatic Build System <autodist@mambasoft.it> 2.6.4-1mamba
- automatic update by autodist
* Sun Apr 25 2010 Automatic Build System <autodist@mambasoft.it> 2.6.2-1mamba
- automatic update by autodist
* Thu Jan 14 2010 Automatic Build System <autodist@mambasoft.it> 2.6-1mamba
- automatic update by autodist
* Thu May 21 2009 Automatic Build System <autodist@mambasoft.it> 2.4-1mamba
- automatic update by autodist
* Wed Jul 16 2008 gil <puntogil@libero.it> 1.9-1mamba
- update to 1.9
* Fri Jun 29 2007 Stefano Cotta Ramusino <stefano.cotta@openmamba.org> 1.2.4-1mamba
- update to 1.2.4
- fixed license
- enabled XCB surface backend
* Thu Dec 21 2006 Davide Madrisan <davide.madrisan@qilinux.it> 1.2.2-1qilnx
- update to version 1.2.2 by autospec
- added missing build requirements
* Wed May 04 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.1.8-1qilnx
- package created by autospec