Skip site navigation (1)Skip section navigation (2)
Date:      Mon,  4 Jun 2001 03:22:13 +0200 (CEST)
From:      Anders Nordby <anders@fix.no>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/27868: New port: graphics/gdchart
Message-ID:  <20010604012213.CFE203C9C@totem.fix.no>

next in thread | raw e-mail | index | archive | help

>Number:         27868
>Category:       ports
>Synopsis:       New port: graphics/gdchart
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 03 18:30:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Anders Nordby
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
Fluxpod Information eXchange
>Environment:

kern.osreldate: 430000 (4.3-STABLE)

>Description:

New port of gdchart: an easy to use, fast C API for creating charts and graphs.

>How-To-Repeat:

	<Code/input/activities to reproduce the problem (multiple lines)>

>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	gdchart
#	gdchart/files
#	gdchart/files/patch-gdchart.c
#	gdchart/files/patch-gdc_samp1.c
#	gdchart/files/patch-gdc_samp2.c
#	gdchart/files/patch-gdc_pie.c
#	gdchart/files/patch-gdc_pie_samp.c
#	gdchart/files/patch-makefile
#	gdchart/files/patch-gdc.c
#	gdchart/Makefile
#	gdchart/distinfo
#	gdchart/pkg-comment
#	gdchart/pkg-descr
#	gdchart/pkg-plist
#
echo c - gdchart
mkdir -p gdchart > /dev/null 2>&1
echo c - gdchart/files
mkdir -p gdchart/files > /dev/null 2>&1
echo x - gdchart/files/patch-gdchart.c
sed 's/^X//' >gdchart/files/patch-gdchart.c << 'END-of-gdchart/files/patch-gdchart.c'
X--- gdchart.c.orig	Mon Apr 19 00:37:46 1999
X+++ gdchart.c	Mon Jun  4 02:40:16 2001
X@@ -3,7 +3,7 @@
X 
X #include <stdio.h>
X #include <stdlib.h>
X-#include <values.h>
X+#include <limits.h>
X #include <math.h>
X #include <string.h>
X #include <stdarg.h>
X@@ -517,7 +517,7 @@
X 
X 	if( GDC_xaxis && xlbl )
X 		{
X-		int biggest     = -MAXINT;
X+		int biggest     = -INT_MAX;
X 
X 		for( i=0; i<num_points; ++i )
X 			{
X@@ -727,7 +727,7 @@
X 			}
X 		else
X 			{
X-			if( bg_img = gdImageCreateFromGif(in) )					// =
X+			if( bg_img = gdImageCreateFromPng(in) )					// =
X 				{
X 				int	bgxpos = gdImageSX(bg_img)<GIFWIDTH?  GIFWIDTH/2 - gdImageSX(bg_img)/2:  0,
X 					bgypos = gdImageSY(bg_img)<GIFHEIGHT? GIFHEIGHT/2 - gdImageSY(bg_img)/2: 0;
X@@ -1028,7 +1028,7 @@
X 		int		num_xlbls =										/* maximum x lables that'll fit */
X 																/* each xlbl + avg due to num_lf_xlbls */
X 					graphwidth /
X-						( (GDC_xlabel_spacing==MAXSHORT?0:GDC_xlabel_spacing)+GDC_fontc[GDC_xaxisfont_size].h +
X+						( (GDC_xlabel_spacing==SHRT_MAX?0:GDC_xlabel_spacing)+GDC_fontc[GDC_xaxisfont_size].h +
X 						  (num_lf_xlbls*(GDC_fontc[GDC_xaxisfont_size].h-1))/num_points );
X 		int		labelcolor = GDC_XLabelColor==GDC_DFLTCOLOR? 
X 							 LineColor: clrallocate( im, GDC_XLabelColor );
X@@ -1036,7 +1036,7 @@
X 		for( i=0; i<num_points+(do_bar?2:0); ++i )
X 			if( (i%(1+num_points/num_xlbls) == 0) ||					// # x labels are regulated
X 				(num_xlbls >= num_points)         ||
X-				GDC_xlabel_spacing == MAXSHORT )
X+				GDC_xlabel_spacing == SHRT_MAX )
X 				{
X 				int	xi = do_bar? i-1: i;
X 
X@@ -1817,7 +1817,7 @@
X 	if( GDC_generate_gif )
X 		{
X 		fflush(gif_fptr);			// clear anything buffered 
X-		gdImageGif( im, gif_fptr );
X+		gdImagePng( im, gif_fptr );
X 		}
X 
X 	if( bg_img )
END-of-gdchart/files/patch-gdchart.c
echo x - gdchart/files/patch-gdc_samp1.c
sed 's/^X//' >gdchart/files/patch-gdc_samp1.c << 'END-of-gdchart/files/patch-gdc_samp1.c'
X--- gdc_samp1.c.orig	Mon Jun  4 01:22:38 2001
X+++ gdc_samp1.c	Mon Jun  4 01:23:00 2001
X@@ -9,7 +9,7 @@
X /* for CGI use un-comment the "Content-Type" line */
X 
X #include <stdio.h>
X-#include <values.h>
X+#include <limits.h>
X  
X #include "gdc.h"
X #include "gdchart.h"
END-of-gdchart/files/patch-gdc_samp1.c
echo x - gdchart/files/patch-gdc_samp2.c
sed 's/^X//' >gdchart/files/patch-gdc_samp2.c << 'END-of-gdchart/files/patch-gdc_samp2.c'
X--- gdc_samp2.c.orig	Mon Jun  4 01:24:03 2001
X+++ gdc_samp2.c	Mon Jun  4 01:24:22 2001
X@@ -13,7 +13,7 @@
X */
X 
X #include <stdio.h>
X-#include <values.h>
X+#include <limits.h>
X 
X #include "gdc.h"
X #include "gdchart.h"
END-of-gdchart/files/patch-gdc_samp2.c
echo x - gdchart/files/patch-gdc_pie.c
sed 's/^X//' >gdchart/files/patch-gdc_pie.c << 'END-of-gdchart/files/patch-gdc_pie.c'
X--- gdc_pie.c.orig	Fri Nov 13 05:00:55 1998
X+++ gdc_pie.c	Mon Jun  4 02:42:16 2001
X@@ -1,7 +1,7 @@
X /* GDCHART 0.94b  GDC_PIE.C  12 Nov 1998 */
X 
X #include <stdio.h>
X-#include <values.h>
X+#include <limits.h>
X #include <math.h>
X 
X #define GDC_INCL
X@@ -610,7 +610,7 @@
X 		rad -= GDCPIE_label_dist;
X 		}
X 
X-	gdImageGif(im, gif_fptr);
X+	gdImagePng(im, gif_fptr);
X 
X 	gdImageDestroy(im);
X 	return;
END-of-gdchart/files/patch-gdc_pie.c
echo x - gdchart/files/patch-gdc_pie_samp.c
sed 's/^X//' >gdchart/files/patch-gdc_pie_samp.c << 'END-of-gdchart/files/patch-gdc_pie_samp.c'
X--- gdc_pie_samp.c.orig	Mon Jun  4 01:25:29 2001
X+++ gdc_pie_samp.c	Mon Jun  4 01:25:51 2001
X@@ -4,7 +4,7 @@
X /*  vi: :set tabstop=4 */
X 
X #include <stdio.h>
X-#include <values.h>
X+#include <limits.h>
X #include <math.h>
X 
X #include "gdc.h"
END-of-gdchart/files/patch-gdc_pie_samp.c
echo x - gdchart/files/patch-makefile
sed 's/^X//' >gdchart/files/patch-makefile << 'END-of-gdchart/files/patch-makefile'
X--- makefile.orig	Mon Apr 19 01:22:38 1999
X+++ makefile	Mon Jun  4 02:25:37 2001
X@@ -1,45 +1,49 @@
X GDC_INCL = .
X-GD_INCL  = gd1.3
X-GD_LIB   = gd1.3
X+GD_INCL  = $(PREFIX)/include/gd
X+GD_LIB   = $(PREFIX)/lib
X 
X-CC=gcc
X-
X-all: gdc_samp1 gdc_samp2 gdc_pie_samp
X+all: libgdchart.a
X 
X # compile the samples
X gdc_samp1: gdc.o gdchart.o price_conv.o gdc_samp1.o $(GD_LIB)/libgd.a
X-	$(CC) -o gdc_samp1 gdc.o gdchart.o price_conv.o gdc_samp1.o -L$(GD_LIB) -lgd -lm
X+	$(CC) $(CFLAGS) -o gdc_samp1 gdc.o gdchart.o price_conv.o gdc_samp1.o -L$(GD_LIB) -lgd -lm
X 
X gdc_samp1.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdchart.h gdc_samp1.c
X-	$(CC) -I$(GDC_INCL) -c gdc_samp1.c
X+	$(CC) $(CFLAGS) -I$(GDC_INCL) -c gdc_samp1.c
X 
X gdc_samp2: gdc.o gdchart.o price_conv.o gdc_samp2.o $(GD_LIB)/libgd.a
X-	$(CC) -o gdc_samp2 gdc.o gdchart.o price_conv.o gdc_samp2.o -L$(GD_LIB) -lgd -lm
X+	$(CC) $(CFLAGS) -o gdc_samp2 gdc.o gdchart.o price_conv.o gdc_samp2.o -L$(GD_LIB) -lgd -lm
X 
X gdc_samp2.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdchart.h gdc_samp2.c
X-	$(CC) -I$(GDC_INCL) -c gdc_samp2.c
X+	$(CC) $(CFLAGS) -I$(GDC_INCL) -c gdc_samp2.c
X 
X gdc_pie_samp: gdc.o gdc_pie.o price_conv.o gdc_pie_samp.o $(GD_LIB)/libgd.a
X-	$(CC) -o gdc_pie_samp gdc.o gdc_pie.o price_conv.o gdc_pie_samp.o -L$(GD_LIB) -lgd -lm
X+	$(CC) $(CFLAGS) -o gdc_pie_samp gdc.o gdc_pie.o price_conv.o gdc_pie_samp.o -L$(GD_LIB) -lgd -lm
X 
X gdc_pie_samp.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdcpie.h gdc_pie_samp.c
X-	$(CC) -I$(GDC_INCL) -c gdc_pie_samp.c
X+	$(CC) $(CFLAGS) -I$(GDC_INCL) -c gdc_pie_samp.c
X 
X # --- compile the lib ---
X price_conv.o: price_conv.c
X-	$(CC) -c price_conv.c
X+	$(CC) $(CFLAGS) -c price_conv.c
X 
X gdc.o: gdc.c gdc.h
X-	$(CC) -I$(GD_INCL) -I$(GDC_INCL) -c gdc.c
X+	$(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) -c gdc.c
X 
X gdc_pie.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdcpie.h gdc_pie.c
X-	$(CC) -I$(GD_INCL) -I$(GDC_INCL) -c gdc_pie.c
X+	$(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) -c gdc_pie.c
X 
X gdchart.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdchart.h gdchart.c
X-	$(CC) -I$(GD_INCL) -I$(GDC_INCL) -c gdchart.c
X+	$(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) -c gdchart.c
X 
X $(GD_LIB)/libgd.a:
X 	cd $(GD_LIB) ; make -f Makefile libgd.a
X+
X+libgdchart.a: gdc.o gdc_pie.o gdchart.o price_conv.o
X+	$(AR) rc libgdchart.a gdc.o gdc_pie.o gdchart.o price_conv.o
X+	@if [ -x $(RANLIB) ] ; then \
X+	  $(RANLIB) libgdchart.a; \
X+	fi;
X 
X # --- clean ---
X clean:
END-of-gdchart/files/patch-makefile
echo x - gdchart/files/patch-gdc.c
sed 's/^X//' >gdchart/files/patch-gdc.c << 'END-of-gdchart/files/patch-gdc.c'
X--- gdc.c.orig	Mon Jun  4 02:41:42 2001
X+++ gdc.c	Mon Jun  4 02:41:51 2001
X@@ -158,7 +158,7 @@
X 	if( GDC_generate_gif )
X 		{
X 		fflush(fptr);			// clear anything buffered 
X-		gdImageGif(im, fptr);
X+		gdImagePng(im, fptr);
X 		}
X 
X 	if( GDC_hold_img & GDC_EXPOSE_IMAGE )
END-of-gdchart/files/patch-gdc.c
echo x - gdchart/Makefile
sed 's/^X//' >gdchart/Makefile << 'END-of-gdchart/Makefile'
X# New ports collection makefile for:	gdchart
X# Date created:         4 June 2001
X# Whom:                 Anders Nordby <anders@fix.no>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	gdchart
XPORTVERSION=	0.9.4b
XCATEGORIES=	graphics
XMASTER_SITES=	http://www.fred.net/brv/chart/ \
X		ftp://ftp.nuug.no/pub/anders/distfiles/
XDISTNAME=	${PORTNAME}0.94b
X
XMAINTAINER=	anders@fix.no
X
XLIB_DEPENDS=	gd.2:${PORTSDIR}/graphics/gd
X
XMAKEFILE=	makefile
X
Xdo-install:
X	${INSTALL_DATA}	${WRKSRC}/libgdchart.a ${PREFIX}/lib
X	${INSTALL_DATA}	${WRKSRC}/gdchart.h ${PREFIX}/include
X	${INSTALL_DATA}	${WRKSRC}/gdc.h ${PREFIX}/include
X	${INSTALL_DATA}	${WRKSRC}/gdcpie.h ${PREFIX}/include
X
X.if !defined(NOPORTDOCS)
Xpost-install:
X	@${INSTALL} -d -m 0755 ${PREFIX}/share/doc/gdchart
X	${INSTALL_DATA} ${WRKSRC}/gdc_samp1.c ${PREFIX}/share/doc/gdchart
X	${INSTALL_DATA} ${WRKSRC}/gdc_samp2.c ${PREFIX}/share/doc/gdchart
X	${INSTALL_DATA} ${WRKSRC}/README.txt ${PREFIX}/share/doc/gdchart
X	${INSTALL_DATA} ${WRKSRC}/NOTES-092b.txt ${PREFIX}/share/doc/gdchart
X	${INSTALL_DATA} ${WRKSRC}/NOTES-093b.txt ${PREFIX}/share/doc/gdchart
X	${INSTALL_DATA} ${WRKSRC}/NOTES-094b.txt ${PREFIX}/share/doc/gdchart
X	@${ECHO} "================================================================================"
X	@${ECHO} "Have a look at the sample code and README(s) in ${PREFIX}/share/doc/${PORTNAME}."
X	@${ECHO} "To compile gdc_samp1, try something like:"
X	@${ECHO}
X	@${ECHO} "gcc -I${PREFIX}/include -o gdc_samp1 gdc_samp1.c -L${PREFIX}/lib -lgdchart -lgd"
X	@${ECHO}
X	@${ECHO} "NB: gdchart will produce PNGs, not GIFs, as newer versions of gd stopped"
X	@${ECHO} "supporting GIFs."
X	@${ECHO} "================================================================================"
X.endif
X
X.include <bsd.port.mk>
END-of-gdchart/Makefile
echo x - gdchart/distinfo
sed 's/^X//' >gdchart/distinfo << 'END-of-gdchart/distinfo'
XMD5 (gdchart0.94b.tar.gz) = 261e0a1527f4a50f0eaae7171275a0ee
END-of-gdchart/distinfo
echo x - gdchart/pkg-comment
sed 's/^X//' >gdchart/pkg-comment << 'END-of-gdchart/pkg-comment'
XEasy to use, fast C API for creating charts and graphs
END-of-gdchart/pkg-comment
echo x - gdchart/pkg-descr
sed 's/^X//' >gdchart/pkg-descr << 'END-of-gdchart/pkg-descr'
XGDChart is an easy to use, high performance library/C API for creating charts
Xand graphs in PNG format.
X
XWWW: http://www.fred.net/brv/chart/
X
X- Anders Nordby <anders@fix.no>
END-of-gdchart/pkg-descr
echo x - gdchart/pkg-plist
sed 's/^X//' >gdchart/pkg-plist << 'END-of-gdchart/pkg-plist'
Xlib/libgdchart.a
Xinclude/gdchart.h
Xinclude/gdc.h
Xinclude/gdcpie.h
X%%PORTDOCS%%share/doc/gdchart/gdc_samp1.c
X%%PORTDOCS%%share/doc/gdchart/gdc_samp2.c
X%%PORTDOCS%%share/doc/gdchart/README.txt
X%%PORTDOCS%%share/doc/gdchart/NOTES-092b.txt
X%%PORTDOCS%%share/doc/gdchart/NOTES-093b.txt
X%%PORTDOCS%%share/doc/gdchart/NOTES-094b.txt
X%%PORTDOCS%%@dirrm share/doc/gdchart
END-of-gdchart/pkg-plist
exit

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010604012213.CFE203C9C>