1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-23 09:10:43 +00:00

Add gdchart 0.9.4b,

easy to use, fast C API for creating charts and
graphs.

PR:		27868
Submitted by:	Anders Nordby <anders@fix.no>
This commit is contained in:
Alexander Langer 2001-06-16 15:03:06 +00:00
parent b36af6e963
commit 007223ee3e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=44069
13 changed files with 254 additions and 0 deletions

View File

@ -48,6 +48,7 @@
SUBDIR += g2
SUBDIR += gcolor
SUBDIR += gd
SUBDIR += gdchart
SUBDIR += gdk-pixbuf
SUBDIR += gdtclft
SUBDIR += geist

47
graphics/gdchart/Makefile Normal file
View File

@ -0,0 +1,47 @@
# New ports collection makefile for: gdchart
# Date created: 4 June 2001
# Whom: Anders Nordby <anders@fix.no>
#
# $FreeBSD$
#
PORTNAME= gdchart
PORTVERSION= 0.9.4b
CATEGORIES= graphics
MASTER_SITES= http://www.fred.net/brv/chart/ \
ftp://ftp.nuug.no/pub/anders/distfiles/
DISTNAME= ${PORTNAME}0.94b
MAINTAINER= anders@fix.no
LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd
MAKEFILE= makefile
do-install:
${INSTALL_DATA} ${WRKSRC}/libgdchart.a ${PREFIX}/lib
${INSTALL_DATA} ${WRKSRC}/gdchart.h ${PREFIX}/include
${INSTALL_DATA} ${WRKSRC}/gdc.h ${PREFIX}/include
${INSTALL_DATA} ${WRKSRC}/gdcpie.h ${PREFIX}/include
.if !defined(NOPORTDOCS)
post-install:
@${INSTALL} -d -m 0755 ${PREFIX}/share/doc/gdchart
${INSTALL_DATA} ${WRKSRC}/gdc_samp1.c ${PREFIX}/share/doc/gdchart
${INSTALL_DATA} ${WRKSRC}/gdc_samp2.c ${PREFIX}/share/doc/gdchart
${INSTALL_DATA} ${WRKSRC}/README.txt ${PREFIX}/share/doc/gdchart
${INSTALL_DATA} ${WRKSRC}/NOTES-092b.txt ${PREFIX}/share/doc/gdchart
${INSTALL_DATA} ${WRKSRC}/NOTES-093b.txt ${PREFIX}/share/doc/gdchart
${INSTALL_DATA} ${WRKSRC}/NOTES-094b.txt ${PREFIX}/share/doc/gdchart
@${ECHO} "================================================================================"
@${ECHO} "Have a look at the sample code and README(s) in ${PREFIX}/share/doc/${PORTNAME}."
@${ECHO} "To compile gdc_samp1, try something like:"
@${ECHO}
@${ECHO} "gcc -I${PREFIX}/include -o gdc_samp1 gdc_samp1.c -L${PREFIX}/lib -lgdchart -lgd"
@${ECHO}
@${ECHO} "NB: gdchart will produce PNGs, not GIFs, as newer versions of gd stopped"
@${ECHO} "supporting GIFs."
@${ECHO} "================================================================================"
.endif
.include <bsd.port.mk>

View File

@ -0,0 +1 @@
MD5 (gdchart0.94b.tar.gz) = 261e0a1527f4a50f0eaae7171275a0ee

View File

@ -0,0 +1,11 @@
--- gdc.c.orig Mon Jun 4 02:41:42 2001
+++ gdc.c Mon Jun 4 02:41:51 2001
@@ -158,7 +158,7 @@
if( GDC_generate_gif )
{
fflush(fptr); // clear anything buffered
- gdImageGif(im, fptr);
+ gdImagePng(im, fptr);
}
if( GDC_hold_img & GDC_EXPOSE_IMAGE )

View File

@ -0,0 +1,20 @@
--- gdc_pie.c.orig Fri Nov 13 05:00:55 1998
+++ gdc_pie.c Mon Jun 4 02:42:16 2001
@@ -1,7 +1,7 @@
/* GDCHART 0.94b GDC_PIE.C 12 Nov 1998 */
#include <stdio.h>
-#include <values.h>
+#include <limits.h>
#include <math.h>
#define GDC_INCL
@@ -610,7 +610,7 @@
rad -= GDCPIE_label_dist;
}
- gdImageGif(im, gif_fptr);
+ gdImagePng(im, gif_fptr);
gdImageDestroy(im);
return;

