Francois Meehan
Just another MoinMoin convert...
I found the Gdchart graphics very nice, but there were no real good instructions to install the product. I don't pretend this is the best doc you have ever seen, but it worked for me. This is why I created this page...
Email: <francois AT iecholden.com>
...
GDchart support for MoinMoin
Required to display graphs in the EventStats/UserAgents and EventStats/HitCounts and all pages info. The following worked on a Linux Gentoo system, the directories locations will vary with other Linux distros.
Download pygdchart-0.6.1.tar.gz, to be found at GD Python interface
Untar the file, then go it's pygdchart-0.6.1/gd-1.8.4 directory.
Compile gdchart by running the command "make".
copy the following files from pygdchart-0.6.1/gd-1.8.4/ to /usr/lib:
gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_io_ss.o gd_jpeg.o gd_png.o gd_ss.o gd_wbmp.o gdcache.o gdfontg.o gdfontl.o gdfontmb.o gdfonts.o gdfontt.o gdft.o gdhelpers.o gdkanji.o gdtables.o gdttf.o gdxpm.o wbmp.o
Go to pygdchart-0.6.1 directory and edit the file "Makefile". For Gentoo, I had to change the following:
HAVE_JPEG = 0 PY_INCLUDE = -I/usr/include/python2.2/
Then run the command "make"
Copy the file gdchart.so to /usr/lib/python2.2
To test if it is working, launch Python and try: "import gdchart"
The following two ebuilds install the latest versions of GDChart and PyGDChart, but it appears that MoinMoin 1.1 can't use them.
media-libs/gdchart-0.11.4
# Copyright 2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils MY_P=${P/-/}dev DESCRIPTION="High performance C library to create charts and graphs in PNG, GIF and WBMP format" HOMEPAGE="http://www.fred.net/brv/chart/" SRC_URI="http://www.fred.net/brv/chart/${MY_P}.tar.gz" LICENSE="as-is + attribution (see README)" SLOT="0" KEYWORDS="~x86" IUSE="jpeg truetype" DEPEND=">=media-libs/libgd-1.8.4 media-libs/libpng sys-libs/zlib jpeg? ( >=media-libs/jpeg-6b ) truetype? ( >=media-libs/freetype-2 )" S=${WORKDIR}/${MY_P} src_compile() { # No configure so have to hack the makefile. substs='s!^GD_INCL=../gd-1.8.4/$!GD_INCL=/usr/include/!;s!^GD_LD=../gd-1.8.4/$!GD_LD=/usr/lib/!;' substs=$substs's!^PREFIX_INC[ ]=[ ]/usr/local/include$!PREFIX_INC='${D}'/usr/include!;s!^PREFIX_LIB[ ]=[ ]/usr/local/lib$!PREFIX_LIB='${D}'/usr/lib!;' use jpeg || substs=$substs's/^JPEG_DEF/#JPEG_DEF/;s/^JPEG_LK/#JPEG_LK/;' use truetype || substs=$substs's/^FT_DEF/#FT_DEF/;s/^FT_LK/#FT_LK/;' sed -i "$substs" makefile || die emake libgdc.a || die } src_install() { mkdir -p ${D}/usr/include ${D}/usr/lib emake install || die dodoc README }
dev-python/pygdchart-2_alpha2
# Copyright 2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit distutils MY_P=${P/-/} MY_P=${MY_P/_/} DESCRIPTION="Python bindings to the GDChart library" HOMEPAGE="http://www.nullcube.com/software/pygdchart2.html" SRC_URI="http://www.nullcube.com/software/pygdchart2/${MY_P}.tar.gz" LICENSE="as-is" SLOT="0" KEYWORDS="~x86" IUSE="" # This package requires that gdchart have been installed with USE="jpeg truetype". DEPEND=">=dev-lang/python-2.2 >=media-libs/gdchart-0.11.4" S=${WORKDIR}/${MY_P} src_install() { distutils_src_install dohtml -r doc/* }
Since the newer version of pygdchart (pygdchart2) seems to not work with MoinMoin, here is an ebuild for the old version (pygdchart-0.6.1):
# Copyright 2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit python DESCRIPTION="Python bindings to the GDChart library" HOMEPAGE="http://www.nullcube.com/software/pygdchart.html" SRC_URI="http://www.nullcube.com/software/pygdchart/source/${P}.tar.gz" LICENSE="as-is" SLOT="0" KEYWORDS="~x86" IUSE="jpeg" python_version PYTHON_VERSION=${PYVER} DEPEND=">=dev-lang/python-2.2" src_install() { einfo Python-version: ${PYTHON_VERSION} sed -i "s!^PY_INCLUDE = -I/usr/local/include/python2.0!PY_INCLUDE = -I/usr/include/python${PYTHON_VERSION}!" Makefile || die sed -i "s!^CFLAGS = -Wall -fpic -O2!CFLAGS = -Wall -fpic ${CFLAGS}!" Makefile || die use jpeg || sed -i "s!^HAVE_JPEG = 1!HAVE_JPEG = 0!" Makefile || die emake || die "Make failed" insinto /usr/lib/python${PYTHON_VERSION}/site-packages insopts -m0755 doins ${S}/gdchart.so dodoc README CHANGES }
I tried it - it works! ( by DennisFreise (cat@final-frontier.ath.cx) )
---
commentary:
windows binaries here (for python 2.2)
or better look here
Here's a windows binary that fritzm built for Python 2.5: gdchart25.pyd. Rename it to gdchart.pyd and drop it in your Python25\DLLs dir.
chart.py gdchart.pyd test.py w.gif
just copy the file gdchart.pyd to your directory Python22\DLLs.
-- added 2002-08-08 16:25:34 by bootlab
But where does the chart.py file get copied? I tried the Python\lib directory without any luck. -- BernardFarrell 2024-11-27 20:52:37
Redhat 7.x users: Here is my install notes:
- Read the README file in the pygdchart source tar package.
Edit the Makefile, make sure the PY_INCLUDE is the correct directory where your python2.x head file is installed, mine is:
HAVE_JPEG = 1 PY_INCLUDE = -I/usr/local/include/python2.2 LIB_DIRS = -L/usr/local/lib -L/usr/lib GCC = gcc CFLAGS = -Wall -fpic -O2
- type "make" to build gdchart.so and copy to a directory in your $PYTHONPATH, I copyed it to /moin/lib/python2.2/site-packages/
That's all ---
Problems Installing PyGDChart on OpenBSD
Hi I�m very happy bout my first WikiWiki (oops, MoinMoin ) Installation (running 1.11 cvs tarball), but I just CAN�T install this module
I get this error when I want to compile stuff
# cd pygdchart-0.6.1 # make "Makefile", line 50: Missing dependency operator "Makefile", line 53: Need an operator Fatal errors encountered -- cannot continue
Lines in Makefile are these:
49 ifeq ($(HAVE_JPEG),1) 50 DEFS += -DHAVE_JPEG 51 LIBJPEG = -ljpeg 52 endif 53
Can someone plz help?
- Use gmake.
- You mean GNU make?
- Yes.
Better yet, make a port and submit it to OpenBSD
- You mean GNU make?
Problems Installing PyGDChart with newer gcc
With "gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)" / Ubuntu dapper it does not compile:
... make[1]: Entering directory `/home/cs/zope/tarballs/python/pygdchart-0.6.1/gdchart0.10.1dev' gcc -fpic -O -I../gd-1.8.4 -I. -DHAVE_JPEG -c gdc_pie.c gdc_pie.c: In function 'GDC_out_pie': gdc_pie.c:219: warning: incompatible implicit declaration of built-in function 'strlen' gdc_pie.c:547: warning: incompatible implicit declaration of built-in function 'strcpy' gdc_pie.c:553: warning: incompatible implicit declaration of built-in function 'strlen' gdc_pie.c:558: warning: incompatible implicit declaration of built-in function 'strlen' gdc_pie.c:594: error: label at end of compound statement gdc_pie.c:603: warning: pointer targets in passing argument 5 of 'gdImageString' differ in signedness make[1]: *** [gdc_pie.o] Error 1 make[1]: Leaving directory `/home/cs/zope/tarballs/python/pygdchart-0.6.1/gdchart0.10.1dev' make: *** [gdchart0.10.1dev/libgdchart.a] Error 2
the following patch "pygdchart-0.6.1-gcc4.patch" corrects it:
diff -ur pygdchart-0.6.1-original/gdchart0.10.1dev/gdc_pie.c pygdchart-0.6.1/gdchart0.10.1dev/gdc_pie.c --- pygdchart-0.6.1-original/gdchart0.10.1dev/gdc_pie.c 2002-02-13 14:34:53.000000000 +0100 +++ pygdchart-0.6.1/gdchart0.10.1dev/gdc_pie.c 2006-12-16 22:44:39.000000000 +0100 @@ -591,6 +591,7 @@ break; case GDCPIE_PCT_NONE: default: + break; } if( GDCPIE_percent_labels != GDCPIE_PCT_NONE ) diff -ur pygdchart-0.6.1-original/gdc_py.c pygdchart-0.6.1/gdc_py.c --- pygdchart-0.6.1-original/gdc_py.c 2002-02-25 11:36:07.000000000 +0100 +++ pygdchart-0.6.1/gdc_py.c 2006-12-16 22:47:32.000000000 +0100 @@ -1329,7 +1329,7 @@ } default: - + break; } // switch opt++; } // while