From ecfac880471800203e1b1c4e29bcb0f1b69cdbf2 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Mon, 18 May 2015 14:25:26 +0100 Subject: [PATCH] updated to 3.12, use %%license --- .gitignore | 5 +- libgdiplus-2.10.9-freetype25.patch | 26 ---- libgdiplus-2.10.9-libpng15.patch | 236 ----------------------------- libgdiplus-2.10.9-tests.patch | 23 --- libgdiplus.spec | 30 ++-- sources | 2 +- 6 files changed, 15 insertions(+), 307 deletions(-) delete mode 100644 libgdiplus-2.10.9-freetype25.patch delete mode 100644 libgdiplus-2.10.9-libpng15.patch delete mode 100644 libgdiplus-2.10.9-tests.patch diff --git a/.gitignore b/.gitignore index 653a681..5bc23c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1 @@ -libgdiplus-2.6.7.tar.bz2 -/libgdiplus-2.8.tar.bz2 -/libgdiplus-2.10.tar.bz2 -/libgdiplus-2.10.9.tar.bz2 +/libgdiplus-*.tar.gz diff --git a/libgdiplus-2.10.9-freetype25.patch b/libgdiplus-2.10.9-freetype25.patch deleted file mode 100644 index bd359f4..0000000 --- a/libgdiplus-2.10.9-freetype25.patch +++ /dev/null @@ -1,26 +0,0 @@ -commit 180c02e0f2a2016eba8520b456ca929e9dcf03db -Author: Jo Shields -Date: Mon Dec 16 09:24:57 2013 +0000 - - Use FreeType macros for tttables.h inclusion - - As of FreeType 2.1.6 (November 2003), using #include to include Freetype libraries directly is not supported. - - This has come to a head, as in FreeType 2.5.0, the location of headers has been moved around, breaking building of libgdiplus. - - This slight change uses the "official" way to include the required header file, without breaking building on older versions of the library. - -diff --git a/src/gdiplus-private.h b/src/gdiplus-private.h -index 59edf9e..dfccc02 100644 ---- a/src/gdiplus-private.h -+++ b/src/gdiplus-private.h -@@ -30,7 +30,8 @@ - #include - #include - #include --#include -+#include -+#include FT_TRUETYPE_TABLES_H - #include - #include - diff --git a/libgdiplus-2.10.9-libpng15.patch b/libgdiplus-2.10.9-libpng15.patch deleted file mode 100644 index f36fffa..0000000 --- a/libgdiplus-2.10.9-libpng15.patch +++ /dev/null @@ -1,236 +0,0 @@ -From 4b15e34ee859916e5d7eeb7ca4d80e3d3d93ddb5 Mon Sep 17 00:00:00 2001 -From: Mike Buland -Date: Tue, 9 Jul 2013 23:38:41 +0200 -Subject: [PATCH 1/3] Removed usage of the opaque png info_ptr struct. - -The info_ptr structure should not be used, this has been in the png -documentation since at least July 2000. - -Hopefully this mantains the same functionality, but in a way that will -compile with the newest versions of libpng. ---- - src/pngcodec.c | 90 ++++++++++++++++++++++++++++++++++------------------------ - 1 file changed, 53 insertions(+), 37 deletions(-) - -diff --git a/src/pngcodec.c b/src/pngcodec.c -index 15c608a..ce38d67 100644 ---- a/src/pngcodec.c -+++ b/src/pngcodec.c -@@ -116,10 +116,16 @@ gdip_load_png_properties (png_structp png_ptr, png_infop info_ptr, png_infop end - 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; -+ { -+ int unit_type; -+ png_uint_32 res_x; -+ png_uint_32 res_y; -+ 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,11 +136,11 @@ gdip_load_png_properties (png_structp png_ptr, png_infop info_ptr, png_infop end - #if defined(PNG_iCCP_SUPPORTED) - { - png_charp name; -- png_charp profile; -+ png_bytepp profile; - png_uint_32 proflen; - int compression_type; - -- if (png_get_iCCP(png_ptr, info_ptr, &name, &compression_type, &profile, &proflen)) { -+ if (png_get_iCCP(png_ptr, info_ptr, &name, &compression_type, profile, &proflen)) { - gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagICCProfileDescriptor, (BYTE*)name); - gdip_bitmapdata_property_add_byte(bitmap_data, PropertyTagICCProfile, (BYTE)compression_type); - } -@@ -243,6 +249,8 @@ gdip_load_png_image_from_file_or_stream (FILE *fp, GetBytesDelegate getBytesFunc - int bit_depth; - int channels; - BYTE color_type; -+ int num_palette; -+ png_colorp png_palette; - - png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - -@@ -320,9 +328,10 @@ gdip_load_png_image_from_file_or_stream (FILE *fp, GetBytesDelegate getBytesFunc - /* Copy the palette data into the GDI+ structure. */ - colourspace_flag = ImageFlagsColorSpaceRGB; - -+ png_get_PLTE( png_ptr, info_ptr, &png_palette, &num_palette ); - palette_entries = num_colours; -- if (palette_entries > info_ptr->num_palette) { -- palette_entries = info_ptr->num_palette; -+ if (palette_entries > num_palette) { -+ palette_entries = num_palette; - } - - palette = GdipAlloc (sizeof(ColorPalette) + (num_colours - 1) * sizeof(ARGB)); -@@ -331,32 +340,39 @@ gdip_load_png_image_from_file_or_stream (FILE *fp, GetBytesDelegate getBytesFunc - - 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 */ - } - } - -- /* Make sure transparency is respected. */ -- if (info_ptr->num_trans > 0) { -- palette->Flags |= PaletteFlagsHasAlpha; -- colourspace_flag |= ImageFlagsHasAlpha; -+ { -+ png_bytep trans_alpha; -+ int num_trans; -+ png_color_16p trans_color; - -- if (info_ptr->num_trans > info_ptr->num_palette) { -- info_ptr->num_trans = info_ptr->num_palette; -- } -+ /* Make sure transparency is respected. */ -+ png_get_tRNS( png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color ); -+ if (num_trans > 0) { -+ palette->Flags |= PaletteFlagsHasAlpha; -+ colourspace_flag |= ImageFlagsHasAlpha; -+ -+ if (num_trans > num_palette) { -+ num_trans = num_palette; -+ } - -- for (i=0; i < info_ptr->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, -+ for (i=0; i < num_trans; i++) { -+ set_pixel_bgra(&palette->Entries[i], 0, -+ 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 */ -+ trans[i]); /* alpha */ - #endif -+ } - } - } - -@@ -486,30 +502,30 @@ gdip_load_png_image_from_file_or_stream (FILE *fp, GetBytesDelegate getBytesFunc - - 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; - } --- -1.9.0 - -From 87c953a4adf21fb8e1264144b4ac309819ab16e7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= -Date: Tue, 9 Jul 2013 23:44:30 +0200 -Subject: [PATCH 2/3] Fix previous commit so that it doesn't break the build - with libpng v12.0 - ---- - src/pngcodec.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/pngcodec.c b/src/pngcodec.c -index ce38d67..cf48152 100644 ---- a/src/pngcodec.c -+++ b/src/pngcodec.c -@@ -370,7 +370,7 @@ gdip_load_png_image_from_file_or_stream (FILE *fp, GetBytesDelegate getBytesFunc - #if PNG_LIBPNG_VER > 10399 - trans_alpha [i]); /* alpha */ - #else -- trans[i]); /* alpha */ -+ info_ptr->trans[i]); /* alpha */ - #endif - } - } --- -1.9.0 - -From 2766e9574a7437b5b52c9e778abe83420729dba0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= -Date: Tue, 9 Jul 2013 23:48:07 +0200 -Subject: [PATCH 3/3] Use png_bytep instead of png_bytepp for the iCCP profile - -As suggested by Andrew Ruder in https://github.com/mono/libgdiplus/pull/3 -to avoid storing the profile pointer in an undefined memory location. ---- - src/pngcodec.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/pngcodec.c b/src/pngcodec.c -index cf48152..25c9baf 100644 ---- a/src/pngcodec.c -+++ b/src/pngcodec.c -@@ -136,11 +136,11 @@ gdip_load_png_properties (png_structp png_ptr, png_infop info_ptr, png_infop end - #if defined(PNG_iCCP_SUPPORTED) - { - png_charp name; -- png_bytepp profile; -+ png_bytep profile; - png_uint_32 proflen; - int compression_type; - -- if (png_get_iCCP(png_ptr, info_ptr, &name, &compression_type, profile, &proflen)) { -+ if (png_get_iCCP(png_ptr, info_ptr, &name, &compression_type, &profile, &proflen)) { - gdip_bitmapdata_property_add_ASCII(bitmap_data, PropertyTagICCProfileDescriptor, (BYTE*)name); - gdip_bitmapdata_property_add_byte(bitmap_data, PropertyTagICCProfile, (BYTE)compression_type); - } --- -1.9.0 - diff --git a/libgdiplus-2.10.9-tests.patch b/libgdiplus-2.10.9-tests.patch deleted file mode 100644 index 747b78a..0000000 --- a/libgdiplus-2.10.9-tests.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up libgdiplus-2.10.9/tests/Makefile.am.tests libgdiplus-2.10.9/tests/Makefile.am ---- libgdiplus-2.10.9/tests/Makefile.am.tests 2011-12-02 18:23:12.000000000 +0100 -+++ libgdiplus-2.10.9/tests/Makefile.am 2014-04-25 10:21:47.615549531 +0200 -@@ -1,5 +1,7 @@ - ## Makefile.am for libgdiplus/tests - -+LIBS = $(GDIPLUS_LIBS) -+ - INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_builddir)/src \ -diff -up libgdiplus-2.10.9/tests/Makefile.in.tests libgdiplus-2.10.9/tests/Makefile.in ---- libgdiplus-2.10.9/tests/Makefile.in.tests 2014-04-25 10:15:23.083033896 +0200 -+++ libgdiplus-2.10.9/tests/Makefile.in 2014-04-25 10:26:27.089551635 +0200 -@@ -127,7 +127,7 @@ LDFLAGS = @LDFLAGS@ - LIBEXIF_CFLAGS = @LIBEXIF_CFLAGS@ - LIBEXIF_LIBS = @LIBEXIF_LIBS@ - LIBOBJS = @LIBOBJS@ --LIBS = @LIBS@ -+LIBS = @GDIPLUS_LIBS@ - LIBTOOL = @LIBTOOL@ - LIPO = @LIPO@ - LN_S = @LN_S@ diff --git a/libgdiplus.spec b/libgdiplus.spec index 08c7edf..7120035 100644 --- a/libgdiplus.spec +++ b/libgdiplus.spec @@ -1,22 +1,15 @@ Name: libgdiplus -Version: 2.10.9 -Release: 3%{?dist} +Version: 3.12 +Release: 1%{?dist} Summary: An Open Source implementation of the GDI+ API Group: System Environment/Libraries License: MIT URL: http://www.mono-project.com/Main_Page -Source0: http://download.mono-project.com/sources/%{name}/%{name}-%{version}.tar.bz2 -# Patch for linking against libpng 1.5 (BZ #843330) -# https://github.com/mono/libgdiplus/commit/506df13e6e1c9915c248305e47f0b67549732566 -Patch0: libgdiplus-2.10.9-libpng15.patch -# Fix build with Freetype 2.5 -# https://github.com/mono/libgdiplus/commit/180c02e0f2a2016eba8520b456ca929e9dcf03db -Patch1: libgdiplus-2.10.9-freetype25.patch +Source0: http://download.mono-project.com/sources/%{name}/%{name}-%{version}.tar.gz + # drop -Wno-format so the default -Werror=format-security works -Patch2: libgdiplus-2.10.9-format.patch -# https://github.com/mono/libgdiplus/commit/1fa831c7440f1985d2b730211bbf8a059c10a63b -Patch3: libgdiplus-2.10.9-tests.patch +Patch1: libgdiplus-2.10.9-format.patch BuildRequires: freetype-devel glib2-devel libjpeg-devel libtiff-devel BuildRequires: libpng-devel fontconfig-devel BuildRequires: cairo-devel giflib-devel libexif-devel @@ -36,10 +29,7 @@ Development files for libgdiplus %prep %setup -q -%patch0 -p1 -b .libpng15 -%patch1 -p1 -b .freetype25 -%patch2 -p1 -b .format -%patch3 -p1 -b .tests +%patch1 -p1 -b .format %build %configure --disable-static @@ -54,7 +44,9 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';' %postun -p /sbin/ldconfig %files -%doc COPYING NEWS README TODO AUTHORS ChangeLog +%{!?_licensedir:%global license %%doc} +%license COPYING +%doc NEWS README TODO AUTHORS ChangeLog %{_libdir}/lib*.so.* %files devel @@ -62,6 +54,10 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';' %{_libdir}/lib*.so %changelog +* Tue Apr 14 2015 Timotheus Pokorra - 3.12-1 +- updated to 3.12 +- Use %%license + * Sun Aug 17 2014 Fedora Release Engineering - 2.10.9-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild diff --git a/sources b/sources index 3b63b4f..9fe9b79 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b4615c14584b5d73cbb9757c28887654 libgdiplus-2.10.9.tar.bz2 +b8fd78c2adce16498354c2476a248d98 libgdiplus-3.12.tar.gz