View File

@ -0,0 +1,11 @@
--- gdc_pie_samp.c.orig Mon Jun 4 01:25:29 2001
+++ gdc_pie_samp.c Mon Jun 4 01:25:51 2001
@@ -4,7 +4,7 @@
/* vi: :set tabstop=4 */
#include <stdio.h>
-#include <values.h>
+#include <limits.h>
#include <math.h>
#include "gdc.h"

View File

@ -0,0 +1,11 @@
--- gdc_samp1.c.orig Mon Jun 4 01:22:38 2001
+++ gdc_samp1.c Mon Jun 4 01:23:00 2001
@@ -9,7 +9,7 @@
/* for CGI use un-comment the "Content-Type" line */
#include <stdio.h>
-#include <values.h>
+#include <limits.h>
#include "gdc.h"
#include "gdchart.h"

View File

@ -0,0 +1,11 @@
--- gdc_samp2.c.orig Mon Jun 4 01:24:03 2001
+++ gdc_samp2.c Mon Jun 4 01:24:22 2001
@@ -13,7 +13,7 @@
*/
#include <stdio.h>
-#include <values.h>
+#include <limits.h>
#include "gdc.h"
#include "gdchart.h"

View File

@ -0,0 +1,56 @@
--- gdchart.c.orig Mon Apr 19 00:37:46 1999
+++ gdchart.c Mon Jun 4 02:40:16 2001
@@ -3,7 +3,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <values.h>
+#include <limits.h>
#include <math.h>
#include <string.h>
#include <stdarg.h>
@@ -517,7 +517,7 @@
if( GDC_xaxis && xlbl )
{
- int biggest = -MAXINT;
+ int biggest = -INT_MAX;
for( i=0; i<num_points; ++i )
{
@@ -727,7 +727,7 @@
}
else
{
- if( bg_img = gdImageCreateFromGif(in) ) // =
+ if( bg_img = gdImageCreateFromPng(in) ) // =
{
int bgxpos = gdImageSX(bg_img)<GIFWIDTH? GIFWIDTH/2 - gdImageSX(bg_img)/2: 0,
bgypos = gdImageSY(bg_img)<GIFHEIGHT? GIFHEIGHT/2 - gdImageSY(bg_img)/2: 0;
@@ -1028,7 +1028,7 @@
int num_xlbls = /* maximum x lables that'll fit */
/* each xlbl + avg due to num_lf_xlbls */
graphwidth /
- ( (GDC_xlabel_spacing==MAXSHORT?0:GDC_xlabel_spacing)+GDC_fontc[GDC_xaxisfont_size].h +
+ ( (GDC_xlabel_spacing==SHRT_MAX?0:GDC_xlabel_spacing)+GDC_fontc[GDC_xaxisfont_size].h +
(num_lf_xlbls*(GDC_fontc[GDC_xaxisfont_size].h-1))/num_points );
int labelcolor = GDC_XLabelColor==GDC_DFLTCOLOR?
LineColor: clrallocate( im, GDC_XLabelColor );
@@ -1036,7 +1036,7 @@
for( i=0; i<num_points+(do_bar?2:0); ++i )
if( (i%(1+num_points/num_xlbls) == 0) || // # x labels are regulated
(num_xlbls >= num_points) ||
- GDC_xlabel_spacing == MAXSHORT )
+ GDC_xlabel_spacing == SHRT_MAX )
{
int xi = do_bar? i-1: i;
@@ -1817,7 +1817,7 @@
if( GDC_generate_gif )
{
fflush(gif_fptr); // clear anything buffered
- gdImageGif( im, gif_fptr );
+ gdImagePng( im, gif_fptr );
}
if( bg_img )

View File

@ -0,0 +1,67 @@
--- makefile.orig Mon Apr 19 01:22:38 1999
+++ makefile Mon Jun 4 02:25:37 2001
@@ -1,45 +1,49 @@
GDC_INCL = .
-GD_INCL = gd1.3
-GD_LIB = gd1.3
+GD_INCL = $(PREFIX)/include/gd
+GD_LIB = $(PREFIX)/lib
-CC=gcc
-
-all: gdc_samp1 gdc_samp2 gdc_pie_samp
+all: libgdchart.a
# compile the samples
gdc_samp1: gdc.o gdchart.o price_conv.o gdc_samp1.o $(GD_LIB)/libgd.a
- $(CC) -o gdc_samp1 gdc.o gdchart.o price_conv.o gdc_samp1.o -L$(GD_LIB) -lgd -lm
+ $(CC) $(CFLAGS) -o gdc_samp1 gdc.o gdchart.o price_conv.o gdc_samp1.o -L$(GD_LIB) -lgd -lm
gdc_samp1.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdchart.h gdc_samp1.c
- $(CC) -I$(GDC_INCL) -c gdc_samp1.c
+ $(CC) $(CFLAGS) -I$(GDC_INCL) -c gdc_samp1.c
gdc_samp2: gdc.o gdchart.o price_conv.o gdc_samp2.o $(GD_LIB)/libgd.a
- $(CC) -o gdc_samp2 gdc.o gdchart.o price_conv.o gdc_samp2.o -L$(GD_LIB) -lgd -lm
+ $(CC) $(CFLAGS) -o gdc_samp2 gdc.o gdchart.o price_conv.o gdc_samp2.o -L$(GD_LIB) -lgd -lm
gdc_samp2.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdchart.h gdc_samp2.c
- $(CC) -I$(GDC_INCL) -c gdc_samp2.c
+ $(CC) $(CFLAGS) -I$(GDC_INCL) -c gdc_samp2.c
gdc_pie_samp: gdc.o gdc_pie.o price_conv.o gdc_pie_samp.o $(GD_LIB)/libgd.a
- $(CC) -o gdc_pie_samp gdc.o gdc_pie.o price_conv.o gdc_pie_samp.o -L$(GD_LIB) -lgd -lm
+ $(CC) $(CFLAGS) -o gdc_pie_samp gdc.o gdc_pie.o price_conv.o gdc_pie_samp.o -L$(GD_LIB) -lgd -lm
gdc_pie_samp.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdcpie.h gdc_pie_samp.c
- $(CC) -I$(GDC_INCL) -c gdc_pie_samp.c
+ $(CC) $(CFLAGS) -I$(GDC_INCL) -c gdc_pie_samp.c
# --- compile the lib ---
price_conv.o: price_conv.c
- $(CC) -c price_conv.c
+ $(CC) $(CFLAGS) -c price_conv.c
gdc.o: gdc.c gdc.h
- $(CC) -I$(GD_INCL) -I$(GDC_INCL) -c gdc.c
+ $(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) -c gdc.c
gdc_pie.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdcpie.h gdc_pie.c
- $(CC) -I$(GD_INCL) -I$(GDC_INCL) -c gdc_pie.c
+ $(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) -c gdc_pie.c
gdchart.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdchart.h gdchart.c
- $(CC) -I$(GD_INCL) -I$(GDC_INCL) -c gdchart.c
+ $(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) -c gdchart.c
$(GD_LIB)/libgd.a:
cd $(GD_LIB) ; make -f Makefile libgd.a
+
+libgdchart.a: gdc.o gdc_pie.o gdchart.o price_conv.o
+ $(AR) rc libgdchart.a gdc.o gdc_pie.o gdchart.o price_conv.o
+ @if [ -x $(RANLIB) ] ; then \
+ $(RANLIB) libgdchart.a; \
+ fi;
# --- clean ---
clean:

View File

@ -0,0 +1 @@
Easy to use, fast C API for creating charts and graphs

View File

@ -0,0 +1,6 @@
GDChart is an easy to use, high performance library/C API for creating charts
and graphs in PNG format.
WWW: http://www.fred.net/brv/chart/
- Anders Nordby <anders@fix.no>

View File

@ -0,0 +1,11 @@
lib/libgdchart.a
include/gdchart.h
include/gdc.h
include/gdcpie.h
%%PORTDOCS%%share/doc/gdchart/gdc_samp1.c
%%PORTDOCS%%share/doc/gdchart/gdc_samp2.c
%%PORTDOCS%%share/doc/gdchart/README.txt
%%PORTDOCS%%share/doc/gdchart/NOTES-092b.txt
%%PORTDOCS%%share/doc/gdchart/NOTES-093b.txt
%%PORTDOCS%%share/doc/gdchart/NOTES-094b.txt
%%PORTDOCS%%@dirrm share/doc/gdchart