From owner-svn-ports-all@FreeBSD.ORG Fri Dec 26 14:19:03 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8190F3CF; Fri, 26 Dec 2014 14:19:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CCBE223C; Fri, 26 Dec 2014 14:19:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBQEJ31U028550; Fri, 26 Dec 2014 14:19:03 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBQEJ320028548; Fri, 26 Dec 2014 14:19:03 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <201412261419.sBQEJ320028548@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Fri, 26 Dec 2014 14:19:03 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r375623 - in head/astro/xplanet: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Dec 2014 14:19:03 -0000 Author: antoine Date: Fri Dec 26 14:19:01 2014 New Revision: 375623 URL: https://svnweb.freebsd.org/changeset/ports/375623 QAT: https://qat.redports.org/buildarchive/r375623/ Log: Allow building with either giflib 4.2 or 5.0 Added: head/astro/xplanet/files/patch-src_libimage_gif.c (contents, props changed) Modified: head/astro/xplanet/Makefile Modified: head/astro/xplanet/Makefile ============================================================================== --- head/astro/xplanet/Makefile Fri Dec 26 13:57:53 2014 (r375622) +++ head/astro/xplanet/Makefile Fri Dec 26 14:19:01 2014 (r375623) @@ -37,8 +37,6 @@ TIFF_LIB_DEPENDS= libtiff.so:${PORTSDIR} post-extract: @${REINPLACE_CMD} -e "s/default/default.sample/g" ${WRKSRC}/Makefile.in - @${REINPLACE_CMD} -e "s/PrintGifError();/GifError();/g" \ - ${WRKSRC}/src/libimage/gif.c @${MV} ${WRKSRC}/xplanet/config/default ${WRKSRC}/xplanet/config/default.sample .include Added: head/astro/xplanet/files/patch-src_libimage_gif.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/astro/xplanet/files/patch-src_libimage_gif.c Fri Dec 26 14:19:01 2014 (r375623) @@ -0,0 +1,190 @@ +--- src/libimage/gif.c.orig 2006-03-25 22:50:51 UTC ++++ src/libimage/gif.c +@@ -28,6 +28,26 @@ + distribution. + */ + ++static void ++#if GIFLIB_MAJOR >= 5 ++localPrintGifError(int ErrorCode) ++#else ++localPrintGifError(void) ++#endif ++{ ++#if GIFLIB_MAJOR >= 5 ++ char *Err = GifErrorString(ErrorCode); ++#else ++ char *Err = GifErrorString(); ++ int ErrorCode = GifError(); ++#endif ++ ++ if (Err != NULL) ++ fprintf(stderr, "\nGIF-LIB error: %s.\n", Err); ++ else ++ fprintf(stderr, "\nGIF-LIB undefined error %d.\n", ErrorCode); ++} ++ + int + read_gif(const char *filename, int *width, int *height, unsigned char **rgb) + { +@@ -42,11 +62,15 @@ read_gif(const char *filename, int *widt + int color_index; + unsigned char *ptr = NULL; + ++#if GIFLIB_MAJOR >= 5 ++ infile = DGifOpenFileName(filename, NULL); ++#else + infile = DGifOpenFileName(filename); ++#endif + + if (infile == NULL) + { +- PrintGifError(); ++ fprintf(stderr, "Can't open GIF file %s\n", filename); + return(0); + } + +@@ -54,7 +78,11 @@ read_gif(const char *filename, int *widt + { + if (DGifGetRecordType(infile, &record_type) == GIF_ERROR) + { +- PrintGifError(); ++#if GIFLIB_MAJOR >= 5 ++ localPrintGifError(infile->Error); ++#else ++ localPrintGifError(); ++#endif + return(0); + } + +@@ -63,7 +91,11 @@ read_gif(const char *filename, int *widt + case IMAGE_DESC_RECORD_TYPE: + if (DGifGetImageDesc(infile) == GIF_ERROR) + { +- PrintGifError(); ++#if GIFLIB_MAJOR >= 5 ++ localPrintGifError(infile->Error); ++#else ++ localPrintGifError(); ++#endif + return(0); + } + +@@ -107,14 +139,22 @@ read_gif(const char *filename, int *widt + GifByteType *ext; + if (DGifGetExtension(infile, &ext_code, &ext) == GIF_ERROR) + { +- PrintGifError(); ++#if GIFLIB_MAJOR >= 5 ++ localPrintGifError(infile->Error); ++#else ++ localPrintGifError(); ++#endif + return(0); + } + while (ext != NULL) + { + if (DGifGetExtensionNext(infile, &ext) == GIF_ERROR) + { +- PrintGifError(); ++#if GIFLIB_MAJOR >= 5 ++ localPrintGifError(infile->Error); ++#else ++ localPrintGifError(); ++#endif + return(0); + } + } +@@ -178,7 +218,11 @@ write_gif(const char *filename, int widt + return(0); + } + ++#if GIFLIB_MAJOR >= 5 ++ colormap = GifMakeMapObject(colormap_size, NULL); ++#else + colormap = MakeMapObject(colormap_size, NULL); ++#endif + + for (i = 0; i < width * height; i++) + { +@@ -187,10 +231,15 @@ write_gif(const char *filename, int widt + blue[i] = (GifByteType) rgb[3*i+2]; + } + ++#if GIFLIB_MAJOR >= 5 ++ if (GifQuantizeBuffer(width, height, &colormap_size, red, green, blue, ++ buffer, colormap->Colors) == GIF_ERROR) ++#else + if (QuantizeBuffer(width, height, &colormap_size, red, green, blue, + buffer, colormap->Colors) == GIF_ERROR) ++#endif + { +- PrintGifError(); ++ fprintf(stderr, "Can't quantize buffer\n"); + return(0); + } + +@@ -198,24 +247,36 @@ write_gif(const char *filename, int widt + free(green); + free(blue); + +- outfile = EGifOpenFileName((char *) filename, FALSE); ++#if GIFLIB_MAJOR >= 5 ++ outfile = EGifOpenFileName((char *) filename, false, NULL); ++#else ++ outfile = EGifOpenFileName((char *) filename, false); ++#endif + if (outfile == NULL) + { +- PrintGifError(); ++ fprintf(stderr, "Can't open GIF file %s\n", filename); + return(0); + } + + if (EGifPutScreenDesc(outfile, width, height, colormap_size, 0, colormap) + == GIF_ERROR) + { +- PrintGifError(); ++#if GIFLIB_MAJOR >= 5 ++ localPrintGifError(outfile->Error); ++#else ++ localPrintGifError(); ++#endif + return(0); + } + +- if (EGifPutImageDesc(outfile, 0, 0, width, height, FALSE, NULL) ++ if (EGifPutImageDesc(outfile, 0, 0, width, height, false, NULL) + == GIF_ERROR) + { +- PrintGifError(); ++#if GIFLIB_MAJOR >= 5 ++ localPrintGifError(outfile->Error); ++#else ++ localPrintGifError(); ++#endif + return(0); + } + +@@ -224,7 +285,11 @@ write_gif(const char *filename, int widt + { + if (EGifPutLine(outfile, ptr, width) == GIF_ERROR) + { +- PrintGifError(); ++#if GIFLIB_MAJOR >= 5 ++ localPrintGifError(outfile->Error); ++#else ++ localPrintGifError(); ++#endif + return(0); + } + ptr += width; +@@ -233,7 +298,7 @@ write_gif(const char *filename, int widt + EGifSpew(outfile); + + if (EGifCloseFile(outfile) == GIF_ERROR) +- PrintGifError(); ++ fprintf(stderr, "Can't close GIF file %s\n", filename); + + free(buffer); +