diff options
author | nork <nork@FreeBSD.org> | 2003-07-12 02:16:14 +0800 |
---|---|---|
committer | nork <nork@FreeBSD.org> | 2003-07-12 02:16:14 +0800 |
commit | 07d4243107c7c11506a607480ffa2c5fbb716299 (patch) | |
tree | 8105e7b9bfe65fc36d1797e9690cdbdc1ba972ff | |
parent | b928507d6b0aa80a3d71cc58c69fe7d62d53fc62 (diff) | |
download | freebsd-ports-gnome-07d4243107c7c11506a607480ffa2c5fbb716299.tar.gz freebsd-ports-gnome-07d4243107c7c11506a607480ffa2c5fbb716299.tar.zst freebsd-ports-gnome-07d4243107c7c11506a607480ffa2c5fbb716299.zip |
o Change library name from libgd to libgd1.
o Do not install everything except headers and libraries
(to avoid conflicting with graphics/gd2)
o Fix dependency on new libgd1(for many ports).
PR: ports/54100
Submitted by: Ports Fury
48 files changed, 1606 insertions, 526 deletions
diff --git a/astro/rmap/Makefile b/astro/rmap/Makefile index 61fe96ce9b89..3f32d1f7003c 100644 --- a/astro/rmap/Makefile +++ b/astro/rmap/Makefile @@ -7,21 +7,21 @@ PORTNAME= rmap PORTVERSION= 1.2 -PORTREVISION= 1 +PORTREVISION= 3 CATEGORIES= astro MASTER_SITES= http://www.reza.net/rmap/ MAINTAINER= trevor@FreeBSD.org COMMENT= Generates images of the Earth centered at a particular location -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd \ +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 \ gnugetopt.1:${PORTSDIR}/devel/libgnugetopt MAN1= rmap.1 GNU_CONFIGURE= yes USE_GMAKE= yes -CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -I ${LOCALBASE}/include/gd/" \ +CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ LIBS="-L${LOCALBASE}/lib -lgnugetopt" .include <bsd.port.mk> diff --git a/biology/emboss/Makefile b/biology/emboss/Makefile index c847e0ad7627..13b9cc4c2341 100644 --- a/biology/emboss/Makefile +++ b/biology/emboss/Makefile @@ -7,6 +7,7 @@ PORTNAME= emboss PORTVERSION= 2.4.1 +PORTREVISION= 1 CATEGORIES= biology MASTER_SITES= ftp://ftp.uk.embnet.org/pub/EMBOSS/old/ \ ftp://ftp.es.embnet.org/pub/software/emboss/EMBOSS/ \ @@ -18,7 +19,7 @@ EXTRACT_ONLY= ${PORTNAME:U}-${PORTVERSION}${EXTRACT_SUFX} MAINTAINER= wjv@FreeBSD.org COMMENT= A collection of open source tools for genetic sequence analysis -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 USE_SUBMAKE= yes USE_GMAKE= yes diff --git a/biology/genpak/Makefile b/biology/genpak/Makefile index 74c8fdb151fe..bbe6849ae57f 100644 --- a/biology/genpak/Makefile +++ b/biology/genpak/Makefile @@ -8,6 +8,7 @@ PORTNAME= genpak PORTVERSION= 0.26 +PORTREVISION= 1 CATEGORIES= biology MASTER_SITES= http://www.bioinformatics.org/genpak/download/ DISTNAME= gp-${PORTVERSION} @@ -16,8 +17,7 @@ EXTRACT_SUFX= .tgz MAINTAINER= ports@FreeBSD.org COMMENT= GP is a set of small utilities to manipulate DNA sequences -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd \ - png.5:${PORTSDIR}/graphics/png +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 USE_GMAKE= yes MAKE_ENV= GMAKE="${GMAKE}" MANPREFIX="${MANPREFIX}" diff --git a/comms/hamlib/Makefile b/comms/hamlib/Makefile index ba59b2468734..f98491bdf244 100644 --- a/comms/hamlib/Makefile +++ b/comms/hamlib/Makefile @@ -34,7 +34,7 @@ PLIST_SUB+= TCL="@comment " .endif .if defined(WITH_RIGMATRIX) -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 CONFIGURE_ARGS+= --with-rigmatrix PLIST_SUB+= RIGMATRIX="" .else diff --git a/databases/grass-i18n/Makefile b/databases/grass-i18n/Makefile index 7e2a623d8b35..60847a9fb699 100644 --- a/databases/grass-i18n/Makefile +++ b/databases/grass-i18n/Makefile @@ -7,6 +7,7 @@ PORTNAME= grass PORTVERSION= 5.0.0 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= databases MASTER_SITES= http://grass.itc.it/grass5/source/ \ @@ -20,7 +21,7 @@ POSTGRESQL_PORT?= databases/postgresql7 LIB_DEPENDS= tiff.4:${PORTSDIR}/graphics/tiff \ png.5:${PORTSDIR}/graphics/png \ jpeg.9:${PORTSDIR}/graphics/jpeg \ - gd.2:${PORTSDIR}/graphics/gd \ + gd.4:${PORTSDIR}/graphics/gd2 \ fftw.2:${PORTSDIR}/math/fftw \ iconv.3:${PORTSDIR}/converters/libiconv \ freetype.9:${PORTSDIR}/print/freetype2 \ diff --git a/databases/grass/Makefile b/databases/grass/Makefile index 7e2a623d8b35..60847a9fb699 100644 --- a/databases/grass/Makefile +++ b/databases/grass/Makefile @@ -7,6 +7,7 @@ PORTNAME= grass PORTVERSION= 5.0.0 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= databases MASTER_SITES= http://grass.itc.it/grass5/source/ \ @@ -20,7 +21,7 @@ POSTGRESQL_PORT?= databases/postgresql7 LIB_DEPENDS= tiff.4:${PORTSDIR}/graphics/tiff \ png.5:${PORTSDIR}/graphics/png \ jpeg.9:${PORTSDIR}/graphics/jpeg \ - gd.2:${PORTSDIR}/graphics/gd \ + gd.4:${PORTSDIR}/graphics/gd2 \ fftw.2:${PORTSDIR}/math/fftw \ iconv.3:${PORTSDIR}/converters/libiconv \ freetype.9:${PORTSDIR}/print/freetype2 \ diff --git a/devel/cvsgraph/Makefile b/devel/cvsgraph/Makefile index 313f35962f57..bb6dceac4363 100644 --- a/devel/cvsgraph/Makefile +++ b/devel/cvsgraph/Makefile @@ -7,13 +7,14 @@ PORTNAME= cvsgraph PORTVERSION= 1.2.0 +PORTREVISION= 1 CATEGORIES= devel graphics MASTER_SITES= http://www.akhphd.au.dk/~bertho/cvsgraph/release/ MAINTAINER= trevor@FreeBSD.org COMMENT= Graph the life story of a file under CVS or RCS -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd \ +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 \ jpeg.9:${PORTSDIR}/graphics/jpeg \ png.5:${PORTSDIR}/graphics/png diff --git a/devel/veepee/Makefile b/devel/veepee/Makefile index 8f5156820e86..9893d3aeb32e 100644 --- a/devel/veepee/Makefile +++ b/devel/veepee/Makefile @@ -7,7 +7,7 @@ PORTNAME= veepee PORTVERSION= 1.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel python gnome MASTER_SITES= http://www.river-bank.demon.co.uk/software/ DISTNAME= VeePee-${PORTVERSION} @@ -15,7 +15,7 @@ DISTNAME= VeePee-${PORTVERSION} MAINTAINER= sobomax@FreeBSD.org COMMENT= A user orientated scripting environment for embedding in applications -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 USE_GNOME= gnomelibs USE_XLIB= yes diff --git a/graphics/ecg2png/Makefile b/graphics/ecg2png/Makefile index be5209f0640e..8f64c2671b54 100644 --- a/graphics/ecg2png/Makefile +++ b/graphics/ecg2png/Makefile @@ -7,14 +7,14 @@ PORTNAME= ecg2png PORTVERSION= 0.30 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= graphics MASTER_SITES= http://www.cardiothink.com/downloads/ecg2png/ MAINTAINER= ports@freebsd.org COMMENT= "Converts scanned 12-lead electrocardiograms into PNGs" -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 WRKSRC= ${WRKDIR}/${PORTNAME} diff --git a/graphics/g2/Makefile b/graphics/g2/Makefile index 5f850e324c83..a3fd364ffefe 100644 --- a/graphics/g2/Makefile +++ b/graphics/g2/Makefile @@ -7,7 +7,7 @@ PORTNAME= g2 PORTVERSION= 0.40 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= graphics MASTER_SITES= ${MASTER_SITE_SUNSITE} MASTER_SITE_SUBDIR= libs/graphics @@ -15,11 +15,11 @@ MASTER_SITE_SUBDIR= libs/graphics MAINTAINER= billf@FreeBSD.org COMMENT= An easy to use, portable and powerful 2D graphics library -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 USE_XLIB= yes GNU_CONFIGURE= yes -CONFIGURE_ENV= CFLAGS="${CFLAGS} -I${PREFIX}/include/gd" +CONFIGURE_ENV= CFLAGS="${CFLAGS} -I${LOCALBASE}/include" do-build: cd ${WRKSRC} ; make depend ; make diff --git a/graphics/gd/Makefile b/graphics/gd/Makefile index 7f341cd7cd04..afc96e0f11ee 100644 --- a/graphics/gd/Makefile +++ b/graphics/gd/Makefile @@ -7,32 +7,22 @@ PORTNAME= gd PORTVERSION= 1.8.4 -PORTREVISION= 6 +PORTREVISION= 7 PORTEPOCH= 1 CATEGORIES+= graphics MASTER_SITES= http://www.boutell.com/gd/http/ \ ftp://ftp.boutell.com/pub/boutell/gd/ \ - http://virtual-estates.net/~mi/port-stuff/ \ ${MASTER_SITE_RINGSERVER} MASTER_SITE_SUBDIR= graphics/gd -DISTFILES= ${DISTNAME}${EXTRACT_SUFX} gd_gif_in.c.bz2 -EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER?= ports@FreeBSD.org -COMMENT?= A graphics library for fast image creation - -BUILD_DEPENDS= freetype-config:${PORTSDIR}/print/freetype2 # XXX -LIB_DEPENDS= jpeg:${PORTSDIR}/graphics/jpeg \ - png:${PORTSDIR}/graphics/png \ - freetype:${PORTSDIR}/print/freetype2 -.if !exists(/usr/bin/bzip2) -BUILD_DEPENDS+= bzip2:${PORTSDIR}/archivers/bzip2 -.endif +COMMENT?= A graphics library for fast creation of images -FREETYPE_CONFIG?= ${LOCALBASE}/bin/freetype-config +LIB_DEPENDS= jpeg.9:${PORTSDIR}/graphics/jpeg \ + png.5:${PORTSDIR}/graphics/png \ + freetype.9:${PORTSDIR}/print/freetype2 -USE_REINPLACE= yes -MAKE_ENV= FREETYPE_CONFIG="${FREETYPE_CONFIG}" +MAKEFILE= ${FILESDIR}/Makefile.lib INSTALLS_SHLIB= yes .if defined(WITH_X11) @@ -48,16 +38,6 @@ pre-everything:: .endif post-extract: - @${BZIP2_CMD} -dc ${DISTDIR}/${DIST_SUBDIR}/gd_gif_in.c.bz2 \ - > ${WRKSRC}/gd_gif_in.c - -post-patch: - @${REINPLACE_CMD} -e 's|<malloc.h>|<stdlib.h>|g' ${WRKSRC}/gdcache.h - -post-install: -.if !defined(NOPORTDOCS) - @${MKDIR} ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/index.html ${DOCSDIR} -.endif + @${CP} ${FILESDIR}/gd_gif_in.c ${WRKSRC} .include <bsd.port.mk> diff --git a/graphics/gd/files/Makefile.lib b/graphics/gd/files/Makefile.lib new file mode 100644 index 000000000000..8306444eb839 --- /dev/null +++ b/graphics/gd/files/Makefile.lib @@ -0,0 +1,36 @@ +# $FreeBSD$ + +PREFIX?= /usr/local +SHLIB_VER?= 2 + +LIB= gd1 +LIBDIR= ${PREFIX}/lib +SHLIB_MAJOR= ${SHLIB_VER} +SHLIB_MINOR= 0 +NOPROFILE= yes +NOOBJ= yes + +INCS= gd.h gd_io.h gdcache.h gdfontg.h gdfontl.h gdfontmb.h \ + gdfonts.h gdfontt.h +INCSDIR= ${PREFIX}/include/gd +INCDIR= ${INSCDIR} # for pre-bsd.incs.mk API + +SRCS= gd.c gd_gd.c gd_gd2.c gd_io.c gd_io_dp.c gd_io_file.c gd_ss.c \ + gd_io_ss.c gd_png.c gd_jpeg.c gdxpm.c gdfontt.c gdfonts.c \ + gdfontmb.c gdfontl.c gdfontg.c gdtables.c gdft.c gdttf.c \ + gdcache.c gdkanji.c wbmp.c gd_wbmp.c gdhelpers.c gd_gif_in.c + +CFLAGS+= -I${.CURDIR} -I${LOCALBASE}/include/freetype2/freetype \ + -I${LOCALBASE}/include/freetype2 -I${LOCALBASE}/include \ + -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE -DHAVE_LIBZ +LDADD= -L${LOCALBASE}/lib -lfreetype -ljpeg -lpng -lz + +.ifdef WITH_X11 +CFLAGS+= -I${X11BASE}/include/X11 -I${X11BASE}/include -DHAVE_LIBXPM +LDADD+= -L${X11BASE}/lib -lXpm -lX11 +.endif + +beforeinstall: + mkdir -p ${INCSDIR} + +.include <bsd.lib.mk> diff --git a/graphics/gd/files/gd_gif_in.c b/graphics/gd/files/gd_gif_in.c new file mode 100644 index 000000000000..6e779c820963 --- /dev/null +++ b/graphics/gd/files/gd_gif_in.c @@ -0,0 +1,561 @@ +#include <stdio.h> +#include <math.h> +#include <string.h> +#include <stdlib.h> +#include "gd.h" + +/* Used only when debugging GIF compression code */ +/* #define DEBUGGING_ENVARS */ + +#ifdef DEBUGGING_ENVARS + +static int verbose_set = 0; +static int verbose; +#define VERBOSE (verbose_set?verbose:set_verbose()) + +static int set_verbose(void) +{ + verbose = !!getenv("GIF_VERBOSE"); + verbose_set = 1; + return(verbose); +} + +#else + +#define VERBOSE 0 + +#endif + + +#define MAXCOLORMAPSIZE 256 + +#define TRUE 1 +#define FALSE 0 + +#define CM_RED 0 +#define CM_GREEN 1 +#define CM_BLUE 2 + +#define MAX_LWZ_BITS 12 + +#define INTERLACE 0x40 +#define LOCALCOLORMAP 0x80 +#define BitSet(byte, bit) (((byte) & (bit)) == (bit)) + +#define ReadOK(file,buffer,len) (gdGetBuf(buffer, len, file) != 0) + +#define LM_to_uint(a,b) (((b)<<8)|(a)) + +/* We may eventually want to use this information, but def it out for now */ +#if 0 +static struct { + unsigned int Width; + unsigned int Height; + unsigned char ColorMap[3][MAXCOLORMAPSIZE]; + unsigned int BitPixel; + unsigned int ColorResolution; + unsigned int Background; + unsigned int AspectRatio; +} GifScreen; +#endif + +static struct { + int transparent; + int delayTime; + int inputFlag; + int disposal; +} Gif89 = { -1, -1, -1, 0 }; + +static int ReadColorMap (gdIOCtx *fd, int number, unsigned char (*buffer)[256]); +static int DoExtension (gdIOCtx *fd, int label, int *Transparent); +static int GetDataBlock (gdIOCtx *fd, unsigned char *buf); +static int GetCode (gdIOCtx *fd, int code_size, int flag); +static int LWZReadByte (gdIOCtx *fd, int flag, int input_code_size); + +static void ReadImage (gdImagePtr im, gdIOCtx *fd, int len, int height, unsigned char (*cmap)[256], int interlace); /*1.4//, int ignore); */ + +int ZeroDataBlock; + +gdImagePtr +gdImageCreateFromGif(FILE *fdFile) +{ + gdIOCtx *fd = gdNewFileCtx(fdFile); + gdImagePtr im = 0; + + im = gdImageCreateFromGifCtx(fd); + + fd->free(fd); + + return im; +} + +gdImagePtr +gdImageCreateFromGifCtx(gdIOCtxPtr fd) +{ + int imageNumber; + int BitPixel; + int ColorResolution; + int Background; + int AspectRatio; + int Transparent = (-1); + unsigned char buf[16]; + unsigned char c; + unsigned char ColorMap[3][MAXCOLORMAPSIZE]; + unsigned char localColorMap[3][MAXCOLORMAPSIZE]; + int imw, imh; + int useGlobalColormap; + int bitPixel; + int i; + /*1.4//int imageCount = 0; */ + char version[4]; + + gdImagePtr im = 0; + ZeroDataBlock = FALSE; + + /*1.4//imageNumber = 1; */ + if (! ReadOK(fd,buf,6)) { + return 0; + } + if (strncmp((char *)buf,"GIF",3) != 0) { + return 0; + } + strncpy(version, (char *)buf + 3, 3); + version[3] = '\0'; + + if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) { + return 0; + } + if (! ReadOK(fd,buf,7)) { + return 0; + } + BitPixel = 2<<(buf[4]&0x07); + ColorResolution = (int) (((buf[4]&0x70)>>3)+1); + Background = buf[5]; + AspectRatio = buf[6]; + + if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */ + if (ReadColorMap(fd, BitPixel, ColorMap)) { + return 0; + } + } + for (;;) { + if (! ReadOK(fd,&c,1)) { + return 0; + } + if (c == ';') { /* GIF terminator */ + goto terminated; + } + + if (c == '!') { /* Extension */ + if (! ReadOK(fd,&c,1)) { + return 0; + } + DoExtension(fd, c, &Transparent); + continue; + } + + if (c != ',') { /* Not a valid start character */ + continue; + } + + /*1.4//++imageCount; */ + + if (! ReadOK(fd,buf,9)) { + return 0; + } + + useGlobalColormap = ! BitSet(buf[8], LOCALCOLORMAP); + + bitPixel = 1<<((buf[8]&0x07)+1); + + imw = LM_to_uint(buf[4],buf[5]); + imh = LM_to_uint(buf[6],buf[7]); + if (!(im = gdImageCreate(imw, imh))) { + return 0; + } + im->interlace = BitSet(buf[8], INTERLACE); + if (! useGlobalColormap) { + if (ReadColorMap(fd, bitPixel, localColorMap)) { + return 0; + } + ReadImage(im, fd, imw, imh, localColorMap, + BitSet(buf[8], INTERLACE)); + /*1.4//imageCount != imageNumber); */ + } else { + ReadImage(im, fd, imw, imh, + ColorMap, + BitSet(buf[8], INTERLACE)); + /*1.4//imageCount != imageNumber); */ + } + if (Transparent != (-1)) { + gdImageColorTransparent(im, Transparent); + } + goto terminated; + } + +terminated: + /* Terminator before any image was declared! */ + if (!im) { + return 0; + } + /* Check for open colors at the end, so + we can reduce colorsTotal and ultimately + BitsPerPixel */ + for (i=((im->colorsTotal-1)); (i>=0); i--) { + if (im->open[i]) { + im->colorsTotal--; + } else { + break; + } + } + return im; +} + +static int +ReadColorMap(gdIOCtx *fd, int number, unsigned char (*buffer)[256]) +{ + int i; + unsigned char rgb[3]; + + + for (i = 0; i < number; ++i) { + if (! ReadOK(fd, rgb, sizeof(rgb))) { + return TRUE; + } + buffer[CM_RED][i] = rgb[0] ; + buffer[CM_GREEN][i] = rgb[1] ; + buffer[CM_BLUE][i] = rgb[2] ; + } + + + return FALSE; +} + +static int +DoExtension(gdIOCtx *fd, int label, int *Transparent) +{ + static unsigned char buf[256]; + + switch (label) { + case 0xf9: /* Graphic Control Extension */ + (void) GetDataBlock(fd, (unsigned char*) buf); + Gif89.disposal = (buf[0] >> 2) & 0x7; + Gif89.inputFlag = (buf[0] >> 1) & 0x1; + Gif89.delayTime = LM_to_uint(buf[1],buf[2]); + if ((buf[0] & 0x1) != 0) + *Transparent = buf[3]; + + while (GetDataBlock(fd, (unsigned char*) buf) != 0) + ; + return FALSE; + default: + break; + } + while (GetDataBlock(fd, (unsigned char*) buf) != 0) + ; + + return FALSE; +} + +static int +GetDataBlock_(gdIOCtx *fd, unsigned char *buf) +{ + unsigned char count; + + if (! ReadOK(fd,&count,1)) { + return -1; + } + + ZeroDataBlock = count == 0; + + if ((count != 0) && (! ReadOK(fd, buf, count))) { + return -1; + } + + return count; +} + +static int +GetDataBlock(gdIOCtx *fd, unsigned char *buf) +{ + int rv; + int i; + + rv = GetDataBlock_(fd,buf); + if (VERBOSE) + { printf("[GetDataBlock returning %d",rv); + if (rv > 0) + { printf(":"); + for (i=0;i<rv;i++) printf(" %02x",buf[i]); + } + printf("]\n"); + } + return(rv); +} + +static int +GetCode_(gdIOCtx *fd, int code_size, int flag) +{ + static unsigned char buf[280]; + static int curbit, lastbit, done, last_byte; + int i, j, ret; + unsigned char count; + + if (flag) { + curbit = 0; + lastbit = 0; + done = FALSE; + return 0; + } + + if ( (curbit+code_size) >= lastbit) { + if (done) { + if (curbit >= lastbit) { + /* Oh well */ + } + return -1; + } + buf[0] = buf[last_byte-2]; + buf[1] = buf[last_byte-1]; + + if ((count = GetDataBlock(fd, &buf[2])) == 0) + done = TRUE; + + last_byte = 2 + count; + curbit = (curbit - lastbit) + 16; + lastbit = (2+count)*8 ; + } + + ret = 0; + for (i = curbit, j = 0; j < code_size; ++i, ++j) + ret |= ((buf[ i / 8 ] & (1 << (i % 8))) != 0) << j; + + curbit += code_size; + return ret; +} + +static int +GetCode(gdIOCtx *fd, int code_size, int flag) +{ + int rv; + + rv = GetCode_(fd,code_size,flag); + if (VERBOSE) printf("[GetCode(,%d,%d) returning %d]\n",code_size,flag,rv); + return(rv); +} + +#define STACK_SIZE ((1<<(MAX_LWZ_BITS))*2) +static int +LWZReadByte_(gdIOCtx *fd, int flag, int input_code_size) +{ + static int fresh = FALSE; + int code, incode; + static int code_size, set_code_size; + static int max_code, max_code_size; + static int firstcode, oldcode; + static int clear_code, end_code; + static int table[2][(1<< MAX_LWZ_BITS)]; + static int stack[STACK_SIZE], *sp; + register int i; + + if (flag) { + set_code_size = input_code_size; + code_size = set_code_size+1; + clear_code = 1 << set_code_size ; + end_code = clear_code + 1; + max_code_size = 2*clear_code; + max_code = clear_code+2; + + GetCode(fd, 0, TRUE); + + fresh = TRUE; + + for (i = 0; i < clear_code; ++i) { + table[0][i] = 0; + table[1][i] = i; + } + for (; i < (1<<MAX_LWZ_BITS); ++i) + table[0][i] = table[1][0] = 0; + + sp = stack; + + return 0; + } else if (fresh) { + fresh = FALSE; + do { + firstcode = oldcode = + GetCode(fd, code_size, FALSE); + } while (firstcode == clear_code); + return firstcode; + } + + if (sp > stack) + return *--sp; + + while ((code = GetCode(fd, code_size, FALSE)) >= 0) { + if (code == clear_code) { + for (i = 0; i < clear_code; ++i) { + table[0][i] = 0; + table[1][i] = i; + } + for (; i < (1<<MAX_LWZ_BITS); ++i) + table[0][i] = table[1][i] = 0; + code_size = set_code_size+1; + max_code_size = 2*clear_code; + max_code = clear_code+2; + sp = stack; + firstcode = oldcode = + GetCode(fd, code_size, FALSE); + return firstcode; + } else if (code == end_code) { + int count; + unsigned char buf[260]; + + if (ZeroDataBlock) + return -2; + + while ((count = GetDataBlock(fd, buf)) > 0) + ; + + if (count != 0) + return -2; + } + + incode = code; + + if (sp == (stack + STACK_SIZE)) { + /* Bad compressed data stream */ + return -1; + } + + if (code >= max_code) { + *sp++ = firstcode; + code = oldcode; + } + + while (code >= clear_code) { + if (sp == (stack + STACK_SIZE)) { + /* Bad compressed data stream */ + return -1; + } + *sp++ = table[1][code]; + if (code == table[0][code]) { + /* Oh well */ + } + code = table[0][code]; + } + + *sp++ = firstcode = table[1][code]; + + if ((code = max_code) <(1<<MAX_LWZ_BITS)) { + table[0][code] = oldcode; + table[1][code] = firstcode; + ++max_code; + if ((max_code >= max_code_size) && + (max_code_size < (1<<MAX_LWZ_BITS))) { + max_code_size *= 2; + ++code_size; + } + } + + oldcode = incode; + + if (sp > stack) + return *--sp; + } + return code; +} + +static int +LWZReadByte(gdIOCtx *fd, int flag, int input_code_size) +{ + int rv; + + rv = LWZReadByte_(fd,flag,input_code_size); + if (VERBOSE) printf("[LWZReadByte(,%d,%d) returning %d]\n",flag,input_code_size,rv); + return(rv); +} + +static void +ReadImage(gdImagePtr im, gdIOCtx *fd, int len, int height, unsigned char (*cmap)[256], int interlace) /*1.4//, int ignore) */ +{ + unsigned char c; + int v; + int xpos = 0, ypos = 0, pass = 0; + int i; + /* Stash the color map into the image */ + for (i=0; (i<gdMaxColors); i++) { + im->red[i] = cmap[CM_RED][i]; + im->green[i] = cmap[CM_GREEN][i]; + im->blue[i] = cmap[CM_BLUE][i]; + im->open[i] = 1; + } + /* Many (perhaps most) of these colors will remain marked open. */ + im->colorsTotal = gdMaxColors; + /* + ** Initialize the Compression routines + */ + if (! ReadOK(fd,&c,1)) { + return; + } + if (LWZReadByte(fd, TRUE, c) < 0) { + return; + } + + /* + ** If this is an "uninteresting picture" ignore it. + ** REMOVED For 1.4 + */ + /*if (ignore) { */ + /* while (LWZReadByte(fd, FALSE, c) >= 0) */ + /* ; */ + /* return; */ + /*} */ + + while ((v = LWZReadByte(fd,FALSE,c)) >= 0 ) { + /* This how we recognize which colors are actually used. */ + if (im->open[v]) { + im->open[v] = 0; + } + gdImageSetPixel(im, xpos, ypos, v); + ++xpos; + if (xpos == len) { + xpos = 0; + if (interlace) { + switch (pass) { + case 0: + case 1: + ypos += 8; break; + case 2: + ypos += 4; break; + case 3: + ypos += 2; break; + } + + if (ypos >= height) { + ++pass; + switch (pass) { + case 1: + ypos = 4; break; + case 2: + ypos = 2; break; + case 3: + ypos = 1; break; + default: + goto fini; + } + } + } else { + ++ypos; + } + } + if (ypos >= height) + break; + } + +fini: + if (LWZReadByte(fd,FALSE,c)>=0) { + /* Ignore extra */ + } +} + diff --git a/graphics/gd/files/patch-ac b/graphics/gd/files/patch-ac deleted file mode 100644 index 9d63cb3d8eb1..000000000000 --- a/graphics/gd/files/patch-ac +++ /dev/null @@ -1,188 +0,0 @@ ---- Makefile.orig Thu Feb 22 19:03:43 2001 -+++ Makefile Sun Dec 16 05:57:07 2001 -@@ -3,22 +3,30 @@ - #If you do not have gcc, change the setting for COMPILER, but you must - #use an ANSI standard C compiler (NOT the old SunOS 4.1.3 cc - #compiler; get gcc if you are still using it). --COMPILER=gcc -+COMPILER=${CC} - - #If the ar command fails on your system, consult the ar manpage - #for your system. --AR=ar -+#AR=ar - - #If you don't have FreeType, libjpeg and/or Xpm installed, including the - #header files, uncomment this (default). You really must install - #libpng and zlib to get anywhere if you wish to create PNG images. --CFLAGS=-O -DHAVE_LIBPNG -DHAVE_LIBJPEG -+CFLAGS+=-DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE - - #If you do have FreeType, libjpeg and/or Xpm fully installed, uncomment a - #variation of this and comment out the line above. See also LIBS below. - #CFLAGS=-O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG \ - # -DHAVE_LIBFREETYPE -DHAVE_LIBTTF - -+.if defined(WITH_X11) -+CFLAGS+=-DHAVE_XPM -+.endif -+ -+.if defined(JISX0208) -+CFLAGS+=-DJISX0208 -+.endif -+ - #To use the old FreeType 1.x library, add this additional #define - #to the line above - #-DHAVE_LIBTTF -@@ -30,7 +38,7 @@ - #Some systems are very picky about link order. They don't all agree - #on the right order, either. - --LIBS=-lgd -lpng -lz -lm -+LIBS=-lgd -lpng -lz -ljpeg -lm `$(FREETYPE_CONFIG) --libs` - - #If you do have FreeType, JPEG and/or Xpm fully installed, uncomment a - #variation of this and comment out the line above. Note that -@@ -38,6 +46,10 @@ - - #LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm -lttf - -+.if defined(WITH_X11) -+LIBS+=-lXpm -lX11 -+.endif -+ - #Note: for Freetype 1.x, use DHAVE_LIBTTF and -lttf instead. - - #Typical install locations for freetype, zlib, xpm, libjpeg and libpng header -@@ -45,7 +57,11 @@ - #ensure that the version of gd you are installing is used, and not an - #older release in your directory tree somewhere. - --INCLUDEDIRS=-I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include -+INCLUDEDIRS=-I. `$(FREETYPE_CONFIG) --cflags` -I${LOCALBASE}/include -+ -+.if defined(WITH_X11) -+INCLUDEDIRS+=-I${X11BASE}/include/X11 -I${X11BASE}/include -+.endif - - #Typical install locations for freetype, zlib, xpm and libpng libraries. - #If yours are somewhere else, other than a standard location -@@ -55,16 +71,20 @@ - #on your system can't cause conflicts while building a new one. - #This line shouldn't hurt if you don't actually have some of the - #optional libraries and directories. --LIBDIRS=-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib -+LIBDIRS=-L. -L${LOCALBASE}/lib -Wl,--rpath,${LOCALBASE}/lib -+ -+.if defined(WITH_X11) -+LIBDIRS+=-L${X11BASE}/lib -Wl,--rpath,${X11BASE}/lib -+.endif - - #Location where libgd.a should be installed by "make install". --INSTALL_LIB=/usr/local/lib -+INSTALL_LIB=${PREFIX}/lib - - #Location where .h files should be installed by "make install". --INSTALL_INCLUDE=/usr/local/include -+INSTALL_INCLUDE=${PREFIX}/include/gd - - #Location where useful non-test programs should be installed by "make install". --INSTALL_BIN=/usr/local/bin -+INSTALL_BIN=${PREFIX}/bin - - # - # -@@ -74,34 +94,43 @@ - - VERSION=1.8.4 - --CC=$(COMPILER) $(INCLUDEDIRS) --LINK=$(CC) $(LIBDIRS) $(LIBS) -+CFLAGS+=$(INCLUDEDIRS) - - PROGRAMS=$(BIN_PROGRAMS) $(TEST_PROGRAMS) - - BIN_PROGRAMS=pngtogd pngtogd2 gdtopng gd2topng gd2copypal gdparttopng webpng - TEST_PROGRAMS=gdtest gddemo gd2time gdtestft gdtestttf - --all: libgd.a $(PROGRAMS) -+SOVER=2 -+ -+.SUFFIXES: .c .so .o - --install: libgd.a $(BIN_PROGRAMS) -- sh ./install-item 644 libgd.a $(INSTALL_LIB)/libgd.a -- sh ./install-item 755 pngtogd $(INSTALL_BIN)/pngtogd -- sh ./install-item 755 pngtogd2 $(INSTALL_BIN)/pngtogd2 -- sh ./install-item 755 gdtopng $(INSTALL_BIN)/gdtopng -- sh ./install-item 755 gd2topng $(INSTALL_BIN)/gd2topng -- sh ./install-item 755 gd2copypal $(INSTALL_BIN)/gd2copypal -- sh ./install-item 755 gdparttopng $(INSTALL_BIN)/gdparttopng -- sh ./install-item 755 webpng $(INSTALL_BIN)/webpng -- sh ./install-item 755 bdftogd $(INSTALL_BIN)/bdftogd -- sh ./install-item 644 gd.h $(INSTALL_INCLUDE)/gd.h -- sh ./install-item 644 gdcache.h $(INSTALL_INCLUDE)/gdcache.h -- sh ./install-item 644 gd_io.h $(INSTALL_INCLUDE)/gd_io.h -- sh ./install-item 644 gdfontg.h $(INSTALL_INCLUDE)/gdfontg.h -- sh ./install-item 644 gdfontl.h $(INSTALL_INCLUDE)/gdfontl.h -- sh ./install-item 644 gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h -- sh ./install-item 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h -- sh ./install-item 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h -+.c.so: -+ $(CC) -fpic -DPIC $(CFLAGS) -o $@ -c $< -+ -+all: libgd.a libgd.so.$(SOVER) $(PROGRAMS) -+ -+install: libgd.a libgd.so.$(SOVER) $(BIN_PROGRAMS) -+ -mkdir -p $(INSTALL_LIB) $(INSTALL_INCLUDE) $(INSTALL_BIN) -+ ${BSD_INSTALL_DATA} libgd.a $(INSTALL_LIB)/libgd.a -+ ${BSD_INSTALL_DATA} libgd.so.$(SOVER) $(INSTALL_LIB)/libgd.so.$(SOVER) -+ -ln -sf libgd.so.$(SOVER) $(INSTALL_LIB)/libgd.so -+ ${BSD_INSTALL_PROGRAM} pngtogd $(INSTALL_BIN)/pngtogd -+ ${BSD_INSTALL_PROGRAM} pngtogd2 $(INSTALL_BIN)/pngtogd2 -+ ${BSD_INSTALL_PROGRAM} gdtopng $(INSTALL_BIN)/gdtopng -+ ${BSD_INSTALL_PROGRAM} gd2topng $(INSTALL_BIN)/gd2topng -+ ${BSD_INSTALL_PROGRAM} gd2copypal $(INSTALL_BIN)/gd2copypal -+ ${BSD_INSTALL_PROGRAM} gdparttopng $(INSTALL_BIN)/gdparttopng -+ ${BSD_INSTALL_PROGRAM} webpng $(INSTALL_BIN)/webpng -+ ${BSD_INSTALL_SCRIPT} bdftogd $(INSTALL_BIN)/bdftogd -+ ${BSD_INSTALL_DATA} gd.h $(INSTALL_INCLUDE)/gd.h -+ ${BSD_INSTALL_DATA} gdcache.h $(INSTALL_INCLUDE)/gdcache.h -+ ${BSD_INSTALL_DATA} gd_io.h $(INSTALL_INCLUDE)/gd_io.h -+ ${BSD_INSTALL_DATA} gdfontg.h $(INSTALL_INCLUDE)/gdfontg.h -+ ${BSD_INSTALL_DATA} gdfontl.h $(INSTALL_INCLUDE)/gdfontl.h -+ ${BSD_INSTALL_DATA} gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h -+ ${BSD_INSTALL_DATA} gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h -+ ${BSD_INSTALL_DATA} gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h - - gddemo: gddemo.o libgd.a - $(CC) gddemo.o -o gddemo $(LIBDIRS) $(LIBS) -@@ -138,18 +167,21 @@ - gdtestttf: gdtestttf.o libgd.a - $(CC) --verbose gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS) - --libgd.a: gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \ -+OBJS= gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \ - gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o gdfontt.o gdfonts.o gdfontmb.o gdfontl.o \ - gdfontg.o gdtables.o gdft.o gdttf.o gdcache.o gdkanji.o wbmp.o \ -- gd_wbmp.o gdhelpers.o gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h \ -+ gd_wbmp.o gdhelpers.o gd_gif_in.o -+INCS= gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h \ - gdfontg.h gdhelpers.h -+ -+libgd.a: $(INCS) $(OBJS) - rm -f libgd.a -- $(AR) rc libgd.a gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o \ -- gd_io_file.o gd_ss.o gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o \ -- gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o \ -- gdtables.o gdft.o gdttf.o gdcache.o gdkanji.o wbmp.o \ -- gd_wbmp.o gdhelpers.o -+ $(AR) rc libgd.a $(OBJS) - -ranlib libgd.a -+ -+libgd.so.$(SOVER): $(INCS) $(OBJS:.o=.so) -+ $(CC) -shared -Wl,-x,-soname,$@ -o $@ $(OBJS:.o=.so) $(LIBDIRS) $(LIBS) -+ ln -sf libgd.so.$(SOVER) libgd.so - - clean: - rm -f *.o *.a ${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp diff --git a/graphics/gd/files/patch-gdcache.h b/graphics/gd/files/patch-gdcache.h new file mode 100644 index 000000000000..408a96443de6 --- /dev/null +++ b/graphics/gd/files/patch-gdcache.h @@ -0,0 +1,10 @@ +--- gdcache.h.orig Wed Feb 7 04:44:02 2001 ++++ gdcache.h Fri Jul 4 21:58:32 2003 +@@ -40,7 +40,6 @@ + /* header */ + /*********************************************************/ + +-#include <malloc.h> + #ifndef NULL + #define NULL (void *)0 + #endif diff --git a/graphics/gd/files/patch-gif b/graphics/gd/files/patch-gif index e156fa2dd01f..e78b1e350e3f 100644 --- a/graphics/gd/files/patch-gif +++ b/graphics/gd/files/patch-gif @@ -9,7 +9,3 @@ images is troubled because of Unisys' zeal in patent enforcement. +gdImagePtr gdImageCreateFromGif(FILE *fd); +gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr in); gdImagePtr gdImageCreateFromPng(FILE *fd); ---- gd_gif_in.c Fri Jul 27 16:13:45 2001 -+++ gd_gif_in.c Fri Jul 27 16:14:46 2001 -@@ -6,1 +6,0 @@ --#include "io.h" diff --git a/graphics/gd/pkg-plist b/graphics/gd/pkg-plist index 8a33dbcbf553..b0daddfa56ee 100644 --- a/graphics/gd/pkg-plist +++ b/graphics/gd/pkg-plist @@ -1,11 +1,3 @@ -bin/bdftogd -bin/gd2copypal -bin/gd2topng -bin/gdparttopng -bin/gdtopng -bin/pngtogd -bin/pngtogd2 -bin/webpng include/gd/gd.h include/gd/gd_io.h include/gd/gdcache.h @@ -14,9 +6,7 @@ include/gd/gdfontl.h include/gd/gdfontmb.h include/gd/gdfonts.h include/gd/gdfontt.h -lib/libgd.a -lib/libgd.so -lib/libgd.so.2 -%%PORTDOCS%%share/doc/gd/index.html -%%PORTDOCS%%@dirrm share/doc/gd +lib/libgd1.a +lib/libgd1.so +lib/libgd1.so.2 @dirrm include/gd diff --git a/graphics/gd1/Makefile b/graphics/gd1/Makefile index 7f341cd7cd04..afc96e0f11ee 100644 --- a/graphics/gd1/Makefile +++ b/graphics/gd1/Makefile @@ -7,32 +7,22 @@ PORTNAME= gd PORTVERSION= 1.8.4 -PORTREVISION= 6 +PORTREVISION= 7 PORTEPOCH= 1 CATEGORIES+= graphics MASTER_SITES= http://www.boutell.com/gd/http/ \ ftp://ftp.boutell.com/pub/boutell/gd/ \ - http://virtual-estates.net/~mi/port-stuff/ \ ${MASTER_SITE_RINGSERVER} MASTER_SITE_SUBDIR= graphics/gd -DISTFILES= ${DISTNAME}${EXTRACT_SUFX} gd_gif_in.c.bz2 -EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER?= ports@FreeBSD.org -COMMENT?= A graphics library for fast image creation - -BUILD_DEPENDS= freetype-config:${PORTSDIR}/print/freetype2 # XXX -LIB_DEPENDS= jpeg:${PORTSDIR}/graphics/jpeg \ - png:${PORTSDIR}/graphics/png \ - freetype:${PORTSDIR}/print/freetype2 -.if !exists(/usr/bin/bzip2) -BUILD_DEPENDS+= bzip2:${PORTSDIR}/archivers/bzip2 -.endif +COMMENT?= A graphics library for fast creation of images -FREETYPE_CONFIG?= ${LOCALBASE}/bin/freetype-config +LIB_DEPENDS= jpeg.9:${PORTSDIR}/graphics/jpeg \ + png.5:${PORTSDIR}/graphics/png \ + freetype.9:${PORTSDIR}/print/freetype2 -USE_REINPLACE= yes -MAKE_ENV= FREETYPE_CONFIG="${FREETYPE_CONFIG}" +MAKEFILE= ${FILESDIR}/Makefile.lib INSTALLS_SHLIB= yes .if defined(WITH_X11) @@ -48,16 +38,6 @@ pre-everything:: .endif post-extract: - @${BZIP2_CMD} -dc ${DISTDIR}/${DIST_SUBDIR}/gd_gif_in.c.bz2 \ - > ${WRKSRC}/gd_gif_in.c - -post-patch: - @${REINPLACE_CMD} -e 's|<malloc.h>|<stdlib.h>|g' ${WRKSRC}/gdcache.h - -post-install: -.if !defined(NOPORTDOCS) - @${MKDIR} ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/index.html ${DOCSDIR} -.endif + @${CP} ${FILESDIR}/gd_gif_in.c ${WRKSRC} .include <bsd.port.mk> diff --git a/graphics/gd1/files/Makefile.lib b/graphics/gd1/files/Makefile.lib new file mode 100644 index 000000000000..8306444eb839 --- /dev/null +++ b/graphics/gd1/files/Makefile.lib @@ -0,0 +1,36 @@ +# $FreeBSD$ + +PREFIX?= /usr/local +SHLIB_VER?= 2 + +LIB= gd1 +LIBDIR= ${PREFIX}/lib +SHLIB_MAJOR= ${SHLIB_VER} +SHLIB_MINOR= 0 +NOPROFILE= yes +NOOBJ= yes + +INCS= gd.h gd_io.h gdcache.h gdfontg.h gdfontl.h gdfontmb.h \ + gdfonts.h gdfontt.h +INCSDIR= ${PREFIX}/include/gd +INCDIR= ${INSCDIR} # for pre-bsd.incs.mk API + +SRCS= gd.c gd_gd.c gd_gd2.c gd_io.c gd_io_dp.c gd_io_file.c gd_ss.c \ + gd_io_ss.c gd_png.c gd_jpeg.c gdxpm.c gdfontt.c gdfonts.c \ + gdfontmb.c gdfontl.c gdfontg.c gdtables.c gdft.c gdttf.c \ + gdcache.c gdkanji.c wbmp.c gd_wbmp.c gdhelpers.c gd_gif_in.c + +CFLAGS+= -I${.CURDIR} -I${LOCALBASE}/include/freetype2/freetype \ + -I${LOCALBASE}/include/freetype2 -I${LOCALBASE}/include \ + -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE -DHAVE_LIBZ +LDADD= -L${LOCALBASE}/lib -lfreetype -ljpeg -lpng -lz + +.ifdef WITH_X11 +CFLAGS+= -I${X11BASE}/include/X11 -I${X11BASE}/include -DHAVE_LIBXPM +LDADD+= -L${X11BASE}/lib -lXpm -lX11 +.endif + +beforeinstall: + mkdir -p ${INCSDIR} + +.include <bsd.lib.mk> diff --git a/graphics/gd1/files/gd_gif_in.c b/graphics/gd1/files/gd_gif_in.c new file mode 100644 index 000000000000..6e779c820963 --- /dev/null +++ b/graphics/gd1/files/gd_gif_in.c @@ -0,0 +1,561 @@ +#include <stdio.h> +#include <math.h> +#include <string.h> +#include <stdlib.h> +#include "gd.h" + +/* Used only when debugging GIF compression code */ +/* #define DEBUGGING_ENVARS */ + +#ifdef DEBUGGING_ENVARS + +static int verbose_set = 0; +static int verbose; +#define VERBOSE (verbose_set?verbose:set_verbose()) + +static int set_verbose(void) +{ + verbose = !!getenv("GIF_VERBOSE"); + verbose_set = 1; + return(verbose); +} + +#else + +#define VERBOSE 0 + +#endif + + +#define MAXCOLORMAPSIZE 256 + +#define TRUE 1 +#define FALSE 0 + +#define CM_RED 0 +#define CM_GREEN 1 +#define CM_BLUE 2 + +#define MAX_LWZ_BITS 12 + +#define INTERLACE 0x40 +#define LOCALCOLORMAP 0x80 +#define BitSet(byte, bit) (((byte) & (bit)) == (bit)) + +#define ReadOK(file,buffer,len) (gdGetBuf(buffer, len, file) != 0) + +#define LM_to_uint(a,b) (((b)<<8)|(a)) + +/* We may eventually want to use this information, but def it out for now */ +#if 0 +static struct { + unsigned int Width; + unsigned int Height; + unsigned char ColorMap[3][MAXCOLORMAPSIZE]; + unsigned int BitPixel; + unsigned int ColorResolution; + unsigned int Background; + unsigned int AspectRatio; +} GifScreen; +#endif + +static struct { + int transparent; + int delayTime; + int inputFlag; + int disposal; +} Gif89 = { -1, -1, -1, 0 }; + +static int ReadColorMap (gdIOCtx *fd, int number, unsigned char (*buffer)[256]); +static int DoExtension (gdIOCtx *fd, int label, int *Transparent); +static int GetDataBlock (gdIOCtx *fd, unsigned char *buf); +static int GetCode (gdIOCtx *fd, int code_size, int flag); +static int LWZReadByte (gdIOCtx *fd, int flag, int input_code_size); + +static void ReadImage (gdImagePtr im, gdIOCtx *fd, int len, int height, unsigned char (*cmap)[256], int interlace); /*1.4//, int ignore); */ + +int ZeroDataBlock; + +gdImagePtr +gdImageCreateFromGif(FILE *fdFile) +{ + gdIOCtx *fd = gdNewFileCtx(fdFile); + gdImagePtr im = 0; + + im = gdImageCreateFromGifCtx(fd); + + fd->free(fd); + + return im; +} + +gdImagePtr +gdImageCreateFromGifCtx(gdIOCtxPtr fd) +{ + int imageNumber; + int BitPixel; + int ColorResolution; + int Background; + int AspectRatio; + int Transparent = (-1); + unsigned char buf[16]; + unsigned char c; + unsigned char ColorMap[3][MAXCOLORMAPSIZE]; + unsigned char localColorMap[3][MAXCOLORMAPSIZE]; + int imw, imh; + int useGlobalColormap; + int bitPixel; + int i; + /*1.4//int imageCount = 0; */ + char version[4]; + + gdImagePtr im = 0; + ZeroDataBlock = FALSE; + + /*1.4//imageNumber = 1; */ + if (! ReadOK(fd,buf,6)) { + return 0; + } + if (strncmp((char *)buf,"GIF",3) != 0) { + return 0; + } + strncpy(version, (char *)buf + 3, 3); + version[3] = '\0'; + + if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) { + return 0; + } + if (! ReadOK(fd,buf,7)) { + return 0; + } + BitPixel = 2<<(buf[4]&0x07); + ColorResolution = (int) (((buf[4]&0x70)>>3)+1); + Background = buf[5]; + AspectRatio = buf[6]; + + if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */ + if (ReadColorMap(fd, BitPixel, ColorMap)) { + return 0; + } + } + for (;;) { + if (! ReadOK(fd,&c,1)) { + return 0; + } + if (c == ';') { /* GIF terminator */ + goto terminated; + } + + if (c == '!') { /* Extension */ + if (! ReadOK(fd,&c,1)) { + return 0; + } + DoExtension(fd, c, &Transparent); + continue; + } + + if (c != ',') { /* Not a valid start character */ + continue; + } + + /*1.4//++imageCount; */ + + if (! ReadOK(fd,buf,9)) { + return 0; + } + + useGlobalColormap = ! BitSet(buf[8], LOCALCOLORMAP); + + bitPixel = 1<<((buf[8]&0x07)+1); + + imw = LM_to_uint(buf[4],buf[5]); + imh = LM_to_uint(buf[6],buf[7]); + if (!(im = gdImageCreate(imw, imh))) { + return 0; + } + im->interlace = BitSet(buf[8], INTERLACE); + if (! useGlobalColormap) { + if (ReadColorMap(fd, bitPixel, localColorMap)) { + return 0; + } + ReadImage(im, fd, imw, imh, localColorMap, + BitSet(buf[8], INTERLACE)); + /*1.4//imageCount != imageNumber); */ + } else { + ReadImage(im, fd, imw, imh, + ColorMap, + BitSet(buf[8], INTERLACE)); + /*1.4//imageCount != imageNumber); */ + } + if (Transparent != (-1)) { + gdImageColorTransparent(im, Transparent); + } + goto terminated; + } + +terminated: + /* Terminator before any image was declared! */ + if (!im) { + return 0; + } + /* Check for open colors at the end, so + we can reduce colorsTotal and ultimately + BitsPerPixel */ + for (i=((im->colorsTotal-1)); (i>=0); i--) { + if (im->open[i]) { + im->colorsTotal--; + } else { + break; + } + } + return im; +} + +static int +ReadColorMap(gdIOCtx *fd, int number, unsigned char (*buffer)[256]) +{ + int i; + unsigned char rgb[3]; + + + for (i = 0; i < number; ++i) { + if (! ReadOK(fd, rgb, sizeof(rgb))) { + return TRUE; + } + buffer[CM_RED][i] = rgb[0] ; + buffer[CM_GREEN][i] = rgb[1] ; + buffer[CM_BLUE][i] = rgb[2] ; + } + + + return FALSE; +} + +static int +DoExtension(gdIOCtx *fd, int label, int *Transparent) +{ + static unsigned char buf[256]; + + switch (label) { + case 0xf9: /* Graphic Control Extension */ + (void) GetDataBlock(fd, (unsigned char*) buf); + Gif89.disposal = (buf[0] >> 2) & 0x7; + Gif89.inputFlag = (buf[0] >> 1) & 0x1; + Gif89.delayTime = LM_to_uint(buf[1],buf[2]); + if ((buf[0] & 0x1) != 0) + *Transparent = buf[3]; + + while (GetDataBlock(fd, (unsigned char*) buf) != 0) + ; + return FALSE; + default: + break; + } + while (GetDataBlock(fd, (unsigned char*) buf) != 0) + ; + + return FALSE; +} + +static int +GetDataBlock_(gdIOCtx *fd, unsigned char *buf) +{ + unsigned char count; + + if (! ReadOK(fd,&count,1)) { + return -1; + } + + ZeroDataBlock = count == 0; + + if ((count != 0) && (! ReadOK(fd, buf, count))) { + return -1; + } + + return count; +} + +static int +GetDataBlock(gdIOCtx *fd, unsigned char *buf) +{ + int rv; + int i; + + rv = GetDataBlock_(fd,buf); + if (VERBOSE) + { printf("[GetDataBlock returning %d",rv); + if (rv > 0) + { printf(":"); + for (i=0;i<rv;i++) printf(" %02x",buf[i]); + } + printf("]\n"); + } + return(rv); +} + +static int +GetCode_(gdIOCtx *fd, int code_size, int flag) +{ + static unsigned char buf[280]; + static int curbit, lastbit, done, last_byte; + int i, j, ret; + unsigned char count; + + if (flag) { + curbit = 0; + lastbit = 0; + done = FALSE; + return 0; + } + + if ( (curbit+code_size) >= lastbit) { + if (done) { + if (curbit >= lastbit) { + /* Oh well */ + } + return -1; + } + buf[0] = buf[last_byte-2]; + buf[1] = buf[last_byte-1]; + + if ((count = GetDataBlock(fd, &buf[2])) == 0) + done = TRUE; + + last_byte = 2 + count; + curbit = (curbit - lastbit) + 16; + lastbit = (2+count)*8 ; + } + + ret = 0; + for (i = curbit, j = 0; j < code_size; ++i, ++j) + ret |= ((buf[ i / 8 ] & (1 << (i % 8))) != 0) << j; + + curbit += code_size; + return ret; +} + +static int +GetCode(gdIOCtx *fd, int code_size, int flag) +{ + int rv; + + rv = GetCode_(fd,code_size,flag); + if (VERBOSE) printf("[GetCode(,%d,%d) returning %d]\n",code_size,flag,rv); + return(rv); +} + +#define STACK_SIZE ((1<<(MAX_LWZ_BITS))*2) +static int +LWZReadByte_(gdIOCtx *fd, int flag, int input_code_size) +{ + static int fresh = FALSE; + int code, incode; + static int code_size, set_code_size; + static int max_code, max_code_size; + static int firstcode, oldcode; + static int clear_code, end_code; + static int table[2][(1<< MAX_LWZ_BITS)]; + static int stack[STACK_SIZE], *sp; + register int i; + + if (flag) { + set_code_size = input_code_size; + code_size = set_code_size+1; + clear_code = 1 << set_code_size ; + end_code = clear_code + 1; + max_code_size = 2*clear_code; + max_code = clear_code+2; + + GetCode(fd, 0, TRUE); + + fresh = TRUE; + + for (i = 0; i < clear_code; ++i) { + table[0][i] = 0; + table[1][i] = i; + } + for (; i < (1<<MAX_LWZ_BITS); ++i) + table[0][i] = table[1][0] = 0; + + sp = stack; + + return 0; + } else if (fresh) { + fresh = FALSE; + do { + firstcode = oldcode = + GetCode(fd, code_size, FALSE); + } while (firstcode == clear_code); + return firstcode; + } + + if (sp > stack) + return *--sp; + + while ((code = GetCode(fd, code_size, FALSE)) >= 0) { + if (code == clear_code) { + for (i = 0; i < clear_code; ++i) { + table[0][i] = 0; + table[1][i] = i; + } + for (; i < (1<<MAX_LWZ_BITS); ++i) + table[0][i] = table[1][i] = 0; + code_size = set_code_size+1; + max_code_size = 2*clear_code; + max_code = clear_code+2; + sp = stack; + firstcode = oldcode = + GetCode(fd, code_size, FALSE); + return firstcode; + } else if (code == end_code) { + int count; + unsigned char buf[260]; + + if (ZeroDataBlock) + return -2; + + while ((count = GetDataBlock(fd, buf)) > 0) + ; + + if (count != 0) + return -2; + } + + incode = code; + + if (sp == (stack + STACK_SIZE)) { + /* Bad compressed data stream */ + return -1; + } + + if (code >= max_code) { + *sp++ = firstcode; + code = oldcode; + } + + while (code >= clear_code) { + if (sp == (stack + STACK_SIZE)) { + /* Bad compressed data stream */ + return -1; + } + *sp++ = table[1][code]; + if (code == table[0][code]) { + /* Oh well */ + } + code = table[0][code]; + } + + *sp++ = firstcode = table[1][code]; + + if ((code = max_code) <(1<<MAX_LWZ_BITS)) { + table[0][code] = oldcode; + table[1][code] = firstcode; + ++max_code; + if ((max_code >= max_code_size) && + (max_code_size < (1<<MAX_LWZ_BITS))) { + max_code_size *= 2; + ++code_size; + } + } + + oldcode = incode; + + if (sp > stack) + return *--sp; + } + return code; +} + +static int +LWZReadByte(gdIOCtx *fd, int flag, int input_code_size) +{ + int rv; + + rv = LWZReadByte_(fd,flag,input_code_size); + if (VERBOSE) printf("[LWZReadByte(,%d,%d) returning %d]\n",flag,input_code_size,rv); + return(rv); +} + +static void +ReadImage(gdImagePtr im, gdIOCtx *fd, int len, int height, unsigned char (*cmap)[256], int interlace) /*1.4//, int ignore) */ +{ + unsigned char c; + int v; + int xpos = 0, ypos = 0, pass = 0; + int i; + /* Stash the color map into the image */ + for (i=0; (i<gdMaxColors); i++) { + im->red[i] = cmap[CM_RED][i]; + im->green[i] = cmap[CM_GREEN][i]; + im->blue[i] = cmap[CM_BLUE][i]; + im->open[i] = 1; + } + /* Many (perhaps most) of these colors will remain marked open. */ + im->colorsTotal = gdMaxColors; + /* + ** Initialize the Compression routines + */ + if (! ReadOK(fd,&c,1)) { + return; + } + if (LWZReadByte(fd, TRUE, c) < 0) { + return; + } + + /* + ** If this is an "uninteresting picture" ignore it. + ** REMOVED For 1.4 + */ + /*if (ignore) { */ + /* while (LWZReadByte(fd, FALSE, c) >= 0) */ + /* ; */ + /* return; */ + /*} */ + + while ((v = LWZReadByte(fd,FALSE,c)) >= 0 ) { + /* This how we recognize which colors are actually used. */ + if (im->open[v]) { + im->open[v] = 0; + } + gdImageSetPixel(im, xpos, ypos, v); + ++xpos; + if (xpos == len) { + xpos = 0; + if (interlace) { + switch (pass) { + case 0: + case 1: + ypos += 8; break; + case 2: + ypos += 4; break; + case 3: + ypos += 2; break; + } + + if (ypos >= height) { + ++pass; + switch (pass) { + case 1: + ypos = 4; break; + case 2: + ypos = 2; break; + case 3: + ypos = 1; break; + default: + goto fini; + } + } + } else { + ++ypos; + } + } + if (ypos >= height) + break; + } + +fini: + if (LWZReadByte(fd,FALSE,c)>=0) { + /* Ignore extra */ + } +} + diff --git a/graphics/gd1/files/patch-ac b/graphics/gd1/files/patch-ac deleted file mode 100644 index 9d63cb3d8eb1..000000000000 --- a/graphics/gd1/files/patch-ac +++ /dev/null @@ -1,188 +0,0 @@ ---- Makefile.orig Thu Feb 22 19:03:43 2001 -+++ Makefile Sun Dec 16 05:57:07 2001 -@@ -3,22 +3,30 @@ - #If you do not have gcc, change the setting for COMPILER, but you must - #use an ANSI standard C compiler (NOT the old SunOS 4.1.3 cc - #compiler; get gcc if you are still using it). --COMPILER=gcc -+COMPILER=${CC} - - #If the ar command fails on your system, consult the ar manpage - #for your system. --AR=ar -+#AR=ar - - #If you don't have FreeType, libjpeg and/or Xpm installed, including the - #header files, uncomment this (default). You really must install - #libpng and zlib to get anywhere if you wish to create PNG images. --CFLAGS=-O -DHAVE_LIBPNG -DHAVE_LIBJPEG -+CFLAGS+=-DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE - - #If you do have FreeType, libjpeg and/or Xpm fully installed, uncomment a - #variation of this and comment out the line above. See also LIBS below. - #CFLAGS=-O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG \ - # -DHAVE_LIBFREETYPE -DHAVE_LIBTTF - -+.if defined(WITH_X11) -+CFLAGS+=-DHAVE_XPM -+.endif -+ -+.if defined(JISX0208) -+CFLAGS+=-DJISX0208 -+.endif -+ - #To use the old FreeType 1.x library, add this additional #define - #to the line above - #-DHAVE_LIBTTF -@@ -30,7 +38,7 @@ - #Some systems are very picky about link order. They don't all agree - #on the right order, either. - --LIBS=-lgd -lpng -lz -lm -+LIBS=-lgd -lpng -lz -ljpeg -lm `$(FREETYPE_CONFIG) --libs` - - #If you do have FreeType, JPEG and/or Xpm fully installed, uncomment a - #variation of this and comment out the line above. Note that -@@ -38,6 +46,10 @@ - - #LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm -lttf - -+.if defined(WITH_X11) -+LIBS+=-lXpm -lX11 -+.endif -+ - #Note: for Freetype 1.x, use DHAVE_LIBTTF and -lttf instead. - - #Typical install locations for freetype, zlib, xpm, libjpeg and libpng header -@@ -45,7 +57,11 @@ - #ensure that the version of gd you are installing is used, and not an - #older release in your directory tree somewhere. - --INCLUDEDIRS=-I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include -+INCLUDEDIRS=-I. `$(FREETYPE_CONFIG) --cflags` -I${LOCALBASE}/include -+ -+.if defined(WITH_X11) -+INCLUDEDIRS+=-I${X11BASE}/include/X11 -I${X11BASE}/include -+.endif - - #Typical install locations for freetype, zlib, xpm and libpng libraries. - #If yours are somewhere else, other than a standard location -@@ -55,16 +71,20 @@ - #on your system can't cause conflicts while building a new one. - #This line shouldn't hurt if you don't actually have some of the - #optional libraries and directories. --LIBDIRS=-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib -+LIBDIRS=-L. -L${LOCALBASE}/lib -Wl,--rpath,${LOCALBASE}/lib -+ -+.if defined(WITH_X11) -+LIBDIRS+=-L${X11BASE}/lib -Wl,--rpath,${X11BASE}/lib -+.endif - - #Location where libgd.a should be installed by "make install". --INSTALL_LIB=/usr/local/lib -+INSTALL_LIB=${PREFIX}/lib - - #Location where .h files should be installed by "make install". --INSTALL_INCLUDE=/usr/local/include -+INSTALL_INCLUDE=${PREFIX}/include/gd - - #Location where useful non-test programs should be installed by "make install". --INSTALL_BIN=/usr/local/bin -+INSTALL_BIN=${PREFIX}/bin - - # - # -@@ -74,34 +94,43 @@ - - VERSION=1.8.4 - --CC=$(COMPILER) $(INCLUDEDIRS) --LINK=$(CC) $(LIBDIRS) $(LIBS) -+CFLAGS+=$(INCLUDEDIRS) - - PROGRAMS=$(BIN_PROGRAMS) $(TEST_PROGRAMS) - - BIN_PROGRAMS=pngtogd pngtogd2 gdtopng gd2topng gd2copypal gdparttopng webpng - TEST_PROGRAMS=gdtest gddemo gd2time gdtestft gdtestttf - --all: libgd.a $(PROGRAMS) -+SOVER=2 -+ -+.SUFFIXES: .c .so .o - --install: libgd.a $(BIN_PROGRAMS) -- sh ./install-item 644 libgd.a $(INSTALL_LIB)/libgd.a -- sh ./install-item 755 pngtogd $(INSTALL_BIN)/pngtogd -- sh ./install-item 755 pngtogd2 $(INSTALL_BIN)/pngtogd2 -- sh ./install-item 755 gdtopng $(INSTALL_BIN)/gdtopng -- sh ./install-item 755 gd2topng $(INSTALL_BIN)/gd2topng -- sh ./install-item 755 gd2copypal $(INSTALL_BIN)/gd2copypal -- sh ./install-item 755 gdparttopng $(INSTALL_BIN)/gdparttopng -- sh ./install-item 755 webpng $(INSTALL_BIN)/webpng -- sh ./install-item 755 bdftogd $(INSTALL_BIN)/bdftogd -- sh ./install-item 644 gd.h $(INSTALL_INCLUDE)/gd.h -- sh ./install-item 644 gdcache.h $(INSTALL_INCLUDE)/gdcache.h -- sh ./install-item 644 gd_io.h $(INSTALL_INCLUDE)/gd_io.h -- sh ./install-item 644 gdfontg.h $(INSTALL_INCLUDE)/gdfontg.h -- sh ./install-item 644 gdfontl.h $(INSTALL_INCLUDE)/gdfontl.h -- sh ./install-item 644 gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h -- sh ./install-item 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h -- sh ./install-item 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h -+.c.so: -+ $(CC) -fpic -DPIC $(CFLAGS) -o $@ -c $< -+ -+all: libgd.a libgd.so.$(SOVER) $(PROGRAMS) -+ -+install: libgd.a libgd.so.$(SOVER) $(BIN_PROGRAMS) -+ -mkdir -p $(INSTALL_LIB) $(INSTALL_INCLUDE) $(INSTALL_BIN) -+ ${BSD_INSTALL_DATA} libgd.a $(INSTALL_LIB)/libgd.a -+ ${BSD_INSTALL_DATA} libgd.so.$(SOVER) $(INSTALL_LIB)/libgd.so.$(SOVER) -+ -ln -sf libgd.so.$(SOVER) $(INSTALL_LIB)/libgd.so -+ ${BSD_INSTALL_PROGRAM} pngtogd $(INSTALL_BIN)/pngtogd -+ ${BSD_INSTALL_PROGRAM} pngtogd2 $(INSTALL_BIN)/pngtogd2 -+ ${BSD_INSTALL_PROGRAM} gdtopng $(INSTALL_BIN)/gdtopng -+ ${BSD_INSTALL_PROGRAM} gd2topng $(INSTALL_BIN)/gd2topng -+ ${BSD_INSTALL_PROGRAM} gd2copypal $(INSTALL_BIN)/gd2copypal -+ ${BSD_INSTALL_PROGRAM} gdparttopng $(INSTALL_BIN)/gdparttopng -+ ${BSD_INSTALL_PROGRAM} webpng $(INSTALL_BIN)/webpng -+ ${BSD_INSTALL_SCRIPT} bdftogd $(INSTALL_BIN)/bdftogd -+ ${BSD_INSTALL_DATA} gd.h $(INSTALL_INCLUDE)/gd.h -+ ${BSD_INSTALL_DATA} gdcache.h $(INSTALL_INCLUDE)/gdcache.h -+ ${BSD_INSTALL_DATA} gd_io.h $(INSTALL_INCLUDE)/gd_io.h -+ ${BSD_INSTALL_DATA} gdfontg.h $(INSTALL_INCLUDE)/gdfontg.h -+ ${BSD_INSTALL_DATA} gdfontl.h $(INSTALL_INCLUDE)/gdfontl.h -+ ${BSD_INSTALL_DATA} gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h -+ ${BSD_INSTALL_DATA} gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h -+ ${BSD_INSTALL_DATA} gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h - - gddemo: gddemo.o libgd.a - $(CC) gddemo.o -o gddemo $(LIBDIRS) $(LIBS) -@@ -138,18 +167,21 @@ - gdtestttf: gdtestttf.o libgd.a - $(CC) --verbose gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS) - --libgd.a: gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \ -+OBJS= gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \ - gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o gdfontt.o gdfonts.o gdfontmb.o gdfontl.o \ - gdfontg.o gdtables.o gdft.o gdttf.o gdcache.o gdkanji.o wbmp.o \ -- gd_wbmp.o gdhelpers.o gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h \ -+ gd_wbmp.o gdhelpers.o gd_gif_in.o -+INCS= gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h \ - gdfontg.h gdhelpers.h -+ -+libgd.a: $(INCS) $(OBJS) - rm -f libgd.a -- $(AR) rc libgd.a gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o \ -- gd_io_file.o gd_ss.o gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o \ -- gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o \ -- gdtables.o gdft.o gdttf.o gdcache.o gdkanji.o wbmp.o \ -- gd_wbmp.o gdhelpers.o -+ $(AR) rc libgd.a $(OBJS) - -ranlib libgd.a -+ -+libgd.so.$(SOVER): $(INCS) $(OBJS:.o=.so) -+ $(CC) -shared -Wl,-x,-soname,$@ -o $@ $(OBJS:.o=.so) $(LIBDIRS) $(LIBS) -+ ln -sf libgd.so.$(SOVER) libgd.so - - clean: - rm -f *.o *.a ${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp diff --git a/graphics/gd1/files/patch-gdcache.h b/graphics/gd1/files/patch-gdcache.h new file mode 100644 index 000000000000..408a96443de6 --- /dev/null +++ b/graphics/gd1/files/patch-gdcache.h @@ -0,0 +1,10 @@ +--- gdcache.h.orig Wed Feb 7 04:44:02 2001 ++++ gdcache.h Fri Jul 4 21:58:32 2003 +@@ -40,7 +40,6 @@ + /* header */ + /*********************************************************/ + +-#include <malloc.h> + #ifndef NULL + #define NULL (void *)0 + #endif diff --git a/graphics/gd1/files/patch-gif b/graphics/gd1/files/patch-gif index e156fa2dd01f..e78b1e350e3f 100644 --- a/graphics/gd1/files/patch-gif +++ b/graphics/gd1/files/patch-gif @@ -9,7 +9,3 @@ images is troubled because of Unisys' zeal in patent enforcement. +gdImagePtr gdImageCreateFromGif(FILE *fd); +gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr in); gdImagePtr gdImageCreateFromPng(FILE *fd); ---- gd_gif_in.c Fri Jul 27 16:13:45 2001 -+++ gd_gif_in.c Fri Jul 27 16:14:46 2001 -@@ -6,1 +6,0 @@ --#include "io.h" diff --git a/graphics/gd1/pkg-plist b/graphics/gd1/pkg-plist index 8a33dbcbf553..b0daddfa56ee 100644 --- a/graphics/gd1/pkg-plist +++ b/graphics/gd1/pkg-plist @@ -1,11 +1,3 @@ -bin/bdftogd -bin/gd2copypal -bin/gd2topng -bin/gdparttopng -bin/gdtopng -bin/pngtogd -bin/pngtogd2 -bin/webpng include/gd/gd.h include/gd/gd_io.h include/gd/gdcache.h @@ -14,9 +6,7 @@ include/gd/gdfontl.h include/gd/gdfontmb.h include/gd/gdfonts.h include/gd/gdfontt.h -lib/libgd.a -lib/libgd.so -lib/libgd.so.2 -%%PORTDOCS%%share/doc/gd/index.html -%%PORTDOCS%%@dirrm share/doc/gd +lib/libgd1.a +lib/libgd1.so +lib/libgd1.so.2 @dirrm include/gd diff --git a/graphics/p5-GD/Makefile b/graphics/p5-GD/Makefile index 27a84df1227b..6f501f95d60e 100644 --- a/graphics/p5-GD/Makefile +++ b/graphics/p5-GD/Makefile @@ -7,6 +7,7 @@ PORTNAME= GD PORTVERSION= 1.41 +PORTREVISION= 1 CATEGORIES= graphics perl5 MASTER_SITES= ${MASTER_SITE_PERL_CPAN} MASTER_SITE_SUBDIR= GD @@ -15,7 +16,7 @@ PKGNAMEPREFIX= p5- MAINTAINER= ports@FreeBSD.org COMMENT= A perl5 interface to Gd Graphics Library -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd1.2:${PORTSDIR}/graphics/gd PERL_CONFIGURE= yes USE_REINPLACE= yes @@ -26,7 +27,7 @@ MAN3= GD.3 post-patch: ${REINPLACE_CMD} \ -e 's,@@LOCALBASE@@,${LOCALBASE},g' \ - -e 's,@@LOCALBASE@@,${LOCALBASE},g' \ + -e 's,@@X11BASE@@,${X11BASE},g' \ ${WRKSRC}/Makefile.PL .include <bsd.port.mk> diff --git a/graphics/p5-GD/files/patch-aa b/graphics/p5-GD/files/patch-aa index 927c439e4f5e..b0d25fd004db 100644 --- a/graphics/p5-GD/files/patch-aa +++ b/graphics/p5-GD/files/patch-aa @@ -15,9 +15,9 @@ -my $TTF = lc prompt('Build FreeType support?','y') eq 'y'; -my $XPM = $^O !~ /^freebsd|MSWin32$/ && lc prompt('Build XPM support?','y') eq 'y'; -my $GIF = lc prompt('Build GIF support (for patched versions of gd)?','n') eq 'y'; -+my @INC = qw(-I@@LOCALBASE@@/include -I@@LOCALBASE@@/include/gd -I@@LOCALBASE@@/include/freetype -I@@X11BASE@@/include -I@@X11BASE@@/include/X11); ++my @INC = qw(-I@@LOCALBASE@@/include/gd -I@@LOCALBASE@@/include/freetype -I@@LOCALBASE@@/include -I@@X11BASE@@/include/X11 -I@@X11BASE@@/include); +my @LIBPATH = qw(-L@@LOCALBASE@@/lib -L@@X11BASE@@/lib); -+my @LIBS = qw(-lfreetype -ljpeg -lgd -lpng -lz); ++my @LIBS = qw(-lfreetype -ljpeg -lgd1 -lpng -lz); my $FCGI = 0; # set to 1 to build compatability with fastCGI diff --git a/graphics/p5-GD1/Makefile b/graphics/p5-GD1/Makefile index 27a84df1227b..6f501f95d60e 100644 --- a/graphics/p5-GD1/Makefile +++ b/graphics/p5-GD1/Makefile @@ -7,6 +7,7 @@ PORTNAME= GD PORTVERSION= 1.41 +PORTREVISION= 1 CATEGORIES= graphics perl5 MASTER_SITES= ${MASTER_SITE_PERL_CPAN} MASTER_SITE_SUBDIR= GD @@ -15,7 +16,7 @@ PKGNAMEPREFIX= p5- MAINTAINER= ports@FreeBSD.org COMMENT= A perl5 interface to Gd Graphics Library -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd1.2:${PORTSDIR}/graphics/gd PERL_CONFIGURE= yes USE_REINPLACE= yes @@ -26,7 +27,7 @@ MAN3= GD.3 post-patch: ${REINPLACE_CMD} \ -e 's,@@LOCALBASE@@,${LOCALBASE},g' \ - -e 's,@@LOCALBASE@@,${LOCALBASE},g' \ + -e 's,@@X11BASE@@,${X11BASE},g' \ ${WRKSRC}/Makefile.PL .include <bsd.port.mk> diff --git a/graphics/p5-GD1/files/patch-aa b/graphics/p5-GD1/files/patch-aa index 927c439e4f5e..b0d25fd004db 100644 --- a/graphics/p5-GD1/files/patch-aa +++ b/graphics/p5-GD1/files/patch-aa @@ -15,9 +15,9 @@ -my $TTF = lc prompt('Build FreeType support?','y') eq 'y'; -my $XPM = $^O !~ /^freebsd|MSWin32$/ && lc prompt('Build XPM support?','y') eq 'y'; -my $GIF = lc prompt('Build GIF support (for patched versions of gd)?','n') eq 'y'; -+my @INC = qw(-I@@LOCALBASE@@/include -I@@LOCALBASE@@/include/gd -I@@LOCALBASE@@/include/freetype -I@@X11BASE@@/include -I@@X11BASE@@/include/X11); ++my @INC = qw(-I@@LOCALBASE@@/include/gd -I@@LOCALBASE@@/include/freetype -I@@LOCALBASE@@/include -I@@X11BASE@@/include/X11 -I@@X11BASE@@/include); +my @LIBPATH = qw(-L@@LOCALBASE@@/lib -L@@X11BASE@@/lib); -+my @LIBS = qw(-lfreetype -ljpeg -lgd -lpng -lz); ++my @LIBS = qw(-lfreetype -ljpeg -lgd1 -lpng -lz); my $FCGI = 0; # set to 1 to build compatability with fastCGI diff --git a/graphics/phplot/Makefile b/graphics/phplot/Makefile index 785fe5f31269..958252183231 100644 --- a/graphics/phplot/Makefile +++ b/graphics/phplot/Makefile @@ -6,6 +6,7 @@ PORTNAME= phplot PORTVERSION= 4.4.6 +PORTREVISION= 1 CATEGORIES= graphics www MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= phplot @@ -15,7 +16,7 @@ MAINTAINER= yukinopo@livedoor.com COMMENT= A PHP class for creating scientific and business charts RUN_DEPENDS= ${LOCALBASE}/libexec/apache/libphp4.so:${PORTSDIR}/www/mod_php4 -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 NO_BUILD= YES diff --git a/graphics/png2html/Makefile b/graphics/png2html/Makefile index 9498dbf58ca7..7462e557b3ed 100644 --- a/graphics/png2html/Makefile +++ b/graphics/png2html/Makefile @@ -7,7 +7,7 @@ PORTNAME= png2html PORTVERSION= 1.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= graphics MASTER_SITES= http://www.engr.mun.ca/~holden/ @@ -15,7 +15,7 @@ MAINTAINER= jedgar@fxp.org COMMENT= Takes a PNG image and transforms it into HTML LIB_DEPENDS= png.5:${PORTSDIR}/graphics/png \ - gd.2:${PORTSDIR}/graphics/gd + gd.4:${PORTSDIR}/graphics/gd2 do-configure: @${MV} ${WRKSRC}/Makefile ${WRKSRC}/Makefile.orig diff --git a/graphics/png2html/files/patch-aa b/graphics/png2html/files/patch-aa index 4d629da165a6..67a23d241226 100644 --- a/graphics/png2html/files/patch-aa +++ b/graphics/png2html/files/patch-aa @@ -6,7 +6,7 @@ -CC = gcc -CFLAGS = -O2 -Wall -lpng -lgd +CC ?= gcc -+INCLUDES= -ICHANGE_ME/include/gd ++INCLUDES= -ICHANGE_ME/include +LDFLAGS = -LCHANGE_ME/lib +LIBS = -lpng -lgd diff --git a/graphics/py-gd/Makefile b/graphics/py-gd/Makefile index 8815468e0ec9..a4a98f16a35f 100644 --- a/graphics/py-gd/Makefile +++ b/graphics/py-gd/Makefile @@ -6,6 +6,7 @@ PORTNAME= gd PORTVERSION= 0.40 +PORTREVISION= 1 CATEGORIES= graphics python MASTER_SITES= http://newcenturycomputers.net/projects/download.cgi/ PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -14,7 +15,7 @@ DISTNAME= gdmodule-${PORTVERSION} MAINTAINER= perky@FreeBSD.org COMMENT= Python interface to the GD library -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 USE_XPM= yes USE_REINPLACE= yes @@ -27,7 +28,7 @@ EXAMPLE_DIR= ${PREFIX}/share/examples/py-gd post-patch: ${REINPLACE_CMD} -e 's,/usr/local,${LOCALBASE},g' \ -e 's,/usr/X11R6,${X11BASE},g' \ - -e 's,/usr/include/X11,${LOCALBASE}/include/gd,g' \ + -e 's,/usr/include/X11,${LOCALBASE}/include,g' \ ${WRKSRC}/${PYSETUP} post-install: diff --git a/graphics/ruby-gd/Makefile b/graphics/ruby-gd/Makefile index 1be620a4bb36..6201076116e2 100644 --- a/graphics/ruby-gd/Makefile +++ b/graphics/ruby-gd/Makefile @@ -7,7 +7,7 @@ PORTNAME= GD PORTVERSION= 0.7.4 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= graphics ruby MASTER_SITES= http://www.acc.ne.jp/~tam/GD/ PKGNAMEPREFIX= ${RUBY_PKGNAMEPREFIX} @@ -36,7 +36,7 @@ CONFIGURE_ARGS+= ----enable-gd2_0 \ LIB_DEPENDS+= gd.4:${PORTSDIR}/graphics/gd .else CONFIGURE_ARGS+= --with-gd-include="${LOCALBASE}/include/gd" -LIB_DEPENDS+= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS+= gd1.2:${PORTSDIR}/graphics/gd .endif .include <bsd.port.pre.mk> @@ -70,6 +70,11 @@ DOCS_JA= readme.ja \ post-patch: ${RUBY} -i -pe 'sub %r:/win98/windows/FONTS:, "${X11BASE}/lib/X11/fonts/TrueType"' ${WRKSRC}/sample/gdtestttf.rb +.if defined(WITH_GD2) + ${RUBY} -i -pe 'sub %r:%%GD%%:, "gd"' ${WRKSRC}/extconf.rb +.else + ${RUBY} -i -pe 'sub %r:%%GD%%:, "gd1"' ${WRKSRC}/extconf.rb +.endif post-install: .if !defined(NOPORTDOCS) diff --git a/graphics/ruby-gd/files/patch-extconf.rb b/graphics/ruby-gd/files/patch-extconf.rb new file mode 100644 index 000000000000..f87e00b5c9a0 --- /dev/null +++ b/graphics/ruby-gd/files/patch-extconf.rb @@ -0,0 +1,11 @@ +--- extconf.rb.orig Wed May 30 23:14:17 2001 ++++ extconf.rb Sun Jul 6 00:14:20 2003 +@@ -48,7 +48,7 @@ + end + + if have_library('z') and have_library('png') and +- have_library('gd', 'gdImagePng') and have_library('m') ++ have_library('%%GD%%', 'gdImagePng') and have_library('m') + + if with_config('ttf') and not have_func('gdImageStringTTF') + delete_link('ttf') diff --git a/graphics/scr2png/Makefile b/graphics/scr2png/Makefile index ddfc1c82e170..ef803cc742cf 100644 --- a/graphics/scr2png/Makefile +++ b/graphics/scr2png/Makefile @@ -7,6 +7,7 @@ PORTNAME= scr2png PORTVERSION= 1.1 +PORTREVISION= 1 CATEGORIES= graphics MASTER_SITES= ${MASTER_SITE_LOCAL} @@ -16,7 +17,7 @@ NO_WRKSUBDIR= yes MAINTAINER= nik@freebsd.org COMMENT= Converts the output of "vidcontrol -p" to PNG -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 USE_REINPLACE= yes diff --git a/graphics/zimg/Makefile b/graphics/zimg/Makefile index 8ac638591ec8..d6cc5dab4076 100644 --- a/graphics/zimg/Makefile +++ b/graphics/zimg/Makefile @@ -7,6 +7,7 @@ PORTNAME= zimg PORTVERSION= 4.19.1 +PORTREVISION= 1 CATEGORIES= graphics MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} @@ -14,14 +15,13 @@ MASTER_SITE_SUBDIR= ${PORTNAME} MAINTAINER= ports@FreeBSD.org COMMENT= Image-generator that uses ASCII input files to create PNGs/EDFs -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 GNU_CONFIGURE= yes CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ LDFLAGS="-L${LOCALBASE}/lib" CONFIGURE_ARGS= --with-dynaload-cc="${CC}" \ - --with-dynaload-cflags="${CFLAGS} -shared" \ - --with-gd-includes=${LOCALBASE}/include/gd + --with-dynaload-cflags="${CFLAGS} -shared" MAN1= zimg.1 diff --git a/net-mgmt/mrtg/Makefile b/net-mgmt/mrtg/Makefile index 9129659de996..c0784deb2d99 100644 --- a/net-mgmt/mrtg/Makefile +++ b/net-mgmt/mrtg/Makefile @@ -7,7 +7,7 @@ PORTNAME= mrtg PORTVERSION= 2.9.29 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES= net MASTER_SITES= http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub/ \ @@ -25,7 +25,7 @@ LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 CONFIGURE_ARGS= --with-gd-lib=${LOCALBASE}/lib \ --with-gd-inc=${LOCALBASE}/include .else -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd1.2:${PORTSDIR}/graphics/gd CONFIGURE_ARGS= --with-gd-lib=${LOCALBASE}/lib \ --with-gd-inc=${LOCALBASE}/include/gd .endif @@ -43,6 +43,11 @@ MAN1= cfgmaker.1 contrib.1 faq.1 forum.1 indexmaker.1 logfile.1 \ post-patch: ${RM} ${WRKSRC}/lib/mrtg2/BER.pm ${WRKSRC}/lib/mrtg2/SNMP_*.pm +.if defined(WITH_GD2) + ${PERL} -pi -e 's:%%GD%%:-lgd:g' ${WRKSRC}/configure +.else + ${PERL} -pi -e 's:%%GD%%:-lgd1:g' ${WRKSRC}/configure +.endif do-install: ${MKDIR} -m 755 ${PREFIX}/etc/mrtg diff --git a/net-mgmt/mrtg/files/patch-configure b/net-mgmt/mrtg/files/patch-configure new file mode 100644 index 000000000000..4fe9b654edc6 --- /dev/null +++ b/net-mgmt/mrtg/files/patch-configure @@ -0,0 +1,120 @@ +--- configure.orig Sun Mar 9 02:17:40 2003 ++++ configure Sat Jul 5 23:55:07 2003 +@@ -3159,13 +3159,13 @@ + LDFLAGS="${LDFLAGS} ${MATHLIBS}" + + GDEXTRALIB="" +-echo "$as_me:$LINENO: checking for gdImageGif in -lgd" >&5 +-echo $ECHO_N "checking for gdImageGif in -lgd... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking for gdImageGif in %%GD%%" >&5 ++echo $ECHO_N "checking for gdImageGif in %%GD%%... $ECHO_C" >&6 + if test "${ac_cv_lib_gd_gdImageGif+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lgd -lgd ${MATHLIBS} $LIBS" ++LIBS="%%GD%% %%GD%% ${MATHLIBS} $LIBS" + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" +@@ -3211,20 +3211,20 @@ + if test $ac_cv_lib_gd_gdImageGif = yes; then + + GDFORM_EXT=gif +- GLIBS="-lgd" ++ GLIBS="%%GD%%" + + else + : + fi + + +-echo "$as_me:$LINENO: checking for gdImagePng in -lgd" >&5 +-echo $ECHO_N "checking for gdImagePng in -lgd... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking for gdImagePng in %%GD%%" >&5 ++echo $ECHO_N "checking for gdImagePng in %%GD%%... $ECHO_C" >&6 + if test "${ac_cv_lib_gd_gdImagePng+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lgd -lgd -lpng -lz ${MATHLIBS} $LIBS" ++LIBS="%%GD%% %%GD%% -lpng -lz ${MATHLIBS} $LIBS" + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" +@@ -3270,20 +3270,20 @@ + if test $ac_cv_lib_gd_gdImagePng = yes; then + + GDFORM_EXT=png +- GLIBS="-lgd -lpng -lz" ++ GLIBS="%%GD%% -lpng -lz" + + else + : + fi + + +-echo "$as_me:$LINENO: checking for gdImagePng_jpg in -lgd" >&5 +-echo $ECHO_N "checking for gdImagePng_jpg in -lgd... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking for gdImagePng_jpg in %%GD%%" >&5 ++echo $ECHO_N "checking for gdImagePng_jpg in %%GD%%... $ECHO_C" >&6 + if test "${ac_cv_lib_gd_gdImagePng_jpg+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lgd -lgd -lpng -lz -ljpeg ${MATHLIBS} $LIBS" ++LIBS="%%GD%% %%GD%% -lpng -lz -ljpeg ${MATHLIBS} $LIBS" + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" +@@ -3329,20 +3329,20 @@ + if test $ac_cv_lib_gd_gdImagePng_jpg = yes; then + + GDFORM_EXT=png +- GLIBS="-lgd -lpng -lz -ljpeg" ++ GLIBS="%%GD%% -lpng -lz -ljpeg" + + else + : + fi + + +-echo "$as_me:$LINENO: checking for gdImagePng_jpg_ft in -lgd" >&5 +-echo $ECHO_N "checking for gdImagePng_jpg_ft in -lgd... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking for gdImagePng_jpg_ft in %%GD%%" >&5 ++echo $ECHO_N "checking for gdImagePng_jpg_ft in %%GD%%... $ECHO_C" >&6 + if test "${ac_cv_lib_gd_gdImagePng_jpg_ft+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lgd -lgd -lpng -lz -ljpeg -lfreetype ${MATHLIBS} $LIBS" ++LIBS="%%GD%% %%GD%% -lpng -lz -ljpeg -lfreetype ${MATHLIBS} $LIBS" + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" +@@ -3388,7 +3388,7 @@ + if test $ac_cv_lib_gd_gdImagePng_jpg_ft = yes; then + + GDFORM_EXT=png +- GLIBS="-lgd -lpng -lz -ljpeg -lfreetype" ++ GLIBS="%%GD%% -lpng -lz -ljpeg -lfreetype" + + else + : +@@ -3399,13 +3399,13 @@ + CPPFLAGS="$CPPFLAGS -DGFORM_GD=gdImageGif" + fi + +-echo "$as_me:$LINENO: checking for gdImageGd in -lgd" >&5 +-echo $ECHO_N "checking for gdImageGd in -lgd... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking for gdImageGd in %%GD%%" >&5 ++echo $ECHO_N "checking for gdImageGd in %%GD%%... $ECHO_C" >&6 + if test "${ac_cv_lib_gd_gdImageGd+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lgd -Wl,-Bstatic ${GLIBS} -Wl,-Bdynamic $LIBS" ++LIBS="%%GD%% -Wl,-Bstatic ${GLIBS} -Wl,-Bdynamic $LIBS" + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" diff --git a/net-mgmt/nagios/Makefile b/net-mgmt/nagios/Makefile index 7ef95c86f584..f427cd1dfd07 100644 --- a/net-mgmt/nagios/Makefile +++ b/net-mgmt/nagios/Makefile @@ -17,15 +17,15 @@ COMMENT= Extremely powerful network monitoring system .if defined(WITH_GD2) LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 .else -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd1.2:${PORTSDIR}/graphics/gd .endif LIB_DEPENDS+= gnugetopt.1:${PORTSDIR}/devel/libgnugetopt RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net/nagios-plugins GNU_CONFIGURE= yes -CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ - CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \ - LIBS="-L${LOCALBASE}/lib -lgd -lgnugetopt" +CONFIGURE_ENV= CPPFLAGS="${INCGD} -I${LOCALBASE}/include" \ + CFLAGS="${CFLAGS} ${INCGD} -I${LOCALBASE}/include" \ + LIBS="-L${LOCALBASE}/lib ${LIBGD} -lgnugetopt" CONFIGURE_ARGS= --with-command-user=nagios \ --with-command-grp=www \ --with-nagios-user=nagios \ @@ -40,6 +40,14 @@ CONFIGURE_ARGS= --with-command-user=nagios \ --localstatedir=/var/spool/nagios \ --prefix=${PREFIX} +.if defined(WITH_GD2) +INCGD= -I${LOCALBASE}/include +LIBGD= -lgd +.else +INCGD= -I${LOCALBASE}/include/gd +LIBGD= -lgd1 +.endif + .if defined(WITH_MYSQL) LIB_DEPENDS+= mysqlclient.10:${PORTSDIR}/databases/mysql323-client CONFIGURE_ARGS+=--with-mysql-lib=${LOCALBASE}/lib/mysql \ diff --git a/net-mgmt/nagios12/Makefile b/net-mgmt/nagios12/Makefile index 7ef95c86f584..f427cd1dfd07 100644 --- a/net-mgmt/nagios12/Makefile +++ b/net-mgmt/nagios12/Makefile @@ -17,15 +17,15 @@ COMMENT= Extremely powerful network monitoring system .if defined(WITH_GD2) LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 .else -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd1.2:${PORTSDIR}/graphics/gd .endif LIB_DEPENDS+= gnugetopt.1:${PORTSDIR}/devel/libgnugetopt RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net/nagios-plugins GNU_CONFIGURE= yes -CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ - CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \ - LIBS="-L${LOCALBASE}/lib -lgd -lgnugetopt" +CONFIGURE_ENV= CPPFLAGS="${INCGD} -I${LOCALBASE}/include" \ + CFLAGS="${CFLAGS} ${INCGD} -I${LOCALBASE}/include" \ + LIBS="-L${LOCALBASE}/lib ${LIBGD} -lgnugetopt" CONFIGURE_ARGS= --with-command-user=nagios \ --with-command-grp=www \ --with-nagios-user=nagios \ @@ -40,6 +40,14 @@ CONFIGURE_ARGS= --with-command-user=nagios \ --localstatedir=/var/spool/nagios \ --prefix=${PREFIX} +.if defined(WITH_GD2) +INCGD= -I${LOCALBASE}/include +LIBGD= -lgd +.else +INCGD= -I${LOCALBASE}/include/gd +LIBGD= -lgd1 +.endif + .if defined(WITH_MYSQL) LIB_DEPENDS+= mysqlclient.10:${PORTSDIR}/databases/mysql323-client CONFIGURE_ARGS+=--with-mysql-lib=${LOCALBASE}/lib/mysql \ diff --git a/net-mgmt/nagios2/Makefile b/net-mgmt/nagios2/Makefile index 7ef95c86f584..f427cd1dfd07 100644 --- a/net-mgmt/nagios2/Makefile +++ b/net-mgmt/nagios2/Makefile @@ -17,15 +17,15 @@ COMMENT= Extremely powerful network monitoring system .if defined(WITH_GD2) LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 .else -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd1.2:${PORTSDIR}/graphics/gd .endif LIB_DEPENDS+= gnugetopt.1:${PORTSDIR}/devel/libgnugetopt RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net/nagios-plugins GNU_CONFIGURE= yes -CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ - CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \ - LIBS="-L${LOCALBASE}/lib -lgd -lgnugetopt" +CONFIGURE_ENV= CPPFLAGS="${INCGD} -I${LOCALBASE}/include" \ + CFLAGS="${CFLAGS} ${INCGD} -I${LOCALBASE}/include" \ + LIBS="-L${LOCALBASE}/lib ${LIBGD} -lgnugetopt" CONFIGURE_ARGS= --with-command-user=nagios \ --with-command-grp=www \ --with-nagios-user=nagios \ @@ -40,6 +40,14 @@ CONFIGURE_ARGS= --with-command-user=nagios \ --localstatedir=/var/spool/nagios \ --prefix=${PREFIX} +.if defined(WITH_GD2) +INCGD= -I${LOCALBASE}/include +LIBGD= -lgd +.else +INCGD= -I${LOCALBASE}/include/gd +LIBGD= -lgd1 +.endif + .if defined(WITH_MYSQL) LIB_DEPENDS+= mysqlclient.10:${PORTSDIR}/databases/mysql323-client CONFIGURE_ARGS+=--with-mysql-lib=${LOCALBASE}/lib/mysql \ diff --git a/net/mrtg/Makefile b/net/mrtg/Makefile index 9129659de996..c0784deb2d99 100644 --- a/net/mrtg/Makefile +++ b/net/mrtg/Makefile @@ -7,7 +7,7 @@ PORTNAME= mrtg PORTVERSION= 2.9.29 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES= net MASTER_SITES= http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub/ \ @@ -25,7 +25,7 @@ LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 CONFIGURE_ARGS= --with-gd-lib=${LOCALBASE}/lib \ --with-gd-inc=${LOCALBASE}/include .else -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd1.2:${PORTSDIR}/graphics/gd CONFIGURE_ARGS= --with-gd-lib=${LOCALBASE}/lib \ --with-gd-inc=${LOCALBASE}/include/gd .endif @@ -43,6 +43,11 @@ MAN1= cfgmaker.1 contrib.1 faq.1 forum.1 indexmaker.1 logfile.1 \ post-patch: ${RM} ${WRKSRC}/lib/mrtg2/BER.pm ${WRKSRC}/lib/mrtg2/SNMP_*.pm +.if defined(WITH_GD2) + ${PERL} -pi -e 's:%%GD%%:-lgd:g' ${WRKSRC}/configure +.else + ${PERL} -pi -e 's:%%GD%%:-lgd1:g' ${WRKSRC}/configure +.endif do-install: ${MKDIR} -m 755 ${PREFIX}/etc/mrtg diff --git a/net/mrtg/files/patch-configure b/net/mrtg/files/patch-configure new file mode 100644 index 000000000000..4fe9b654edc6 --- /dev/null +++ b/net/mrtg/files/patch-configure @@ -0,0 +1,120 @@ +--- configure.orig Sun Mar 9 02:17:40 2003 ++++ configure Sat Jul 5 23:55:07 2003 +@@ -3159,13 +3159,13 @@ + LDFLAGS="${LDFLAGS} ${MATHLIBS}" + + GDEXTRALIB="" +-echo "$as_me:$LINENO: checking for gdImageGif in -lgd" >&5 +-echo $ECHO_N "checking for gdImageGif in -lgd... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking for gdImageGif in %%GD%%" >&5 ++echo $ECHO_N "checking for gdImageGif in %%GD%%... $ECHO_C" >&6 + if test "${ac_cv_lib_gd_gdImageGif+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lgd -lgd ${MATHLIBS} $LIBS" ++LIBS="%%GD%% %%GD%% ${MATHLIBS} $LIBS" + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" +@@ -3211,20 +3211,20 @@ + if test $ac_cv_lib_gd_gdImageGif = yes; then + + GDFORM_EXT=gif +- GLIBS="-lgd" ++ GLIBS="%%GD%%" + + else + : + fi + + +-echo "$as_me:$LINENO: checking for gdImagePng in -lgd" >&5 +-echo $ECHO_N "checking for gdImagePng in -lgd... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking for gdImagePng in %%GD%%" >&5 ++echo $ECHO_N "checking for gdImagePng in %%GD%%... $ECHO_C" >&6 + if test "${ac_cv_lib_gd_gdImagePng+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lgd -lgd -lpng -lz ${MATHLIBS} $LIBS" ++LIBS="%%GD%% %%GD%% -lpng -lz ${MATHLIBS} $LIBS" + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" +@@ -3270,20 +3270,20 @@ + if test $ac_cv_lib_gd_gdImagePng = yes; then + + GDFORM_EXT=png +- GLIBS="-lgd -lpng -lz" ++ GLIBS="%%GD%% -lpng -lz" + + else + : + fi + + +-echo "$as_me:$LINENO: checking for gdImagePng_jpg in -lgd" >&5 +-echo $ECHO_N "checking for gdImagePng_jpg in -lgd... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking for gdImagePng_jpg in %%GD%%" >&5 ++echo $ECHO_N "checking for gdImagePng_jpg in %%GD%%... $ECHO_C" >&6 + if test "${ac_cv_lib_gd_gdImagePng_jpg+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lgd -lgd -lpng -lz -ljpeg ${MATHLIBS} $LIBS" ++LIBS="%%GD%% %%GD%% -lpng -lz -ljpeg ${MATHLIBS} $LIBS" + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" +@@ -3329,20 +3329,20 @@ + if test $ac_cv_lib_gd_gdImagePng_jpg = yes; then + + GDFORM_EXT=png +- GLIBS="-lgd -lpng -lz -ljpeg" ++ GLIBS="%%GD%% -lpng -lz -ljpeg" + + else + : + fi + + +-echo "$as_me:$LINENO: checking for gdImagePng_jpg_ft in -lgd" >&5 +-echo $ECHO_N "checking for gdImagePng_jpg_ft in -lgd... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking for gdImagePng_jpg_ft in %%GD%%" >&5 ++echo $ECHO_N "checking for gdImagePng_jpg_ft in %%GD%%... $ECHO_C" >&6 + if test "${ac_cv_lib_gd_gdImagePng_jpg_ft+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lgd -lgd -lpng -lz -ljpeg -lfreetype ${MATHLIBS} $LIBS" ++LIBS="%%GD%% %%GD%% -lpng -lz -ljpeg -lfreetype ${MATHLIBS} $LIBS" + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" +@@ -3388,7 +3388,7 @@ + if test $ac_cv_lib_gd_gdImagePng_jpg_ft = yes; then + + GDFORM_EXT=png +- GLIBS="-lgd -lpng -lz -ljpeg -lfreetype" ++ GLIBS="%%GD%% -lpng -lz -ljpeg -lfreetype" + + else + : +@@ -3399,13 +3399,13 @@ + CPPFLAGS="$CPPFLAGS -DGFORM_GD=gdImageGif" + fi + +-echo "$as_me:$LINENO: checking for gdImageGd in -lgd" >&5 +-echo $ECHO_N "checking for gdImageGd in -lgd... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking for gdImageGd in %%GD%%" >&5 ++echo $ECHO_N "checking for gdImageGd in %%GD%%... $ECHO_C" >&6 + if test "${ac_cv_lib_gd_gdImageGd+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lgd -Wl,-Bstatic ${GLIBS} -Wl,-Bdynamic $LIBS" ++LIBS="%%GD%% -Wl,-Bstatic ${GLIBS} -Wl,-Bdynamic $LIBS" + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" diff --git a/net/nagios/Makefile b/net/nagios/Makefile index 7ef95c86f584..f427cd1dfd07 100644 --- a/net/nagios/Makefile +++ b/net/nagios/Makefile @@ -17,15 +17,15 @@ COMMENT= Extremely powerful network monitoring system .if defined(WITH_GD2) LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 .else -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd1.2:${PORTSDIR}/graphics/gd .endif LIB_DEPENDS+= gnugetopt.1:${PORTSDIR}/devel/libgnugetopt RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net/nagios-plugins GNU_CONFIGURE= yes -CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ - CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \ - LIBS="-L${LOCALBASE}/lib -lgd -lgnugetopt" +CONFIGURE_ENV= CPPFLAGS="${INCGD} -I${LOCALBASE}/include" \ + CFLAGS="${CFLAGS} ${INCGD} -I${LOCALBASE}/include" \ + LIBS="-L${LOCALBASE}/lib ${LIBGD} -lgnugetopt" CONFIGURE_ARGS= --with-command-user=nagios \ --with-command-grp=www \ --with-nagios-user=nagios \ @@ -40,6 +40,14 @@ CONFIGURE_ARGS= --with-command-user=nagios \ --localstatedir=/var/spool/nagios \ --prefix=${PREFIX} +.if defined(WITH_GD2) +INCGD= -I${LOCALBASE}/include +LIBGD= -lgd +.else +INCGD= -I${LOCALBASE}/include/gd +LIBGD= -lgd1 +.endif + .if defined(WITH_MYSQL) LIB_DEPENDS+= mysqlclient.10:${PORTSDIR}/databases/mysql323-client CONFIGURE_ARGS+=--with-mysql-lib=${LOCALBASE}/lib/mysql \ diff --git a/textproc/modlogan/Makefile b/textproc/modlogan/Makefile index 9f6ba1ddeefb..fea5e463920d 100644 --- a/textproc/modlogan/Makefile +++ b/textproc/modlogan/Makefile @@ -7,6 +7,7 @@ PORTNAME= modlogan PORTVERSION= 0.8.9 +PORTREVISION= 1 CATEGORIES= textproc www MASTER_SITES= http://jan.kneschke.de/projects/modlogan/download/ \ ${MASTER_SITE_SOURCEFORGE} @@ -15,7 +16,7 @@ MAINTAINER= netchild@FreeBSD.org COMMENT= A modular log file analysis program LIB_DEPENDS= adns.1:${PORTSDIR}/net/adns \ - gd.2:${PORTSDIR}/graphics/gd \ + gd.4:${PORTSDIR}/graphics/gd2 \ intl.4:${PORTSDIR}/devel/gettext \ pcre.0:${PORTSDIR}/devel/pcre \ expat.4:${PORTSDIR}/textproc/expat2 diff --git a/www/analog/Makefile b/www/analog/Makefile index cf66af445908..0145633f4fb8 100644 --- a/www/analog/Makefile +++ b/www/analog/Makefile @@ -7,6 +7,7 @@ PORTNAME= analog PORTVERSION= 5.24 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= www MASTER_SITES= http://www.analog.cx/ \ @@ -22,7 +23,7 @@ MASTER_SITES= http://www.analog.cx/ \ MAINTAINER= mharo@FreeBSD.org COMMENT= An extremely fast program for analysing WWW logfiles -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd \ +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 \ jpeg.9:${PORTSDIR}/graphics/jpeg \ png.5:${PORTSDIR}/graphics/png diff --git a/www/http-analyze/Makefile b/www/http-analyze/Makefile index 5c449c8393bc..e11b17398a88 100644 --- a/www/http-analyze/Makefile +++ b/www/http-analyze/Makefile @@ -6,7 +6,7 @@ PORTNAME= http-analyze PORTVERSION= 2.01 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www MASTER_SITES= ftp://ftp.rent-a-guru.de/pub/http-analyze2.01/ DISTNAME= ${PORTNAME}${PORTVERSION} @@ -16,7 +16,7 @@ MAINTAINER= todd@thisisa.com COMMENT= A fast Log-Analyzer for web servers BUILD_DEPENDS= gif2png:${PORTSDIR}/graphics/gif2png -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 MAN1= http-analyze.1 diff --git a/www/mgstat/Makefile b/www/mgstat/Makefile index ac789231ff7f..0040cdb1f2ba 100644 --- a/www/mgstat/Makefile +++ b/www/mgstat/Makefile @@ -7,13 +7,14 @@ PORTNAME= mgstat PORTVERSION= 0.11 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= http://wizard.ae.krakow.pl/~mike/download/ MAINTAINER= ports@FreeBSD.org COMMENT= Produce graphs from mod_gzip log files -LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd2 GNU_CONFIGURE= yes |