From: Gustavo Zacarias Date: Wed, 14 Jan 2015 22:05:57 +0000 (-0300) Subject: gd: bump to version 2.1.1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=691fc0a1982294cf12fd3b3e9d1c3168429f83cf;p=buildroot.git gd: bump to version 2.1.1 Also add hash file. Remove CVE patch since it's upstream. Rename patches to new naming convention. Kill some whitespace. Signed-off-by: Gustavo Zacarias Signed-off-by: Thomas Petazzoni --- diff --git a/package/gd/0001-gdlib-config.patch b/package/gd/0001-gdlib-config.patch new file mode 100644 index 0000000000..7756bf1240 --- /dev/null +++ b/package/gd/0001-gdlib-config.patch @@ -0,0 +1,32 @@ +Fix gdlib-config + +Since the @LIBICONV@ macro doesn't get replaced at compile time, we +end up installing an invalid gdlib-config: the gdlib-config --libs +says that one should link against @LIBICONV@ which obviously doesn't +work. + +Use the OpenWRT patch from +https://dev.openwrt.org/browser/packages/libs/gd/patches/101-gdlib-config.patch + +Signed-off-by: Thomas Petazzoni + +--- a/config/gdlib-config.in ++++ b/config/gdlib-config.in +@@ -71,7 +71,7 @@ while test $# -gt 0; do + echo @LDFLAGS@ + ;; + --libs) +- echo -lgd @LIBS@ @LIBICONV@ ++ echo -lgd @LIBS@ + ;; + --cflags|--includes) + echo -I@includedir@ +@@ -84,7 +84,7 @@ while test $# -gt 0; do + echo "includedir: $includedir" + echo "cflags: -I@includedir@" + echo "ldflags: @LDFLAGS@" +- echo "libs: @LIBS@ @LIBICONV@" ++ echo "libs: @LIBS@" + echo "libdir: $libdir" + echo "features: @FEATURES@" + ;; diff --git a/package/gd/0002-no-zlib.patch b/package/gd/0002-no-zlib.patch new file mode 100644 index 0000000000..65cf7f8f19 --- /dev/null +++ b/package/gd/0002-no-zlib.patch @@ -0,0 +1,51 @@ +[PATCH] gd_gd2: provide dummy implementations for all public symbols when !zlib + +gd_gd2.c only provides dummy implementations for some of it's public symbols +when zlib isn't found, causing build failures in several of the tools. + +Fix it by providing dummy implementations for all of them. + +Signed-off-by: Peter Korsgaard +--- + gd_gd2.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +Index: gd-2.0.35/gd_gd2.c +=================================================================== +--- gd-2.0.35.orig/src/gd_gd2.c ++++ gd-2.0.35/src/gd_gd2.c +@@ -1068,4 +1068,34 @@ + fprintf (stderr, "GD2 support is not available - no libz\n"); + return NULL; + } ++ ++BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Part (FILE * inFile, int srcx, int srcy, int w, int h) ++{ ++ fprintf (stderr, "GD2 support is not available - no libz\n"); ++ return NULL; ++} ++ ++BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2PartPtr (int size, void *data, int srcx, int srcy, int w, ++ int h) ++{ ++ fprintf (stderr, "GD2 support is not available - no libz\n"); ++ return NULL; ++} ++ ++BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w, int h) ++{ ++ fprintf (stderr, "GD2 support is not available - no libz\n"); ++ return NULL; ++} ++ ++BGD_DECLARE(void) gdImageGd2 (gdImagePtr im, FILE * outFile, int cs, int fmt) ++{ ++ fprintf (stderr, "GD2 support is not available - no libz\n"); ++} ++ ++BGD_DECLARE(void *) gdImageGd2Ptr (gdImagePtr im, int cs, int fmt, int *size) ++{ ++ fprintf (stderr, "GD2 support is not available - no libz\n"); ++ return NULL; ++} + #endif /* HAVE_LIBZ */ diff --git a/package/gd/0003-gd_bmp-fix-build-with-uClibc.patch b/package/gd/0003-gd_bmp-fix-build-with-uClibc.patch new file mode 100644 index 0000000000..89bc39186e --- /dev/null +++ b/package/gd/0003-gd_bmp-fix-build-with-uClibc.patch @@ -0,0 +1,50 @@ +From ea2a03e983acf34a1320b460dcad43b7e0b0b14f Mon Sep 17 00:00:00 2001 +Message-Id: +From: Baruch Siach +Date: Thu, 10 Apr 2014 15:49:13 +0300 +Subject: [PATCH] gd_bmp: fix build with uClibc + +Some architectures (like ARM) don't have the long double variants of math +functions under uClibc. Add a local ceill definition in this case. + +Patch status: reported upstream, +https://bitbucket.org/libgd/gd-libgd/issue/123/build-failure-agains-uclibc-arm + +Signed-off-by: Baruch Siach +--- + src/gd_bmp.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/gd_bmp.c b/src/gd_bmp.c +index 0fc021909f1b..11b3ec1baa01 100644 +--- a/src/gd_bmp.c ++++ b/src/gd_bmp.c +@@ -25,6 +25,11 @@ + #include "gdhelpers.h" + #include "bmp.h" + ++#include ++#if defined (__UCLIBC__) && !defined(__UCLIBC_HAS_LONG_DOUBLE_MATH__) ++#define NO_LONG_DOUBLE ++#endif ++ + static int compress_row(unsigned char *uncompressed_row, int length); + static int build_rle_packet(unsigned char *row, int packet_type, int length, unsigned char *data); + +@@ -42,6 +47,13 @@ static int bmp_read_rle(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info); + + #define BMP_DEBUG(s) + ++#ifdef NO_LONG_DOUBLE ++long double ceill(long double x) ++{ ++ return (long double) ceil((double) x); ++} ++#endif ++ + static int gdBMPPutWord(gdIOCtx *out, int w) + { + /* Byte order is little-endian */ +-- +1.9.1 + diff --git a/package/gd/gd-01-gdlib-config.patch b/package/gd/gd-01-gdlib-config.patch deleted file mode 100644 index 7756bf1240..0000000000 --- a/package/gd/gd-01-gdlib-config.patch +++ /dev/null @@ -1,32 +0,0 @@ -Fix gdlib-config - -Since the @LIBICONV@ macro doesn't get replaced at compile time, we -end up installing an invalid gdlib-config: the gdlib-config --libs -says that one should link against @LIBICONV@ which obviously doesn't -work. - -Use the OpenWRT patch from -https://dev.openwrt.org/browser/packages/libs/gd/patches/101-gdlib-config.patch - -Signed-off-by: Thomas Petazzoni - ---- a/config/gdlib-config.in -+++ b/config/gdlib-config.in -@@ -71,7 +71,7 @@ while test $# -gt 0; do - echo @LDFLAGS@ - ;; - --libs) -- echo -lgd @LIBS@ @LIBICONV@ -+ echo -lgd @LIBS@ - ;; - --cflags|--includes) - echo -I@includedir@ -@@ -84,7 +84,7 @@ while test $# -gt 0; do - echo "includedir: $includedir" - echo "cflags: -I@includedir@" - echo "ldflags: @LDFLAGS@" -- echo "libs: @LIBS@ @LIBICONV@" -+ echo "libs: @LIBS@" - echo "libdir: $libdir" - echo "features: @FEATURES@" - ;; diff --git a/package/gd/gd-02-no-zlib.patch b/package/gd/gd-02-no-zlib.patch deleted file mode 100644 index 65cf7f8f19..0000000000 --- a/package/gd/gd-02-no-zlib.patch +++ /dev/null @@ -1,51 +0,0 @@ -[PATCH] gd_gd2: provide dummy implementations for all public symbols when !zlib - -gd_gd2.c only provides dummy implementations for some of it's public symbols -when zlib isn't found, causing build failures in several of the tools. - -Fix it by providing dummy implementations for all of them. - -Signed-off-by: Peter Korsgaard ---- - gd_gd2.c | 30 ++++++++++++++++++++++++++++++ - 1 file changed, 30 insertions(+) - -Index: gd-2.0.35/gd_gd2.c -=================================================================== ---- gd-2.0.35.orig/src/gd_gd2.c -+++ gd-2.0.35/src/gd_gd2.c -@@ -1068,4 +1068,34 @@ - fprintf (stderr, "GD2 support is not available - no libz\n"); - return NULL; - } -+ -+BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Part (FILE * inFile, int srcx, int srcy, int w, int h) -+{ -+ fprintf (stderr, "GD2 support is not available - no libz\n"); -+ return NULL; -+} -+ -+BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2PartPtr (int size, void *data, int srcx, int srcy, int w, -+ int h) -+{ -+ fprintf (stderr, "GD2 support is not available - no libz\n"); -+ return NULL; -+} -+ -+BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w, int h) -+{ -+ fprintf (stderr, "GD2 support is not available - no libz\n"); -+ return NULL; -+} -+ -+BGD_DECLARE(void) gdImageGd2 (gdImagePtr im, FILE * outFile, int cs, int fmt) -+{ -+ fprintf (stderr, "GD2 support is not available - no libz\n"); -+} -+ -+BGD_DECLARE(void *) gdImageGd2Ptr (gdImagePtr im, int cs, int fmt, int *size) -+{ -+ fprintf (stderr, "GD2 support is not available - no libz\n"); -+ return NULL; -+} - #endif /* HAVE_LIBZ */ diff --git a/package/gd/gd-03-gd_bmp-fix-build-with-uClibc.patch b/package/gd/gd-03-gd_bmp-fix-build-with-uClibc.patch deleted file mode 100644 index 89bc39186e..0000000000 --- a/package/gd/gd-03-gd_bmp-fix-build-with-uClibc.patch +++ /dev/null @@ -1,50 +0,0 @@ -From ea2a03e983acf34a1320b460dcad43b7e0b0b14f Mon Sep 17 00:00:00 2001 -Message-Id: -From: Baruch Siach -Date: Thu, 10 Apr 2014 15:49:13 +0300 -Subject: [PATCH] gd_bmp: fix build with uClibc - -Some architectures (like ARM) don't have the long double variants of math -functions under uClibc. Add a local ceill definition in this case. - -Patch status: reported upstream, -https://bitbucket.org/libgd/gd-libgd/issue/123/build-failure-agains-uclibc-arm - -Signed-off-by: Baruch Siach ---- - src/gd_bmp.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/src/gd_bmp.c b/src/gd_bmp.c -index 0fc021909f1b..11b3ec1baa01 100644 ---- a/src/gd_bmp.c -+++ b/src/gd_bmp.c -@@ -25,6 +25,11 @@ - #include "gdhelpers.h" - #include "bmp.h" - -+#include -+#if defined (__UCLIBC__) && !defined(__UCLIBC_HAS_LONG_DOUBLE_MATH__) -+#define NO_LONG_DOUBLE -+#endif -+ - static int compress_row(unsigned char *uncompressed_row, int length); - static int build_rle_packet(unsigned char *row, int packet_type, int length, unsigned char *data); - -@@ -42,6 +47,13 @@ static int bmp_read_rle(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info); - - #define BMP_DEBUG(s) - -+#ifdef NO_LONG_DOUBLE -+long double ceill(long double x) -+{ -+ return (long double) ceil((double) x); -+} -+#endif -+ - static int gdBMPPutWord(gdIOCtx *out, int w) - { - /* Byte order is little-endian */ --- -1.9.1 - diff --git a/package/gd/gd-04-CVE-2014-2497.patch b/package/gd/gd-04-CVE-2014-2497.patch deleted file mode 100644 index d30bfbb8b4..0000000000 --- a/package/gd/gd-04-CVE-2014-2497.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 463c3bd09bfe8e924e19acad7a2a6af16953a704 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Mon, 4 Aug 2014 10:31:25 +0200 -Subject: [PATCH] CVE-2014-2497, NULL pointer dereference, fix #126 - ---- - src/gdxpm.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/src/gdxpm.c b/src/gdxpm.c -index ae6e336..15603a6 100644 ---- a/src/gdxpm.c -+++ b/src/gdxpm.c -@@ -83,6 +83,16 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXpm(char *filename) - if(overflow2(sizeof(int), number)) { - goto done; - } -+ for(i = 0; i < number; i++) { -+ /* -+ avoid NULL pointer dereference -+ TODO better fix need to manage monochrome/monovisual -+ see m_color or g4_color or g_color -+ */ -+ if (!image.colorTable[i].c_color) { -+ goto done; -+ } -+ } - - colors = (int *)gdMalloc(sizeof(int) * number); - if(colors == NULL) { --- -1.8.5.2 - diff --git a/package/gd/gd.hash b/package/gd/gd.hash new file mode 100644 index 0000000000..8edbb1ad52 --- /dev/null +++ b/package/gd/gd.hash @@ -0,0 +1,2 @@ +# Locally calculated +sha256 9ada1ed45594abc998ebc942cef12b032fbad672e73efc22bc9ff54f5df2b285 libgd-2.1.1.tar.xz diff --git a/package/gd/gd.mk b/package/gd/gd.mk index d7a65128fe..2991cd5a76 100644 --- a/package/gd/gd.mk +++ b/package/gd/gd.mk @@ -4,13 +4,12 @@ # ################################################################################ -GD_VERSION = 2.1.0 +GD_VERSION = 2.1.1 GD_SOURCE = libgd-$(GD_VERSION).tar.xz GD_SITE = https://bitbucket.org/libgd/gd-libgd/downloads GD_INSTALL_STAGING = YES GD_LICENSE = GD license GD_LICENSE_FILES = COPYING - GD_CONFIG_SCRIPTS = gdlib-config GD_CONF_OPTS = --without-x --disable-rpath GD_DEPENDENCIES = host-pkgconf