From d79c636d4a9bd803d831b1b09f4707a62892cd11 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Jul 22 2016 06:18:28 +0000 Subject: add upstream patch to fix build error --- diff --git a/gd-2.2.3-tests.patch b/gd-2.2.3-tests.patch new file mode 100644 index 0000000..4e030ae --- /dev/null +++ b/gd-2.2.3-tests.patch @@ -0,0 +1,42 @@ +From 2b3dd57a6ccb2940f2e9119ae04e14362e2a1f61 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 22 Jul 2016 08:14:12 +0200 +Subject: [PATCH] Fix gd2/gd2_read.c:8:6: error: 'error' may be used + uninitialized in this function [-Werror=maybe-uninitialized] + +Also report about any error, not only the last one. +--- + tests/gd2/gd2_read.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/tests/gd2/gd2_read.c b/tests/gd2/gd2_read.c +index 94fe069..8ce8bd1 100644 +--- a/tests/gd2/gd2_read.c ++++ b/tests/gd2/gd2_read.c +@@ -5,7 +5,7 @@ + + int main(int argc, char *argv[]) + { +- int error, i = 0; ++ int error = 0, i = 0; + gdImagePtr im, exp; + FILE *fp; + char *path[] = { +@@ -40,8 +40,6 @@ int main(int argc, char *argv[]) + gdTestErrorMsg("image %s differs from expected result\n", path[i]); + gdImageDestroy(im); + error = 1; +- } else { +- error = 0; + } + if (exp) { + gdImageDestroy(exp); +@@ -52,8 +50,6 @@ int main(int argc, char *argv[]) + gdTestErrorMsg("image %s should have failed to be loaded\n", path[i]); + gdImageDestroy(im); + error = 1; +- } else { +- error = 0; + } + } + i++; diff --git a/gd.spec b/gd.spec index 11c3f14..3c57ca8 100644 --- a/gd.spec +++ b/gd.spec @@ -18,6 +18,7 @@ Source0: https://github.com/libgd/libgd/releases/download/gd-%{version}/li %endif Patch1: gd-2.1.0-multilib.patch +Patch2: gd-2.2.3-tests.patch BuildRequires: freetype-devel BuildRequires: fontconfig-devel @@ -76,6 +77,7 @@ files for gd, a graphics library for creating PNG and JPEG graphics. %prep %setup -q -n libgd-%{version}%{?prever:-%{prever}} %patch1 -p1 -b .mlib +%patch2 -p1 -b .build : $(perl config/getver.pl)