Drop obsolete/applied patches. Refresh the rest, and add sequence numbers.
Add a patch fixing build against uClibc when UCLIBC_HAS_LONG_DOUBLE_MATH is
missing.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
--- /dev/null
+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 <thomas.petazzoni@free-electrons.com>
+
+--- 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@"
+ ;;
--- /dev/null
+[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 <jacmet@sunsite.dk>
+---
+ 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 */
--- /dev/null
+From ea2a03e983acf34a1320b460dcad43b7e0b0b14f Mon Sep 17 00:00:00 2001
+Message-Id: <ea2a03e983acf34a1320b460dcad43b7e0b0b14f.1397134306.git.baruch@tkos.co.il>
+From: Baruch Siach <baruch@tkos.co.il>
+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 <baruch@tkos.co.il>
+---
+ 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 <features.h>
++#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
+
+++ /dev/null
-Patch from Gentoo:
-http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-libs/gd/files/gd-2.0.35-fontconfig.patch?view=log
-
-fix from upstream
-
-http://bugs.gentoo.org/363367
-
-# HG changeset patch
-# User tabe
-# Date 1239812355 0
-# Node ID 3ea283efcdafcb2acc1dd0ace1d3d48da6d8cec8
-# Parent 4f29a877875f63cee5a64e7bea406a61882a565e
-fixed FS#199
-
-199, Fixed useFontConfig() to work as documented (Ethan Merritt)
-
-diff -r 4f29a877875f -r 3ea283efcdaf gdft.c
---- a/gdft.c Sat Apr 04 12:00:37 2009 +0000
-+++ b/gdft.c Wed Apr 15 16:19:15 2009 +0000
-@@ -1659,7 +1659,7 @@
- BGD_DECLARE(int) gdFTUseFontConfig(int flag)
- {
- #ifdef HAVE_LIBFONTCONFIG
-- fontConfigFlag = 1;
-+ fontConfigFlag = flag;
- return 1;
- #else
- return 0;
+++ /dev/null
-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 <thomas.petazzoni@free-electrons.com>
-
---- a/config/gdlib-config.in
-+++ b/config/gdlib-config.in
-@@ -71,7 +71,7 @@ while test $# -gt 0; do
- echo @LDFLAGS@
- ;;
- --libs)
-- echo @LIBS@ @LIBICONV@
-+ echo @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@"
- ;;
+++ /dev/null
-Seems gd is using an ancient gettext for m4 sources which has issues.
-Idea from OpenWRT patch and general knowledge on the internetweb.
-
-Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
-
-diff -Nura gd-2.0.35.orig/configure.ac gd-2.0.35/configure.ac
---- gd-2.0.35.orig/configure.ac 2012-12-15 08:36:07.165683957 -0300
-+++ gd-2.0.35/configure.ac 2012-12-15 08:42:59.354213570 -0300
-@@ -61,7 +61,7 @@
- AC_HEADER_STDC
- AC_CHECK_HEADERS([errno.h limits.h stddef.h stdlib.h string.h unistd.h])
-
--AM_ICONV
-+m4_pattern_allow([AM_ICONV])
- # if test -n "$LIBICONV" ; then
- # LIBS="$LIBS $LIBICONV"
- # fi
+++ /dev/null
-Call the libpng12-confg and libpng-config specified by
-$LIBPNG12_CONFIG and $LIBPNG_CONFIG variables that are set by
-ac_cv_path_LIBPNG12_CONFIG and ac_cv_path_LIBPNG_CONFIG. This is
-important for cross compiler that need to get the staging settings
-instead of the host settings.
-
-Signed-off-by: Jean-Christian de Rivaz <jc@eclis.ch>
-
-diff -Nura gd-2.0.35.orig/configure.ac gd-2.0.35/configure.ac
---- gd-2.0.35.orig/configure.ac 2013-01-18 02:00:59.000000000 +0100
-+++ gd-2.0.35/configure.ac 2013-01-18 02:01:44.000000000 +0100
-@@ -353,14 +353,14 @@
- AC_PATH_PROG([LIBPNG12_CONFIG], [libpng12-config])
- AC_PATH_PROG([LIBPNG_CONFIG], [libpng-config])
- if test -n "$LIBPNG12_CONFIG"; then
-- libpng_CPPFLAGS=`libpng12-config --cflags`
-+ libpng_CPPFLAGS=`$LIBPNG12_CONFIG --cflags`
- # should be --ldopts, but it's currently broken
-- libpng_LDFLAGS=`libpng12-config --ldflags`
-+ libpng_LDFLAGS=`$LIBPNG12_CONFIG --ldflags`
- libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'`
- elif test -n "$LIBPNG_CONFIG"; then
-- libpng_CPPFLAGS=`libpng-config --cflags`
-+ libpng_CPPFLAGS=`$LIBPNG_CONFIG --cflags`
- # should be --ldopts, but it's currently broken
-- libpng_LDFLAGS=`libpng-config --ldflags`
-+ libpng_LDFLAGS=`$LIBPNG_CONFIG --ldflags`
- libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'`
- elif test -d "$withval"; then
- libpng_CPPFLAGS="-I$withval/include"
+++ /dev/null
-Patch from Gentoo:
-http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-libs/gd/files/gd-2.0.35-maxcolors.patch?view=log
-
-http://bugs.gentoo.org/292130
-
-fix in usptream repo already
-
---- gd-2.0.35/gd_gd.c
-+++ gd-2.0.35/gd_gd.c
-@@ -44,6 +44,10 @@
- {
- goto fail1;
- }
-+ if (im->colorsTotal > gdMaxColors)
-+ {
-+ goto fail1;
-+ }
- }
- /* Int to accommodate truecolor single-color transparency */
- if (!gdGetInt (&im->transparent, in))
+++ /dev/null
-[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 <jacmet@sunsite.dk>
----
- gd_gd2.c | 30 ++++++++++++++++++++++++++++++
- 1 file changed, 30 insertions(+)
-
-Index: gd-2.0.35/gd_gd2.c
-===================================================================
---- gd-2.0.35.orig/gd_gd2.c
-+++ gd-2.0.35/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 */
#
################################################################################
-GD_VERSION = 2.0.35
-GD_SOURCE = gd-$(GD_VERSION).tar.bz2
-GD_SITE = http://distfiles.gentoo.org/distfiles
-# needed because of configure.ac timestamp
-GD_AUTORECONF = YES
+GD_VERSION = 2.1.0
+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_OPT = --without-x --disable-rpath
-ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)$(BR2_PREFER_STATIC_LIB),yy)
-# add -pthread when linking executables statically
-GD_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -pthread"
-endif
-
ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
GD_DEPENDENCIES += fontconfig
GD_CONF_OPT += --with-fontconfig
ifeq ($(BR2_PACKAGE_FREETYPE),y)
GD_DEPENDENCIES += freetype
-GD_CONF_ENV += ac_cv_path_FREETYPE_CONFIG=$(STAGING_DIR)/usr/bin/freetype-config
+GD_CONF_OPT += --with-freetype=$(STAGING_DIR)/usr
else
GD_CONF_OPT += --without-freetype
endif
ifeq ($(BR2_PACKAGE_LIBPNG),y)
GD_DEPENDENCIES += libpng
-GD_CONF_OPT += --with-png
-GD_CONF_ENV += ac_cv_path_LIBPNG12_CONFIG=""
-GD_CONF_ENV += ac_cv_path_LIBPNG_CONFIG=$(STAGING_DIR)/usr/bin/libpng-config
+GD_CONF_OPT += --with-png=$(STAGING_DIR)/usr
else
GD_CONF_OPT += --without-png
endif
GD_DEPENDENCIES += zlib
endif
-ifeq ($(BR2_PACKAGE_GETTEXT),y)
-GD_DEPENDENCIES += gettext
-else
-# configure.ac has newer timestamp than aclocal.m4 / configure, so we need
-# to autoreconf to regenerate them (or set configure.ac timestamp to older
-# than them) to make the Makefile happy.
-# configure.ac refers to AM_ICONV which we only have if gettext is enabled,
-# so add a dummy definition elsewise
-define GD_FIXUP_ICONV
- echo 'm4_ifndef([AM_ICONV],[m4_define([AM_ICONV],[:])])' \
- >> $(@D)/acinclude.m4
-endef
-
-GD_PRE_CONFIGURE_HOOKS += GD_FIXUP_ICONV
-endif
-
GD_TOOLS_$(BR2_PACKAGE_GD_ANNOTATE) += annotate
GD_TOOLS_$(BR2_PACKAGE_GD_BDFTOGD) += bdftogd
GD_TOOLS_$(BR2_PACKAGE_GD_GD2COPYPAL) += gd2copypal