plotutils stable port information

Package: plotutils
Version: 2.6
Revision: 2
Description: Functions for exporting 2-D vector graphics
License: GPL
Homepage: http://www.gnu.org/software/plotutils
Maintainer: Monic Polynomial

Source: mirror:gnu:%n/%n-%v.tar.gz
Source-MD5: c08a424bd2438c80a786a7f4b5bb6a40

PatchFile: %n.patch
PatchFile-MD5: 348e2e342685f309b17e8cff87d637ed

GCC: 4.0
BuildDepends: <<
autoconf2.6,
automake1.11,
fink (>= 0.24.12-1),
fink-package-precedence,
libpng15,
libtool2,
x11-dev
<<
Depends: <<
%N-shlibs (= %v-%r),
libpng15-shlibs,
x11
<<

ConfigureParams: --enable-libplotter --disable-static --enable-dependency-tracking

CompileScript: <<
autoreconf -fi
./configure %c
make
fink-package-precedence --prohibit-bdep=%N-dev .
<<
InstallScript: make install DESTDIR=%d

DocFiles: README INSTALL.pkg COPYING KNOWN_BUGS PROBLEMS NEWS
InfoDocs: plotutils.info

SplitOff: <<
Package: %N-shlibs
Replaces: %N (<= 2.4.1-1)
Depends: x11-shlibs, libpng15-shlibs
Files: lib/libplot.*.dylib lib/libplotter.*.dylib
Shlibs: <<
%p/lib/libplotter.2.dylib 5.0.0 %n (>= 2.4.1-5)
%p/lib/libplot.2.dylib 5.0.0 %n (>= 2.4.1-5)
<<
DocFiles: README INSTALL.pkg COPYING KNOWN_BUGS PROBLEMS NEWS
<<

SplitOff2: <<
Package: %N-dev
BuildDependsOnly: True
Depends: %N-shlibs (= %v-%r)
Replaces: %N (<= 2.4.1-1)
Files: include lib
DocFiles: README INSTALL.pkg COPYING KNOWN_BUGS PROBLEMS NEWS
<<

DescDetail: Also contains command-line programs for plotting scientific data.

DescPort: <<
Included autotools are very old and do not know about recent
darwin and other modern tricks.

Make really *really* sure not to supercede fink's -I flags

Upgrade long-deprecated libpng jmpbuf. See:
http://lists.gnu.org/archive/html/bug-plotutils/2011-01/msg00000.html
http://llvm.org/bugs/show_bug.cgi?id=10338#c1

Regenerating autotools needs AC_PROG_CXX b/c have c++ sources
<<

plotutils stable port .patch

diff -Nurd -x'*~' plotutils-2.6.orig/configure.ac plotutils-2.6/configure.ac
--- plotutils-2.6.orig/configure.ac 2009-07-29 23:14:09.000000000 -0400
+++ plotutils-2.6/configure.ac 2011-07-10 12:39:00.000000000 -0400
@@ -331,7 +331,7 @@
fi])

# Do we build libplotter, the C++ library, and other C++ software?
-AC_ARG_ENABLE(libplotter, [ --enable-libplotter build the C++ Plotter class library and C++ software], echo enabling construction of the C++ class library; no_libplotter="no", no_libplotter="yes"; extralib="")
+AC_ARG_ENABLE(libplotter, [ --enable-libplotter build the C++ Plotter class library and C++ software], echo enabling construction of the C++ class library; [AC_PROG_CXX] no_libplotter="no", no_libplotter="yes"; extralib="")
AM_CONDITIONAL(NO_LIBPLOTTER, test "x$no_libplotter" = "xyes")

# Do we build and install a standalone version of the libxmi
diff -Nurd -x'*~' plotutils-2.6.orig/libplot/Makefile.am plotutils-2.6/libplot/Makefile.am
--- plotutils-2.6.orig/libplot/Makefile.am 2009-07-28 22:16:02.000000000 -0400
+++ plotutils-2.6/libplot/Makefile.am 2011-07-10 10:43:38.000000000 -0400
@@ -6,7 +6,7 @@

libplot_la_LDFLAGS = -version-info 4:4:2

-INCLUDES = $(X_CFLAGS) -I$(srcdir)/../include -DLIBPLOT
+INCLUDES = -I$(srcdir)/../include $(CPPFLAGS) $(X_CFLAGS) -DLIBPLOT

MISRC = mi_alloc.c mi_api.c mi_arc.c mi_canvas.c mi_fllarc.c mi_fllrct.c \
mi_fplycon.c mi_gc.c mi_ply.c mi_plycon.c mi_plygen.c mi_plypnt.c \
diff -Nurd -x'*~' plotutils-2.6.orig/libplot/z_write.c plotutils-2.6/libplot/z_write.c
--- plotutils-2.6.orig/libplot/z_write.c 2008-07-15 20:54:10.000000000 -0400
+++ plotutils-2.6/libplot/z_write.c 2011-07-10 12:03:45.000000000 -0400
@@ -164,7 +164,7 @@
}

/* cleanup after libpng errors (error handler does a longjmp) */
- if (setjmp (png_ptr->jmpbuf))
+ if (setjmp ((*png_set_longjmp_fn((png_ptr), (png_longjmp_ptr)longjmp, sizeof(jmp_buf)))))
{
png_destroy_write_struct (&png_ptr, (png_info **)NULL);
return -1;
@@ -444,7 +444,11 @@
#endif
}

+#if (PNG_LIBPNG_VER < 10500)
longjmp (png_ptr->jmpbuf, 1);
+#else
+ png_longjmp (png_ptr, 1);
+#endif
}

static void
@@ -515,7 +519,11 @@
#endif
}

+#if (PNG_LIBPNG_VER < 10500)
longjmp (png_ptr->jmpbuf, 1);
+#else
+ png_longjmp (png_ptr, 1);
+#endif
}

static void
diff -Nurd -x'*~' plotutils-2.6.orig/libplotter/Makefile.am plotutils-2.6/libplotter/Makefile.am
--- plotutils-2.6.orig/libplotter/Makefile.am 2009-07-28 22:16:18.000000000 -0400
+++ plotutils-2.6/libplotter/Makefile.am 2011-07-10 10:48:44.000000000 -0400
@@ -4,7 +4,7 @@

libplotter_la_LDFLAGS = -version-info 4:4:2

-INCLUDES = $(X_CFLAGS) -I$(srcdir)/../include -DLIBPLOT -DLIBPLOTTER
+INCLUDES = -I$(srcdir)/../include $(CPPFLAGS) $(X_CFLAGS) -DLIBPLOT -DLIBPLOTTER

MISRC = mi_alloc.cc mi_api.cc mi_arc.cc mi_canvas.cc mi_fllarc.cc \
mi_fllrct.cc mi_fplycon.cc mi_gc.cc mi_ply.cc mi_plycon.cc mi_plygen.cc \

plotutils _unstable_ port .patch