summaryrefslogtreecommitdiff
path: root/dev-dotnet/libgdiplus
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-dotnet/libgdiplus
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-dotnet/libgdiplus')
-rw-r--r--dev-dotnet/libgdiplus/Manifest14
-rw-r--r--dev-dotnet/libgdiplus/files/libgdiplus-2.10.1-libpng15.patch164
-rw-r--r--dev-dotnet/libgdiplus/files/libgdiplus-2.10.9-freetype251.patch12
-rw-r--r--dev-dotnet/libgdiplus/files/libgdiplus-2.10.9-giflib-quantizebuffer.patch296
-rw-r--r--dev-dotnet/libgdiplus/files/libgdiplus-2.10.9-gold.patch16
-rw-r--r--dev-dotnet/libgdiplus/libgdiplus-2.10.9-r1.ebuild69
-rw-r--r--dev-dotnet/libgdiplus/libgdiplus-2.10.9-r2.ebuild70
-rw-r--r--dev-dotnet/libgdiplus/libgdiplus-2.10.9-r3.ebuild68
-rw-r--r--dev-dotnet/libgdiplus/libgdiplus-4.2-r2.ebuild50
-rw-r--r--dev-dotnet/libgdiplus/libgdiplus-4.2-r3.ebuild50
-rw-r--r--dev-dotnet/libgdiplus/metadata.xml8
11 files changed, 817 insertions, 0 deletions
diff --git a/dev-dotnet/libgdiplus/Manifest b/dev-dotnet/libgdiplus/Manifest
new file mode 100644
index 000000000000..bb2a59457eba
--- /dev/null
+++ b/dev-dotnet/libgdiplus/Manifest
@@ -0,0 +1,14 @@
+AUX libgdiplus-2.10.1-libpng15.patch 5491 SHA256 ae18bac02341af98ed17b14ee510c33cc87d0637a9cf56fedaf21603aa04198c SHA512 292e8f83cd5a10c99a543a0fe85a9b2770e29627f60afd7e6ab7824b135870d9bfb20c8919ec9104110e645a039f69e7378d9295c330423a2725bb8840ceeffd WHIRLPOOL c33f9e5a164585411421d369ef728fd963367735bf8352567112603f7ce37b91246df517c005f25eb1153911b28af310400aaffec8605a939cdabaa2f5025cf6
+AUX libgdiplus-2.10.9-freetype251.patch 295 SHA256 4cb78acd3c1d6776928d3f827def29d5cc3742e6c2e721f4627a1bf014354ac7 SHA512 8b7dd826770f3ab0f6b58f8265f46b8d51c64abb2be7e10e105f3515283eedb3bc087ceb20f47c310f076bc1d81ce89c19d30e8a9daef8941a7d0333abd25f26 WHIRLPOOL 0cee5d873d1f24cc47bee533579edd570bcd0356f4b1ff49fd30bb60721bc2dbe085eb1fe2f717705691353a1deddd287938fe9df7ad4366fdbce4e39240715b
+AUX libgdiplus-2.10.9-giflib-quantizebuffer.patch 12869 SHA256 84d08006e21b667fd668d921b0d8db88f46e46cbed97d88372e092cf196c8e99 SHA512 3ad5ebd2bf9ef980dd273df9b036284d2217cee9ba09dbb6fa9d5b54da132eab0460597a63c53947d7d3f16b1079284413139937cc58b4694b102d1061e776c9 WHIRLPOOL b385e193652af68934d9400262554f7c9a42018a5a34b2452b859a4f2ad50c663313456efecbe86ce34a0fa9e7e55d4df50c44c8224b0dddfe16807e6dc26215
+AUX libgdiplus-2.10.9-gold.patch 443 SHA256 e437641ab6d7d21afd3234b7d49b10ceb7e80c33e6a22e85d1a9679f5a2bdf9c SHA512 93434d106d165cf167332ac6b0fe800eecd39f752ade2c38817ac13bfd69170d3df7e504f2dc0099ef62adc1c05790925fc99e0613bd519bee2df7dec8984912 WHIRLPOOL 710bcc3d3bebb6aa833ddef6fdf5adcb9309b61f20f48f2e1f72caffa28bacc0d73503b30d3c9b5e0cffdeec4b0713e8eb4445c5973327f977f30c9aa42596aa
+DIST libgdiplus-2.10.9.tar.bz2 2074317 SHA256 6ddeb6c327bada7cb6e06d1a20714f526a0c69520dfd42c12ddd032c3c5d964e SHA512 7f1944795c7ede5fd92a6d7e8d7d6cf2ef3c154e656b83e769b417f8f7195dd975084afe3c3cd1dda1ecb2c1167f76c0b5714cd16d549ff056add09763c6b26c WHIRLPOOL 0930cb2ad191c34b7ebd073f687536663bcfe9a44ed3296cf81bc9d43cfc7ee39d8f60f9b9f83f89847164b7366e514ee945737be50b82257209507c3b6e9c5d
+DIST libgdiplus-4.2.tar.gz 687398 SHA256 f332b9b8b44fd1c50b8d8d01a7296360b806c790b8297614739b3de1edbadfeb SHA512 102d1e07a106fa32640a20c4843bf82b3f628c5b7a3813d39c7712f2cd09d80dc5adb337a8d5bdbae065f876a0c433a5d8fcb7d761dff5ee08c48cac2cd2344e WHIRLPOOL a2580f026ec7d767ca038fa4e41c94a5613b69581c836b144c29b5cf1d97895d9c1c17b077caef760ceae65d35e809a7ef9b6c9089c43c0ec5be1d2bcc453ee0
+EBUILD libgdiplus-2.10.9-r1.ebuild 1535 SHA256 d954d0d9eceee3133a700d4cc171710caabd746f9fe8dde31bcf67070bfe44b1 SHA512 c4eb9f72a575e3529563b813cff6c520a5945559fdac4ed36ee39d6b530bcd312719aec16bb64b90f6730fcd134843105a50565bdaeb7ec804544d4909c56a4d WHIRLPOOL b78adc5a1b8bec2add0b37ff3698e2b95a428d8580c63e82918e0b62b3d298baa30e05457ed03428fc45263fbe42c30fc53a0168867b95a0cde01970107c0abc
+EBUILD libgdiplus-2.10.9-r2.ebuild 1595 SHA256 bfa5c2876709b8850c5d57e0fe08b79859497000db30cd01386eb620663c814b SHA512 99a2f8642dd93e1d65954a907db80eb81db012daaee8a515f795984d7355c7f9a9d96a59c09792209fb7a45837b1c44b21a84d6cd18c96a429ea62bb01b4a20c WHIRLPOOL df49a86132df4f08b0e7b38d035b03586b6488669ec1d0aea2c6fe296e3f9e9c3a5092acd3af583225bd7f53bb78ffb124137855273f0328ded6098dc4270ea3
+EBUILD libgdiplus-2.10.9-r3.ebuild 1528 SHA256 03f1323dd51b6feb1c958422f06be9f68212c41420b61638f0fdb75236fccaee SHA512 0850083e0c58534b631ef1907d32bc6262e5d148382b05749dd0369d7e6b44353a1bdd3fb5ac16c5f7b03e5dbc4e26f6ff7868337da5e0305ba517e784a17ec1 WHIRLPOOL 225e9da1961b59e9c5819a3751ef837e192e1be0d29b51b957e2dd6bf7d7081d869cbe717cf03f0583316cbbb765477c9df3bc9ec99042e4f0a97bb9d7b4943a
+EBUILD libgdiplus-4.2-r2.ebuild 1132 SHA256 c87a9316ec2ac05cb752e87d87f79537b2f4991d7d8d953abf3c129ea0a67d7b SHA512 ffc9919aae1e9147405efb36f7148e0d82b744dab6572d24d7de7c58047ce352751b35a79e23a6323e67e2a68b8647d33ff670f98f3d375822a363ee0c1657cc WHIRLPOOL 6c02c2d33379f96f34c2381d088316d2519d321091067c6b7c6e0911f9e31d6d8274716c2ad74bc123098c0a6b1ebb4f44cb43b1d46cfbb1c8a333681f88b7f0
+EBUILD libgdiplus-4.2-r3.ebuild 1125 SHA256 40f9d392bce2626d20566d65add6683ee9809e8f831d6365a0172874a4dd1f5d SHA512 7ab12be48cd06814507ec263f9703b284b4a1bcb78b9751c941914310f23deefd639cd3f920de6a5c1a01808402b0fd235ac8ce3d8a1c5c2d5cee5ffa0bdffda WHIRLPOOL f8c26d1335f39435a6c512976d66dc4aed78adb68d55dc443b4b6b12294f7013e2608d59ca74bf602c82fd55ddad22895393b6204a40531ad6029c117823a139
+MISC ChangeLog 4718 SHA256 cf55000f68621124d46fa20fa19bd501ef40f31d3c1526a8feb7166e222ca9bc SHA512 9e9ac29c8e93d0a3e88ba8b08d4cb4b2a29d70ce92c177b9ca404831d321e4aad8bc5a72937b121b1aa65657f0b45e7bacf25e37ec6aac6e4a81a99aa2a6378a WHIRLPOOL ce54b25d1e9669f6eb6aa8a9060db028d3088dd021e1ccbed5c5b9b7fdc0c8b2e6bb01cc2dda5fb7f0231a3b64666fe90ff62c4f70896605563e3f13cb8ce677
+MISC ChangeLog-2015 24164 SHA256 50949201b261e927ad5515f01ecdd04986b48c93340a5532b462954bdbb25ec1 SHA512 b9fae29cb63dc24860c0031320d092822fec2b63907112b4fd461d08a160510346ead84cc9dc9d8fa9cc8bd8554d0e74248f8985ad2d9bcab571f4d804f13c36 WHIRLPOOL 9bf75dc9575d8f42724f5d438bb5697b349f31eeea3ed28d525d9193f77293efcafcb248cd231ec0e74daf6956ba5b0c979984d705234c3044a239866832516a
+MISC metadata.xml 255 SHA256 7f1e451043d1d56ac50c106fdb27071300520d7d130981594a8d577a0bdc4e69 SHA512 2ad078558aba9045a782316fc558ea3c6edf579a77a87c0096e3a85ac78a73904a5ceb48cec15ed30fafacc79a66fcf6836acac43d311d1840ccdd62fc2a6896 WHIRLPOOL 333b255650545a11bc1894d31a9090e6ebea76d186bf33bcdc0717f0a9f7add1696440283577ad7c499a28e6dfcba06e20eedb41ae3857f1f744ce08fe36a854
diff --git a/dev-dotnet/libgdiplus/files/libgdiplus-2.10.1-libpng15.patch b/dev-dotnet/libgdiplus/files/libgdiplus-2.10.1-libpng15.patch
new file mode 100644
index 000000000000..31a1c01629d8
--- /dev/null
+++ b/dev-dotnet/libgdiplus/files/libgdiplus-2.10.1-libpng15.patch
@@ -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;
+ }
diff --git a/dev-dotnet/libgdiplus/files/libgdiplus-2.10.9-freetype251.patch b/dev-dotnet/libgdiplus/files/libgdiplus-2.10.9-freetype251.patch
new file mode 100644
index 000000000000..b4faa06d6415
--- /dev/null
+++ b/dev-dotnet/libgdiplus/files/libgdiplus-2.10.9-freetype251.patch
@@ -0,0 +1,12 @@
+--- libgdiplus-2.10.9/src/gdiplus-private.h
++++ libgdiplus-2.10.9/src/gdiplus-private.h
+@@ -30,7 +30,8 @@
+ #include <stdio.h>
+ #include <math.h>
+ #include <glib.h>
+-#include <freetype/tttables.h>
++#include <ft2build.h>
++#include FT_TRUETYPE_TABLES_H
+ #include <pthread.h>
+ #include <unistd.h>
+
diff --git a/dev-dotnet/libgdiplus/files/libgdiplus-2.10.9-giflib-quantizebuffer.patch b/dev-dotnet/libgdiplus/files/libgdiplus-2.10.9-giflib-quantizebuffer.patch
new file mode 100644
index 000000000000..f65c349af772
--- /dev/null
+++ b/dev-dotnet/libgdiplus/files/libgdiplus-2.10.9-giflib-quantizebuffer.patch
@@ -0,0 +1,296 @@
+diff -uNr libgdiplus-2.10.9/src/gifcodec.c libgdiplus-2.10.9-funtoo/src/gifcodec.c
+--- libgdiplus-2.10.9/src/gifcodec.c 2011-12-02 18:23:12.000000000 +0100
++++ libgdiplus-2.10.9-funtoo/src/gifcodec.c 2013-10-08 18:06:44.643554570 +0200
+@@ -39,6 +39,293 @@
+
+ #include "gifcodec.h"
+
++#define COLOR_ARRAY_SIZE 32768
++#define BITS_PER_PRIM_COLOR 5
++#define MAX_PRIM_COLOR 0x1f
++
++static int SortRGBAxis;
++
++typedef struct QuantizedColorType {
++ GifByteType RGB[3];
++ GifByteType NewColorIndex;
++ long Count;
++ struct QuantizedColorType *Pnext;
++} QuantizedColorType;
++
++typedef struct NewColorMapType {
++ GifByteType RGBMin[3], RGBWidth[3];
++ unsigned int NumEntries; /* # of QuantizedColorType in linked list below */
++ unsigned long Count; /* Total number of pixels in all the entries */
++ QuantizedColorType *QuantizedColors;
++} NewColorMapType;
++
++
++/****************************************************************************
++ * Routine called by qsort to compare two entries.
++ ****************************************************************************/
++static int
++SortCmpRtn(const void *Entry1,
++ const void *Entry2) {
++
++ return (*((QuantizedColorType **) Entry1))->RGB[SortRGBAxis] -
++ (*((QuantizedColorType **) Entry2))->RGB[SortRGBAxis];
++}
++
++/******************************************************************************
++ * Routine to subdivide the RGB space recursively using median cut in each
++ * axes alternatingly until ColorMapSize different cubes exists.
++ * The biggest cube in one dimension is subdivide unless it has only one entry.
++ * Returns GIF_ERROR if failed, otherwise GIF_OK.
++ ******************************************************************************/
++static int
++SubdivColorMap(NewColorMapType * NewColorSubdiv,
++ unsigned int ColorMapSize,
++ unsigned int *NewColorMapSize) {
++
++ int MaxSize;
++ unsigned int i, j, Index = 0, NumEntries, MinColor, MaxColor;
++ long Sum, Count;
++ QuantizedColorType *QuantizedColor, **SortArray;
++
++ while (ColorMapSize > *NewColorMapSize) {
++ /* Find candidate for subdivision: */
++ MaxSize = -1;
++ for (i = 0; i < *NewColorMapSize; i++) {
++ for (j = 0; j < 3; j++) {
++ if ((((int)NewColorSubdiv[i].RGBWidth[j]) > MaxSize) &&
++ (NewColorSubdiv[i].NumEntries > 1)) {
++ MaxSize = NewColorSubdiv[i].RGBWidth[j];
++ Index = i;
++ SortRGBAxis = j;
++ }
++ }
++ }
++
++ if (MaxSize == -1)
++ return GIF_OK;
++
++ /* Split the entry Index into two along the axis SortRGBAxis: */
++
++ /* Sort all elements in that entry along the given axis and split at
++ * the median. */
++ SortArray = (QuantizedColorType **)malloc(
++ sizeof(QuantizedColorType *) *
++ NewColorSubdiv[Index].NumEntries);
++ if (SortArray == NULL)
++ return GIF_ERROR;
++ for (j = 0, QuantizedColor = NewColorSubdiv[Index].QuantizedColors;
++ j < NewColorSubdiv[Index].NumEntries && QuantizedColor != NULL;
++ j++, QuantizedColor = QuantizedColor->Pnext)
++ SortArray[j] = QuantizedColor;
++
++ qsort(SortArray, NewColorSubdiv[Index].NumEntries,
++ sizeof(QuantizedColorType *), SortCmpRtn);
++
++ /* Relink the sorted list into one: */
++ for (j = 0; j < NewColorSubdiv[Index].NumEntries - 1; j++)
++ SortArray[j]->Pnext = SortArray[j + 1];
++ SortArray[NewColorSubdiv[Index].NumEntries - 1]->Pnext = NULL;
++ NewColorSubdiv[Index].QuantizedColors = QuantizedColor = SortArray[0];
++ free((char *)SortArray);
++
++ /* Now simply add the Counts until we have half of the Count: */
++ Sum = NewColorSubdiv[Index].Count / 2 - QuantizedColor->Count;
++ NumEntries = 1;
++ Count = QuantizedColor->Count;
++ while (QuantizedColor->Pnext != NULL &&
++ (Sum -= QuantizedColor->Pnext->Count) >= 0 &&
++ QuantizedColor->Pnext->Pnext != NULL) {
++ QuantizedColor = QuantizedColor->Pnext;
++ NumEntries++;
++ Count += QuantizedColor->Count;
++ }
++ /* Save the values of the last color of the first half, and first
++ * of the second half so we can update the Bounding Boxes later.
++ * Also as the colors are quantized and the BBoxes are full 0..255,
++ * they need to be rescaled.
++ */
++ MaxColor = QuantizedColor->RGB[SortRGBAxis]; /* Max. of first half */
++ /* coverity[var_deref_op] */
++ MinColor = QuantizedColor->Pnext->RGB[SortRGBAxis]; /* of second */
++ MaxColor <<= (8 - BITS_PER_PRIM_COLOR);
++ MinColor <<= (8 - BITS_PER_PRIM_COLOR);
++
++ /* Partition right here: */
++ NewColorSubdiv[*NewColorMapSize].QuantizedColors =
++ QuantizedColor->Pnext;
++ QuantizedColor->Pnext = NULL;
++ NewColorSubdiv[*NewColorMapSize].Count = Count;
++ NewColorSubdiv[Index].Count -= Count;
++ NewColorSubdiv[*NewColorMapSize].NumEntries =
++ NewColorSubdiv[Index].NumEntries - NumEntries;
++ NewColorSubdiv[Index].NumEntries = NumEntries;
++ for (j = 0; j < 3; j++) {
++ NewColorSubdiv[*NewColorMapSize].RGBMin[j] =
++ NewColorSubdiv[Index].RGBMin[j];
++ NewColorSubdiv[*NewColorMapSize].RGBWidth[j] =
++ NewColorSubdiv[Index].RGBWidth[j];
++ }
++ NewColorSubdiv[*NewColorMapSize].RGBWidth[SortRGBAxis] =
++ NewColorSubdiv[*NewColorMapSize].RGBMin[SortRGBAxis] +
++ NewColorSubdiv[*NewColorMapSize].RGBWidth[SortRGBAxis] - MinColor;
++ NewColorSubdiv[*NewColorMapSize].RGBMin[SortRGBAxis] = MinColor;
++
++ NewColorSubdiv[Index].RGBWidth[SortRGBAxis] =
++ MaxColor - NewColorSubdiv[Index].RGBMin[SortRGBAxis];
++
++ (*NewColorMapSize)++;
++ }
++
++ return GIF_OK;
++}
++
++/******************************************************************************
++ * Quantize high resolution image into lower one. Input image consists of a
++ * 2D array for each of the RGB colors with size Width by Height. There is no
++ * Color map for the input. Output is a quantized image with 2D array of
++ * indexes into the output color map.
++ * Note input image can be 24 bits at the most (8 for red/green/blue) and
++ * the output has 256 colors at the most (256 entries in the color map.).
++ * ColorMapSize specifies size of color map up to 256 and will be updated to
++ * real size before returning.
++ * Also non of the parameter are allocated by this routine.
++ * This function returns GIF_OK if succesfull, GIF_ERROR otherwise.
++ ******************************************************************************/
++static int
++QuantizeBuffer(unsigned int Width,
++ unsigned int Height,
++ int *ColorMapSize,
++ GifByteType * RedInput,
++ GifByteType * GreenInput,
++ GifByteType * BlueInput,
++ GifByteType * OutputBuffer,
++ GifColorType * OutputColorMap) {
++
++ unsigned int Index, NumOfEntries;
++ int i, j, MaxRGBError[3];
++ unsigned int NewColorMapSize;
++ long Red, Green, Blue;
++ NewColorMapType NewColorSubdiv[256];
++ QuantizedColorType *ColorArrayEntries, *QuantizedColor;
++
++ ColorArrayEntries = (QuantizedColorType *)malloc(
++ sizeof(QuantizedColorType) * COLOR_ARRAY_SIZE);
++ if (ColorArrayEntries == NULL) {
++ return GIF_ERROR;
++ }
++
++ for (i = 0; i < COLOR_ARRAY_SIZE; i++) {
++ ColorArrayEntries[i].RGB[0] = i >> (2 * BITS_PER_PRIM_COLOR);
++ ColorArrayEntries[i].RGB[1] = (i >> BITS_PER_PRIM_COLOR) &
++ MAX_PRIM_COLOR;
++ ColorArrayEntries[i].RGB[2] = i & MAX_PRIM_COLOR;
++ ColorArrayEntries[i].Count = 0;
++ }
++
++ /* Sample the colors and their distribution: */
++ for (i = 0; i < (int)(Width * Height); i++) {
++ Index = ((RedInput[i] >> (8 - BITS_PER_PRIM_COLOR)) <<
++ (2 * BITS_PER_PRIM_COLOR)) +
++ ((GreenInput[i] >> (8 - BITS_PER_PRIM_COLOR)) <<
++ BITS_PER_PRIM_COLOR) +
++ (BlueInput[i] >> (8 - BITS_PER_PRIM_COLOR));
++ ColorArrayEntries[Index].Count++;
++ }
++
++ /* Put all the colors in the first entry of the color map, and call the
++ * recursive subdivision process. */
++ for (i = 0; i < 256; i++) {
++ NewColorSubdiv[i].QuantizedColors = NULL;
++ NewColorSubdiv[i].Count = NewColorSubdiv[i].NumEntries = 0;
++ for (j = 0; j < 3; j++) {
++ NewColorSubdiv[i].RGBMin[j] = 0;
++ NewColorSubdiv[i].RGBWidth[j] = 255;
++ }
++ }
++
++ /* Find the non empty entries in the color table and chain them: */
++ for (i = 0; i < COLOR_ARRAY_SIZE; i++)
++ if (ColorArrayEntries[i].Count > 0)
++ break;
++ QuantizedColor = NewColorSubdiv[0].QuantizedColors = &ColorArrayEntries[i];
++ NumOfEntries = 1;
++ while (++i < COLOR_ARRAY_SIZE)
++ if (ColorArrayEntries[i].Count > 0) {
++ QuantizedColor->Pnext = &ColorArrayEntries[i];
++ QuantizedColor = &ColorArrayEntries[i];
++ NumOfEntries++;
++ }
++ QuantizedColor->Pnext = NULL;
++
++ NewColorSubdiv[0].NumEntries = NumOfEntries; /* Different sampled colors */
++ NewColorSubdiv[0].Count = ((long)Width) * Height; /* Pixels */
++ NewColorMapSize = 1;
++ if (SubdivColorMap(NewColorSubdiv, *ColorMapSize, &NewColorMapSize) !=
++ GIF_OK) {
++ free((char *)ColorArrayEntries);
++ return GIF_ERROR;
++ }
++ if (NewColorMapSize < *ColorMapSize) {
++ /* And clear rest of color map: */
++ for (i = NewColorMapSize; i < *ColorMapSize; i++)
++ OutputColorMap[i].Red = OutputColorMap[i].Green =
++ OutputColorMap[i].Blue = 0;
++ }
++
++ /* Average the colors in each entry to be the color to be used in the
++ * output color map, and plug it into the output color map itself. */
++ for (i = 0; i < NewColorMapSize; i++) {
++ if ((j = NewColorSubdiv[i].NumEntries) > 0) {
++ QuantizedColor = NewColorSubdiv[i].QuantizedColors;
++ Red = Green = Blue = 0;
++ while (QuantizedColor) {
++ QuantizedColor->NewColorIndex = i;
++ Red += QuantizedColor->RGB[0];
++ Green += QuantizedColor->RGB[1];
++ Blue += QuantizedColor->RGB[2];
++ QuantizedColor = QuantizedColor->Pnext;
++ }
++ OutputColorMap[i].Red = (Red << (8 - BITS_PER_PRIM_COLOR)) / j;
++ OutputColorMap[i].Green = (Green << (8 - BITS_PER_PRIM_COLOR)) / j;
++ OutputColorMap[i].Blue = (Blue << (8 - BITS_PER_PRIM_COLOR)) / j;
++ } else
++ fprintf(stderr,
++ "\n%s: Null entry in quantized color map - that's weird.\n",
++ "libgdiplus");
++ }
++
++ /* Finally scan the input buffer again and put the mapped index in the
++ * output buffer. */
++ MaxRGBError[0] = MaxRGBError[1] = MaxRGBError[2] = 0;
++ for (i = 0; i < (int)(Width * Height); i++) {
++ Index = ((RedInput[i] >> (8 - BITS_PER_PRIM_COLOR)) <<
++ (2 * BITS_PER_PRIM_COLOR)) +
++ ((GreenInput[i] >> (8 - BITS_PER_PRIM_COLOR)) <<
++ BITS_PER_PRIM_COLOR) +
++ (BlueInput[i] >> (8 - BITS_PER_PRIM_COLOR));
++ Index = ColorArrayEntries[Index].NewColorIndex;
++ OutputBuffer[i] = Index;
++ if (MaxRGBError[0] < ABS(OutputColorMap[Index].Red - RedInput[i]))
++ MaxRGBError[0] = ABS(OutputColorMap[Index].Red - RedInput[i]);
++ if (MaxRGBError[1] < ABS(OutputColorMap[Index].Green - GreenInput[i]))
++ MaxRGBError[1] = ABS(OutputColorMap[Index].Green - GreenInput[i]);
++ if (MaxRGBError[2] < ABS(OutputColorMap[Index].Blue - BlueInput[i]))
++ MaxRGBError[2] = ABS(OutputColorMap[Index].Blue - BlueInput[i]);
++ }
++
++#ifdef DEBUG
++ fprintf(stderr,
++ "Quantization L(0) errors: Red = %d, Green = %d, Blue = %d.\n",
++ MaxRGBError[0], MaxRGBError[1], MaxRGBError[2]);
++#endif /* DEBUG */
++
++ free((char *)ColorArrayEntries);
++
++ *ColorMapSize = NewColorMapSize;
++
++ return GIF_OK;
++}
++
+ /* giflib declares this incorrectly as EgifOpen */
+ extern GifFileType *EGifOpen(void *userData, OutputFunc writeFunc);
diff --git a/dev-dotnet/libgdiplus/files/libgdiplus-2.10.9-gold.patch b/dev-dotnet/libgdiplus/files/libgdiplus-2.10.9-gold.patch
new file mode 100644
index 000000000000..379ae941ef40
--- /dev/null
+++ b/dev-dotnet/libgdiplus/files/libgdiplus-2.10.9-gold.patch
@@ -0,0 +1,16 @@
+ tests/Makefile.in | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/tests/Makefile.in b/tests/Makefile.in
+index 97f5f4e..c02ca25 100644
+--- a/tests/Makefile.in
++++ b/tests/Makefile.in
+@@ -228,7 +228,7 @@ DEPS = \
+ $(top_builddir)/src/libgdiplus.la
+
+ LDADDS = \
+- $(top_builddir)/src/libgdiplus.la
++ $(top_builddir)/src/libgdiplus.la -lX11 -lglib-2.0
+
+ testgdi_DEPENDENCIES = $(TEST_DEPS)
+ testgdi_LDADD = $(LDADDS)
diff --git a/dev-dotnet/libgdiplus/libgdiplus-2.10.9-r1.ebuild b/dev-dotnet/libgdiplus/libgdiplus-2.10.9-r1.ebuild
new file mode 100644
index 000000000000..642477ac9a2d
--- /dev/null
+++ b/dev-dotnet/libgdiplus/libgdiplus-2.10.9-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit base eutils mono flag-o-matic
+
+DESCRIPTION="Library for using System.Drawing with mono"
+HOMEPAGE="http://www.mono-project.com"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ~arm ppc ppc64 x86 ~amd64-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+SRC_URI="http://download.mono-project.com/sources/${PN}/${P}.tar.bz2"
+
+IUSE="cairo"
+
+RDEPEND=">=dev-libs/glib-2.16:2
+ >=media-libs/freetype-2.3.7
+ >=media-libs/fontconfig-2.6
+ >=media-libs/libpng-1.4:0
+ x11-libs/libXrender
+ x11-libs/libX11
+ x11-libs/libXt
+ >=x11-libs/cairo-1.8.4[X]
+ media-libs/libexif
+ >=media-libs/giflib-4.1.3
+ virtual/jpeg:0
+ media-libs/tiff:0
+ !cairo? ( >=x11-libs/pango-1.20 )"
+DEPEND="${RDEPEND}"
+
+RESTRICT="test"
+
+PATCHES=("${FILESDIR}/${P}-gold.patch"
+ "${FILESDIR}/${PN}-2.10.1-libpng15.patch"
+ "${FILESDIR}/${PN}-2.10.9-freetype251.patch")
+
+src_prepare() {
+ base_src_prepare
+ sed -i -e 's:ungif:gif:g' configure || die
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+ econf --disable-dependency-tracking \
+ --disable-static \
+ --with-cairo=system \
+ $(use !cairo && printf %s --with-pango)
+}
+
+src_compile() {
+ emake "$@"
+}
+
+src_install () {
+ emake -j1 DESTDIR="${D}" "$@" install #nowarn
+ mono_multilib_comply
+ local commondoc=( AUTHORS ChangeLog README TODO )
+ for docfile in "${commondoc[@]}"
+ do
+ [[ -e "${docfile}" ]] && dodoc "${docfile}"
+ done
+ if [[ "${DOCS[@]}" ]]
+ then
+ dodoc "${DOCS[@]}"
+ fi
+ prune_libtool_files
+}
diff --git a/dev-dotnet/libgdiplus/libgdiplus-2.10.9-r2.ebuild b/dev-dotnet/libgdiplus/libgdiplus-2.10.9-r2.ebuild
new file mode 100644
index 000000000000..f156d9acabbd
--- /dev/null
+++ b/dev-dotnet/libgdiplus/libgdiplus-2.10.9-r2.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit base eutils mono flag-o-matic
+
+DESCRIPTION="Library for using System.Drawing with mono"
+HOMEPAGE="http://www.mono-project.com"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+SRC_URI="http://download.mono-project.com/sources/${PN}/${P}.tar.bz2"
+
+IUSE="cairo"
+
+RDEPEND=">=dev-libs/glib-2.16:2
+ >=media-libs/freetype-2.3.7
+ >=media-libs/fontconfig-2.6
+ >=media-libs/libpng-1.4:0
+ x11-libs/libXrender
+ x11-libs/libX11
+ x11-libs/libXt
+ >=x11-libs/cairo-1.8.4[X]
+ media-libs/libexif
+ >=media-libs/giflib-4.2.3
+ virtual/jpeg:0
+ media-libs/tiff:0
+ !cairo? ( >=x11-libs/pango-1.20 )"
+DEPEND="${RDEPEND}"
+
+RESTRICT="test"
+
+PATCHES=("${FILESDIR}/${P}-gold.patch"
+ "${FILESDIR}/${PN}-2.10.1-libpng15.patch"
+ "${FILESDIR}/${PN}-2.10.9-giflib-quantizebuffer.patch"
+ "${FILESDIR}/${PN}-2.10.9-freetype251.patch")
+
+src_prepare() {
+ base_src_prepare
+ sed -i -e 's:ungif:gif:g' configure || die
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+ econf --disable-dependency-tracking \
+ --disable-static \
+ --with-cairo=system \
+ $(use !cairo && printf %s --with-pango)
+}
+
+src_compile() {
+ emake "$@"
+}
+
+src_install () {
+ emake -j1 DESTDIR="${D}" "$@" install #nowarn
+ mono_multilib_comply
+ local commondoc=( AUTHORS ChangeLog README TODO )
+ for docfile in "${commondoc[@]}"
+ do
+ [[ -e "${docfile}" ]] && dodoc "${docfile}"
+ done
+ if [[ "${DOCS[@]}" ]]
+ then
+ dodoc "${DOCS[@]}"
+ fi
+ prune_libtool_files
+}
diff --git a/dev-dotnet/libgdiplus/libgdiplus-2.10.9-r3.ebuild b/dev-dotnet/libgdiplus/libgdiplus-2.10.9-r3.ebuild
new file mode 100644
index 000000000000..2e71897c3048
--- /dev/null
+++ b/dev-dotnet/libgdiplus/libgdiplus-2.10.9-r3.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils dotnet flag-o-matic
+
+DESCRIPTION="Library for using System.Drawing with mono"
+HOMEPAGE="http://www.mono-project.com"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+SRC_URI="http://download.mono-project.com/sources/${PN}/${P}.tar.bz2"
+
+IUSE="cairo"
+
+RDEPEND=">=dev-libs/glib-2.16:2
+ >=media-libs/freetype-2.3.7
+ >=media-libs/fontconfig-2.6
+ >=media-libs/libpng-1.4:0
+ x11-libs/libXrender
+ x11-libs/libX11
+ x11-libs/libXt
+ >=x11-libs/cairo-1.8.4[X]
+ media-libs/libexif
+ >=media-libs/giflib-4.2.3
+ virtual/jpeg:0
+ media-libs/tiff:0
+ !cairo? ( >=x11-libs/pango-1.20 )"
+DEPEND="${RDEPEND}"
+
+RESTRICT="test"
+
+PATCHES=("${FILESDIR}/${P}-gold.patch"
+ "${FILESDIR}/${PN}-2.10.1-libpng15.patch"
+ "${FILESDIR}/${PN}-2.10.9-giflib-quantizebuffer.patch")
+
+src_prepare() {
+ base_src_prepare
+ sed -i -e 's:ungif:gif:g' configure || die
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+ econf --disable-dependency-tracking \
+ --disable-static \
+ --with-cairo=system \
+ $(use !cairo && printf %s --with-pango)
+}
+
+src_compile() {
+ emake "$@"
+}
+
+src_install () {
+ emake -j1 DESTDIR="${D}" "$@" install #nowarn
+ dotnet_multilib_comply
+ local commondoc=( AUTHORS ChangeLog README TODO )
+ for docfile in "${commondoc[@]}"
+ do
+ [[ -e "${docfile}" ]] && dodoc "${docfile}"
+ done
+ if [[ "${DOCS[@]}" ]]
+ then
+ dodoc "${DOCS[@]}"
+ fi
+ prune_libtool_files
+}
diff --git a/dev-dotnet/libgdiplus/libgdiplus-4.2-r2.ebuild b/dev-dotnet/libgdiplus/libgdiplus-4.2-r2.ebuild
new file mode 100644
index 000000000000..61cc4064fe54
--- /dev/null
+++ b/dev-dotnet/libgdiplus/libgdiplus-4.2-r2.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils dotnet
+
+DESCRIPTION="Library for using System.Drawing with mono"
+HOMEPAGE="http://www.mono-project.com"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~x86-solaris"
+SRC_URI="http://download.mono-project.com/sources/${PN}/${P}.tar.gz"
+
+IUSE="cairo"
+
+RDEPEND=">=dev-libs/glib-2.2.3:2
+ >=media-libs/freetype-2.3.7:2
+ >=media-libs/fontconfig-2.6
+ >=media-libs/libpng-1.4:0=
+ x11-libs/libXrender
+ x11-libs/libX11
+ x11-libs/libXt
+ >=x11-libs/cairo-1.8.4[X]
+ media-libs/libexif
+ >=media-libs/giflib-5.1.2:=
+ virtual/jpeg:0
+ media-libs/tiff:0
+ !cairo? ( >=x11-libs/pango-1.20 )"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ econf \
+ --disable-dependency-tracking \
+ --disable-static \
+ $(usex cairo "" "--with-pango")
+}
+
+src_install () {
+ default
+
+ dotnet_multilib_comply
+ local commondoc=( AUTHORS ChangeLog README TODO )
+ for docfile in "${commondoc[@]}"; do
+ [[ -e "${docfile}" ]] && dodoc "${docfile}"
+ done
+ [[ "${DOCS[@]}" ]] && dodoc "${DOCS[@]}"
+ prune_libtool_files
+}
diff --git a/dev-dotnet/libgdiplus/libgdiplus-4.2-r3.ebuild b/dev-dotnet/libgdiplus/libgdiplus-4.2-r3.ebuild
new file mode 100644
index 000000000000..644527fcf0ed
--- /dev/null
+++ b/dev-dotnet/libgdiplus/libgdiplus-4.2-r3.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils
+
+DESCRIPTION="Library for using System.Drawing with mono"
+HOMEPAGE="http://www.mono-project.com"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ~arm64 ppc ppc64 x86 ~amd64-linux ~x86-linux ~x86-solaris"
+SRC_URI="http://download.mono-project.com/sources/${PN}/${P}.tar.gz"
+
+IUSE="cairo"
+
+RDEPEND=">=dev-libs/glib-2.2.3:2
+ >=media-libs/freetype-2.3.7
+ >=media-libs/fontconfig-2.6
+ >=media-libs/libpng-1.4:0
+ x11-libs/libXrender
+ x11-libs/libX11
+ x11-libs/libXt
+ >=x11-libs/cairo-1.8.4[X]
+ media-libs/libexif
+ >=media-libs/giflib-5.1.2
+ virtual/jpeg:0
+ media-libs/tiff:0
+ !cairo? ( >=x11-libs/pango-1.20 )"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ econf \
+ --disable-dependency-tracking \
+ --disable-static \
+ $(usex cairo "" "--with-pango")
+}
+
+src_install () {
+ default
+
+ dotnet_multilib_comply
+ local commondoc=( AUTHORS ChangeLog README TODO )
+ for docfile in "${commondoc[@]}"; do
+ [[ -e "${docfile}" ]] && dodoc "${docfile}"
+ done
+ [[ "${DOCS[@]}" ]] && dodoc "${DOCS[@]}"
+ prune_libtool_files
+}
diff --git a/dev-dotnet/libgdiplus/metadata.xml b/dev-dotnet/libgdiplus/metadata.xml
new file mode 100644
index 000000000000..1e9986c4a0cb
--- /dev/null
+++ b/dev-dotnet/libgdiplus/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>dotnet@gentoo.org</email>
+ <name>Gentoo Dotnet Project</name>
+ </maintainer>
+</pkgmetadata>