summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs/pgplot/files')
-rw-r--r--sci-libs/pgplot/files/pgplot-compile-setup.patch96
-rw-r--r--sci-libs/pgplot/files/pgplot-drivers.patch117
-rw-r--r--sci-libs/pgplot/files/pgplot-headers.patch109
-rw-r--r--sci-libs/pgplot/files/pgplot-libpng15.patch11
-rw-r--r--sci-libs/pgplot/files/pgplot-makemake.patch223
-rw-r--r--sci-libs/pgplot/files/pgplot-pgdisp.patch11
-rw-r--r--sci-libs/pgplot/files/pgplot-tk86.patch47
7 files changed, 614 insertions, 0 deletions
diff --git a/sci-libs/pgplot/files/pgplot-compile-setup.patch b/sci-libs/pgplot/files/pgplot-compile-setup.patch
new file mode 100644
index 000000000000..f1709c333f4f
--- /dev/null
+++ b/sci-libs/pgplot/files/pgplot-compile-setup.patch
@@ -0,0 +1,96 @@
+--- sys_linux/g77_gcc.conf.orig 1999-07-05 19:10:33.000000000 +0100
++++ sys_linux/g77_gcc.conf 2008-10-29 18:30:33.000000000 +0000
+@@ -1,4 +1,4 @@
+-# The GNU g77 FORTRAN compiler and Gnu gcc C compiler on an elf-system.
++# The GNU gfortran FORTRAN compiler and Gnu gcc C compiler on an elf-system.
+ #-----------------------------------------------------------------------
+
+ # Optional: Needed by XWDRIV (/xwindow and /xserve) and
+@@ -23,7 +23,7 @@
+ # The arguments needed by the C compiler to locate Tcl, Tk and
+ # X-window include files.
+
+- TK_INCL="-I/usr/include $XINCL"
++ TK_INCL="$XINCL"
+
+ # Optional: Needed by RVDRIV (/xrv).
+ # The arguments needed by the C compiler to locate Rivet, Tcl, Tk and
+@@ -34,13 +34,13 @@
+ # Mandatory.
+ # The FORTRAN compiler to use.
+
+- FCOMPL="g77"
++ FCOMPL="gfortran"
+
+ # Mandatory.
+ # The FORTRAN compiler flags to use when compiling the pgplot library.
+ # (NB. makemake prepends -c to $FFLAGC where needed)
+
+- FFLAGC="-u -Wall -fPIC -O"
++ FFLAGC="-u -Wall"
+
+ # Mandatory.
+ # The FORTRAN compiler flags to use when compiling fortran demo programs.
+@@ -57,12 +57,12 @@
+ # Mandatory.
+ # The C compiler flags to use when compiling the pgplot library.
+
+- CFLAGC="-Wall -fPIC -DPG_PPU -O"
++ CFLAGC="-Wall -DPG_PPU"
+
+ # Mandatory.
+ # The C compiler flags to use when compiling C demo programs.
+
+- CFLAGD="-Wall -O"
++ CFLAGD="-Wall"
+
+ # Optional: Only needed if the cpgplot library is to be compiled.
+ # The flags to use when running pgbind to create the C pgplot wrapper
+@@ -74,7 +74,7 @@
+ # The library-specification flags to use when linking normal pgplot
+ # demo programs.
+
+- LIBS="-L/usr/X11R6/lib -lX11"
++ LIBS="-lX11"
+
+ # Optional: Needed by XMDRIV (/xmotif).
+ # The library-specification flags to use when linking motif
+@@ -92,7 +92,7 @@
+ # The library-specification flags to use when linking Tk demo programs.
+ # Note that you may need to append version numbers to -ltk and -ltcl.
+
+- TK_LIBS="-L/usr/lib -ltk -ltcl $LIBS -ldl"
++ TK_LIBS="-ltk -ltcl $LIBS -ldl"
+
+ # Mandatory.
+ # On systems that have a ranlib utility, put "ranlib" here. On other
+@@ -103,12 +103,18 @@
+ # Optional: Needed on systems that support shared libraries.
+ # The name to give the shared pgplot library.
+
+- SHARED_LIB="libpgplot.so"
++ MV=5
++ SHARED_LIB="libpgplot.so.$MV"
++ SHARED_CLIB="libcpgplot.so.$MV"
+
+ # Optional: Needed if SHARED_LIB is set.
+ # How to create a shared library from a trailing list of object files.
+
+- SHARED_LD="gcc -shared -o $SHARED_LIB"
++ SHARED_LD_PGPLOT_OPTS="$LDFLAGS -Wl,-soname,$SHARED_LIB"
++
++ SHARED_LD_CPGPLOT_OPTS="$LDFLAGS -Wl,-soname,$SHARED_CLIB"
++
++ SHARED_LD="$FCOMPL -shared"
+
+ # Optional:
+ # On systems such as Solaris 2.x, that allow specification of the
+@@ -117,7 +123,7 @@
+ # library-specification flags used to specify these libraries to
+ # $SHARED_LD
+
+- SHARED_LIB_LIBS=""
++ SHARED_LIB_LIBS="-lX11 -lXt -lpng"
+
+ # Optional:
+ # Compiler name used on Next systems to compile objective-C files.
diff --git a/sci-libs/pgplot/files/pgplot-drivers.patch b/sci-libs/pgplot/files/pgplot-drivers.patch
new file mode 100644
index 000000000000..8201bdfaeb70
--- /dev/null
+++ b/sci-libs/pgplot/files/pgplot-drivers.patch
@@ -0,0 +1,117 @@
+--- drivers.list.orig 2007-03-08 15:56:20.000000000 +0000
++++ drivers.list 2007-03-08 15:59:21.000000000 +0000
+@@ -6,71 +6,71 @@
+ !------------------------------------------------------------------------------
+ ! File Code Description Restrictions
+ ! BCDRIV 0 /BCANON Canon Laser printer (bitmap version), landscape
+-! CADRIV 0 /CANON Canon Laser printer, LBP-8/A2, landscape
++ CADRIV 0 /CANON Canon Laser printer, LBP-8/A2, landscape
+ ! CCDRIV 0 /CCP DEC LJ250 Color Companion printer
+-! CGDRIV 1 /CGM CGM metafile, indexed colour selection C
+-! CGDRIV 2 /CGMD CGM metafile, direct colour selection C
+-! CWDRIV 0 /CW6320 Gould/Bryans Colourwriter 6320 pen plotter Std F77
++ CGDRIV 1 /CGM CGM metafile, indexed colour selection C
++ CGDRIV 2 /CGMD CGM metafile, direct colour selection C
++ CWDRIV 0 /CW6320 Gould/Bryans Colourwriter 6320 pen plotter Std F77
+ ! EPDRIV 0 /EPSON Epson FX100 dot matrix printer
+ ! EXDRIV 1 /EXCL Talaris/EXCL printers, landscape
+ ! EXDRIV 2 /EXCL Talaris/EXCL printers, portrait
+ ! GCDRIV 0 /GENICOM Genicom 4410 dot-matrix printer, landscape
+ ! Caution: use of GIDRIV may require a license from Unisys:
+-! GIDRIV 1 /GIF GIF-format file, landscape
+-! GIDRIV 2 /VGIF GIF-format file, portrait
+-! GLDRIV 1 /HPGL Hewlett-Packard HP-GL plotters, landscape Std F77
+-! GLDRIV 2 /VHPGL Hewlett-Packard HP-GL plotters, portrait Std F77
++ GIDRIV 1 /GIF GIF-format file, landscape
++ GIDRIV 2 /VGIF GIF-format file, portrait
++ GLDRIV 1 /HPGL Hewlett-Packard HP-GL plotters, landscape Std F77
++ GLDRIV 2 /VHPGL Hewlett-Packard HP-GL plotters, portrait Std F77
+ ! GODRIV 0 /GOC GOC Sigma T5670 terminal VMS
+ ! GVDRIV 0 /GVENICOM Genicom 4410 dot-matrix printer, portrait
+-! HGDRIV 0 /HPGL2 Hewlett-Packard graphics language
+-! HIDRIV 0 /HIDMP Houston Instruments HIDMP pen plotter
++ HGDRIV 0 /HPGL2 Hewlett-Packard graphics language
++ HIDRIV 0 /HIDMP Houston Instruments HIDMP pen plotter
+ ! HJDRIV 0 /HJ Hewlett-Packard Desk/Laserjet printer
+-! HPDRIV 0 /HP7221 Hewlett-Packard HP7221 pen plotter Std F77
++ HPDRIV 0 /HP7221 Hewlett-Packard HP7221 pen plotter Std F77
+ ! LADRIV 0 /LA50 Dec LA50 and other sixel printers
+ ! LJDRIV 0 /LJ Hewlett-Packard LaserJet printers VMS
+-! LSDRIV 1 /LIPS2 Canon LaserShot printer (landscape)
+-! LSDRIV 2 /VLIPS2 Canon LaserShot printer (portrait)
++ LSDRIV 1 /LIPS2 Canon LaserShot printer (landscape)
++ LSDRIV 2 /VLIPS2 Canon LaserShot printer (portrait)
+ ! LNDRIV 0 /LN03 Dec LN03-PLUS Laser printer (landscape) VMS
+ ! LVDRIV 0 /LVN03 Dec LN03-PLUS Laser printer (portrait) VMS
+-! LXDRIV 0 /LATEX LaTeX picture environment
++ LXDRIV 0 /LATEX LaTeX picture environment
+ ! MFDRIV 0 /FILE PGPLOT graphics metafile
+ ! NEDRIV 0 /NEXT Computers running NeXTstep operating system
+ NUDRIV 0 /NULL Null device (no output) Std F77
+-! PGDRIV 0 /PGMF PGPLOT metafile (new format, experimental) Std F77
+-! PNDRIV 1 /PNG Portable Network Graphics file C
+-! PNDRIV 2 /TPNG Portable Network Graphics file - transparent background C
+-! PPDRIV 1 /PPM Portable Pixel Map file, landscape
+-! PPDRIV 2 /VPPM Portable PIxel Map file, portrait
+-! PSDRIV 1 /PS PostScript printers, monochrome, landscape Std F77
+-! PSDRIV 2 /VPS Postscript printers, monochrome, portrait Std F77
+-! PSDRIV 3 /CPS PostScript printers, color, landscape Std F77
+-! PSDRIV 4 /VCPS PostScript printers, color, portrait Std F77
++ PGDRIV 0 /PGMF PGPLOT metafile (new format, experimental) Std F77
++ PNDRIV 1 /PNG Portable Network Graphics file C
++ PNDRIV 2 /TPNG Portable Network Graphics file - transparent background C
++ PPDRIV 1 /PPM Portable Pixel Map file, landscape
++ PPDRIV 2 /VPPM Portable PIxel Map file, portrait
++ PSDRIV 1 /PS PostScript printers, monochrome, landscape Std F77
++ PSDRIV 2 /VPS Postscript printers, monochrome, portrait Std F77
++ PSDRIV 3 /CPS PostScript printers, color, landscape Std F77
++ PSDRIV 4 /VCPS PostScript printers, color, portrait Std F77
+ ! PXDRIV 0 /PRINTRONI Printronix P300 or P600 dot-matrix printer
+-! QMDRIV 1 /QMS QUIC devices (QMS and Talaris), landscape Std F77
+-! QMDRIV 2 /VQMS QUIC devices (QMS and Talaris), portrait Std F77
++ QMDRIV 1 /QMS QUIC devices (QMS and Talaris), landscape Std F77
++ QMDRIV 2 /VQMS QUIC devices (QMS and Talaris), portrait Std F77
+ ! TFDRIV 0 /TFILE Tektronix-format disk file VMS
+ ! TODRIV 0 /TOSHIBA Toshiba "3-in-one" printer, model P351
+-! TTDRIV 1 /TEK4010 Tektronix 4006/4010 storage-tube terminal Std F77
+-! TTDRIV 2 /GF GraphOn terminal Std F77
+-! TTDRIV 3 /RETRO RetroGraphics terminal Std F77
+-! TTDRIV 4 /GTERM GTERM Tektronix terminal emulator Std F77
+-! TTDRIV 5 /XTERM XTERM Tektronix terminal emulator Std F77
+-! TTDRIV 6 /ZSTEM ZSTEM terminal emulator Std F77
+-! TTDRIV 7 /V603 Visual 603 terminal Std F77
++ TTDRIV 1 /TEK4010 Tektronix 4006/4010 storage-tube terminal Std F77
++ TTDRIV 2 /GF GraphOn terminal Std F77
++ TTDRIV 3 /RETRO RetroGraphics terminal Std F77
++ TTDRIV 4 /GTERM GTERM Tektronix terminal emulator Std F77
++ TTDRIV 5 /XTERM XTERM Tektronix terminal emulator Std F77
++ TTDRIV 6 /ZSTEM ZSTEM terminal emulator Std F77
++ TTDRIV 7 /V603 Visual 603 terminal Std F77
+ ! TTDRIV 8 /KRM3 Kermit 3 on IBM-PC Std F77
+-! TTDRIV 9 /TK4100 Tektronix 4100-series terminals Std F77
+-! TTDRIV 10 /VMAC Macintosh VersaTerm-PRO Tektronix-4105 emulator Std F77
++ TTDRIV 9 /TK4100 Tektronix 4100-series terminals Std F77
++ TTDRIV 10 /VMAC Macintosh VersaTerm-PRO Tektronix-4105 emulator Std F77
+ ! TXDRIV 0 /TX TeX PK Font Output files
+-! VADRIV 0 /VCANON Canon Laser printer, LBP-8/A2, portrait
+-! VBDRIV 0 /VBCANON Canon Laser printer (bitmap version), portrait
+-! VTDRIV 0 /VT125 Dec Regis terminals (VT125 etc.) Std F77
+-! WDDRIV 1 /WD X Window dump file, landscape
+-! WDDRIV 2 /VWD X Window dump file, portrait
++ VADRIV 0 /VCANON Canon Laser printer, LBP-8/A2, portrait
++! VBDRIV 0 /VBCANON Canon Laser printer (bitmap version), portrait
++ VTDRIV 0 /VT125 Dec Regis terminals (VT125 etc.) Std F77
++ WDDRIV 1 /WD X Window dump file, landscape
++ WDDRIV 2 /VWD X Window dump file, portrait
+ ! WSDRIV 0 /WS VAX workstations running VWS software VMS
+-! X2DRIV 0 /XDISP PGDISP or FIGDISP server for X workstations C
+-! XWDRIV 1 /XWINDOW Workstations running X Window System C
+-! XWDRIV 2 /XSERVE Persistent window on X Window System C
+-! ZEDRIV 0 /ZETA Zeta 8 Digital Plotter
++ X2DRIV 0 /XDISP PGDISP or FIGDISP server for X workstations C
++ XWDRIV 1 /XWINDOW Workstations running X Window System C
++ XWDRIV 2 /XSERVE Persistent window on X Window System C
++! ZEDRIV 0 /ZETA Zeta 8 Digital Plotter
+ !
+ ! The following drivers can only be used in PGPLOT installations on MS-DOS
+ ! systems with appropriate hardware and software. Do not select these
diff --git a/sci-libs/pgplot/files/pgplot-headers.patch b/sci-libs/pgplot/files/pgplot-headers.patch
new file mode 100644
index 000000000000..7bde726a041a
--- /dev/null
+++ b/sci-libs/pgplot/files/pgplot-headers.patch
@@ -0,0 +1,109 @@
+--- ./sys/grtermio.c.orig 2008-10-29 17:42:48.000000000 +0000
++++ ./sys/grtermio.c 2008-10-29 19:54:43.000000000 +0000
+@@ -7,6 +7,10 @@
+
+ #include <stdio.h>
+ #include <termios.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <string.h>
++#include <fcntl.h>
+
+ #ifdef PG_PPU
+ #define GROTER groter_
+--- ./sys/grfileio.c.orig 2008-10-29 15:10:02.000000000 +0000
++++ ./sys/grfileio.c 2008-10-29 17:56:50.000000000 +0000
+@@ -17,7 +17,9 @@
+ */
+
+ #include <stdlib.h>
++#include <unistd.h>
+ #include <stdio.h>
++#include <string.h>
+ #include <sys/types.h>
+ #include <fcntl.h>
+
+--- ./drivers/figdisp_comm.c.orig 2008-10-29 15:09:15.000000000 +0000
++++ ./drivers/figdisp_comm.c 2008-10-29 17:54:08.000000000 +0000
+@@ -17,6 +17,8 @@
+
+ /* The system include files */
+ #include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
+
+ /* Get ntohs prototype or macro */
+
+--- ./pgdispd/resdb.c.orig 2008-10-29 18:22:41.000000000 +0000
++++ ./pgdispd/resdb.c 2008-10-29 20:10:22.000000000 +0000
+@@ -47,6 +47,8 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
++
+ #ifndef VMS
+ #include <pwd.h>
+ #endif
+@@ -1042,7 +1044,6 @@
+ int uid;
+
+ extern char *getenv();
+- extern int getuid();
+ extern struct passwd *getpwuid();
+ struct passwd *pw;
+ register char *ptr;
+--- ./pgdispd/proccom.c.orig 2008-10-29 15:03:34.000000000 +0000
++++ ./pgdispd/proccom.c 2008-10-29 18:15:48.000000000 +0000
+@@ -90,6 +90,7 @@
+
+ /* The system include files */
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <netinet/in.h>
+
+@@ -163,7 +164,6 @@
+ void drawline(); /* draw a line in the bitmap window */
+ Pixmap XCreatePixmap();
+
+- char *malloc();
+
+ if (!len & savedshorts)
+ { /* an incomplete command was sent! */
+--- ./pgdispd/getvisuals.c.orig 2008-10-29 17:59:37.000000000 +0000
++++ ./pgdispd/getvisuals.c 2008-10-29 18:00:18.000000000 +0000
+@@ -30,6 +30,7 @@
+ #include "messages.h"
+
+ #include <stdio.h>
++#include <stdlib.h>
+
+ #define MAX_DEPTH 24 /* the maximum visual depth to use */
+
+--- ./pgdispd/figcurs.c.orig 2008-10-29 17:58:22.000000000 +0000
++++ ./pgdispd/figcurs.c 2008-10-29 18:14:02.000000000 +0000
+@@ -19,6 +19,7 @@
+
+ /* The standard include files */
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <netinet/in.h>
+
+@@ -113,7 +114,6 @@
+ void getbuttonval();
+ int getkeyval();
+
+- char *malloc();
+
+ if (event.type == ButtonPress) getbuttonval(event.xbutton.button, &val);
+ else if (!getkeyval(event, &val)) return(1);
+@@ -167,7 +167,6 @@
+ void getbuttonval();
+ int getkeyval();
+
+- char *malloc();
+
+ if (event.type == ButtonPress) getbuttonval(event.xbutton.button, &val);
+ else if (!getkeyval(event, &val)) return(1);
diff --git a/sci-libs/pgplot/files/pgplot-libpng15.patch b/sci-libs/pgplot/files/pgplot-libpng15.patch
new file mode 100644
index 000000000000..b1064cb4da12
--- /dev/null
+++ b/sci-libs/pgplot/files/pgplot-libpng15.patch
@@ -0,0 +1,11 @@
+--- drivers/pndriv.c
++++ drivers/pndriv.c
+@@ -222,7 +222,7 @@
+ return;
+ }
+
+- if (setjmp(png_ptr->jmpbuf)) { /* not really sure what I'm doing here... */
++ if (setjmp(png_jmpbuf(png_ptr))) {
+ fprintf(stderr,"%s: error in libpng while writing file %s, plotting disabled\n", png_ident, filename);
+ png_destroy_write_struct(&png_ptr,&info_ptr);
+ dev->error = true;
diff --git a/sci-libs/pgplot/files/pgplot-makemake.patch b/sci-libs/pgplot/files/pgplot-makemake.patch
new file mode 100644
index 000000000000..6cc3c637b6ef
--- /dev/null
+++ b/sci-libs/pgplot/files/pgplot-makemake.patch
@@ -0,0 +1,223 @@
+--- makemake.orig 2012-07-05 14:08:30.210815190 -0700
++++ makemake 2012-07-05 14:26:28.353381906 -0700
+@@ -73,7 +73,7 @@
+
+ # List the default make targets.
+
+-DEFAULT_TARGETS="lib grfont.dat prog pgplot.doc"
++DEFAULT_TARGETS="lib grfont.dat pgplot.doc"
+
+ # Get the configuration variables.
+
+@@ -199,18 +199,18 @@
+ fi
+
+ if (echo $DRIV_LIST | grep -s xmdriv 2>&1 1>/dev/null); then
+- DEFAULT_TARGETS="$DEFAULT_TARGETS libXmPgplot.a pgmdemo"
+- INSTALL_LIST="$INSTALL_LIST libXmPgplot.a XmPgplot.h"
++ DEFAULT_TARGETS="$DEFAULT_TARGETS libXmPgplot.a"
++ INSTALL_LIST="$INSTALL_LIST libXmPgplot.a XmPgplot.h"
+ fi
+
+ if (echo $DRIV_LIST | grep -s xadriv 2>&1 1>/dev/null); then
+- DEFAULT_TARGETS="$DEFAULT_TARGETS libXaPgplot.a pgawdemo"
++ DEFAULT_TARGETS="$DEFAULT_TARGETS libXaPgplot.a"
+ INSTALL_LIST="$INSTALL_LIST libXaPgplot.a XaPgplot.h"
+ fi
+
+ if (echo $DRIV_LIST | grep -s tkdriv 2>&1 1>/dev/null); then
+- DEFAULT_TARGETS="$DEFAULT_TARGETS libtkpgplot.a pgtkdemo pgtkdemo.tcl"
+- INSTALL_LIST="$INSTALL_LIST libtkpgplot.a tkpgplot.h"
++ DEFAULT_TARGETS="$DEFAULT_TARGETS libtkpgplot.so"
++ INSTALL_LIST="$INSTALL_LIST libtkpgplot.a tkpgplot.h"
+ fi
+
+ if (echo $DRIV_LIST | grep -s rvdriv 2>&1 1>/dev/null); then
+@@ -622,7 +622,7 @@
+ # Fortran compiler and compilation flags
+ #
+ FCOMPL=$FCOMPL
+-FFLAGC=$FFLAGC
++FFLAGC=$FFLAGC \$(FFLAGS)
+ FFLAGD=$FFLAGD
+ #
+ # C compiler and compilation flags
+@@ -633,7 +633,7 @@
+ TK_INCL=$TK_INCL
+ RV_INCL=$RV_INCL
+ CCOMPL=$CCOMPL
+-CFLAGC=$CFLAGC -I.
++CFLAGC=$CFLAGC -I. \$(CFLAGS)
+ CFLAGD=$CFLAGD
+ MCOMPL=$MCOMPL
+ MFLAGC=$MFLAGC
+@@ -657,7 +657,10 @@
+ # Shared library creation.
+ #
+ SHARED_LIB=$SHARED_LIB
++SHARED_CLIB=$SHARED_CLIB
+ SHARED_LD=$SHARED_LD
++SHARED_LD_PGPLOT_OPTS=$SHARED_LD_PGPLOT_OPTS
++SHARED_LD_CPGPLOT_OPTS=$SHARED_LD_CPGPLOT_OPTS
+ #
+ # The libraries that the shared PGPLOT library depends upon.
+ # This is for systems that allow one to specify what libraries
+@@ -806,7 +809,8 @@
+ # libraries.
+ #-----------------------------------------------------------------------
+
+-lib : libpgplot.a $(SHARED_LIB)
++#lib : libpgplot.a $(SHARED_LIB)
++lib : libpgplot.a
+
+ libpgplot.a : $(PG_ROUTINES) $(PG_NON_STANDARD) $(GR_ROUTINES) \
+ $(DISPATCH_ROUTINE) $(DRIVERS) $(SYSTEM_ROUTINES)
+@@ -816,6 +820,16 @@
+ $(DRIVERS) $(SYSTEM_ROUTINES) | sort | uniq`
+ $(RANLIB) libpgplot.a
+
++#shared: $(PG_ROUTINES) $(PG_NON_STANDARD) $(GR_ROUTINES) \
++# $(DISPATCH_ROUTINE) $(DRIVERS) $(SYSTEM_ROUTINES)
++# $(SHARED_LD)
++
++shared: $(PG_ROUTINES) $(PG_NON_STANDARD) grfont.dat \
++ $(GR_ROUTINES) $(DISPATCH_ROUTINE) $(DRIVERS) $(SYSTEM_ROUTINES)
++ $(SHARED_LD) $(SHARED_LD_PGPLOT_OPTS) `ls $(PG_ROUTINES) \
++ $(PG_NON_STANDARD) $(GR_ROUTINES) $(DISPATCH_ROUTINE) \
++ $(DRIVERS) $(SYSTEM_ROUTINES) | sort | uniq` $(SHARED_LIB_LIBS) -o $(SHARED_LIB)
++ ln -s $(SHARED_LIB) libpgplot.so
+ EOD
+
+ # Emit the shared library dependency if requested.
+@@ -824,7 +838,7 @@
+ cat >> makefile << \EOD
+ $(SHARED_LIB): $(PG_ROUTINES) $(PG_NON_STANDARD) \
+ $(GR_ROUTINES) $(DISPATCH_ROUTINE) $(DRIVERS) $(SYSTEM_ROUTINES)
+- $(SHARED_LD) `ls $(PG_ROUTINES) \
++ $(SHARED_LD) $(SHARED_LD_PGPLOT_OPTS) `ls $(PG_ROUTINES) \
+ $(PG_NON_STANDARD) $(GR_ROUTINES) $(DISPATCH_ROUTINE) \
+ $(DRIVERS) $(SYSTEM_ROUTINES) | sort | uniq` $(SHARED_LIB_LIBS)
+ EOD
+@@ -857,7 +871,7 @@
+
+ for file in $DEMOS; do
+ echo "${file}: \$(DEMDIR)/${file}.f $EXTRA_DEPENDENCY"
+-echo " \$(FCOMPL) \$(FFLAGD) -o ${file} \$(DEMDIR)/${file}.f \$(PGPLOT_LIB) \$(LIBS)"
++echo " \$(FCOMPL) \$(FFLAGD) \$(DEMDIR)/${file}.f \$(PGPLOT_LIB) \$(LIBS) -o ${file}"
+ done >> makefile
+
+ cat >> makefile << \EOD
+@@ -921,13 +935,13 @@
+ # Target "pgxwin_server" is the server program for the XW driver
+ #-----------------------------------------------------------------------
+ pgxwin_server: $(DRVDIR)/pgxwin_server.c
+- $(CCOMPL) $(CFLAGC) $(XINCL) -o pgxwin_server $(DRVDIR)/pgxwin_server.c $(LIBS)
++ $(CCOMPL) $(CFLAGC) $(LDFLAGS) $(XINCL) $(DRVDIR)/pgxwin_server.c $(LIBS) -o pgxwin_server
+
+ #-----------------------------------------------------------------------
+ # Target "pgdisp" is the pgdisp server program for /XDISP driver
+ #-----------------------------------------------------------------------
+ pgdisp: $(PGDISP_ROUTINES)
+- $(CCOMPL) $(CFLAGC) -o pgdisp $(PGDISP_ROUTINES) $(LIBS)
++ $(CCOMPL) $(CFLAGC) $(LDFLAGS) $(PGDISP_ROUTINES) $(LIBS) -o pgdisp
+
+ #-----------------------------------------------------------------------
+ # Target "libxmpgplot.a" contains the Motif widget driver.
+@@ -937,6 +951,10 @@
+ ar ru libXmPgplot.a XmPgplot.o
+ $(RANLIB) libXmPgplot.a
+
++libXmPgplot.so: XmPgplot.h XmPgplot.o
++ $(SHARED_LD) $(LDFLAGS) -Wl,-soname,libXmPgplot.so.5 XmPgplot.o -L. -lcpgplot $(MOTIF_LIBS) -o libXmPgplot.so.5
++ ln -s libXmPgplot.so.5 libXmPgplot.so
++
+ XmPgplot.h: $(XMDIR)/XmPgplot.h
+ cp $(XMDIR)/XmPgplot.h XmPgplot.h
+
+@@ -965,6 +983,10 @@
+ ar ru libtkpgplot.a tkpgplot.o
+ $(RANLIB) libtkpgplot.a
+
++libtkpgplot.so: tkpgplot.h tkpgplot.o
++ $(SHARED_LD) $(LDFLAGS) -Wl,-soname,libtkpgplot.so.5 tkpgplot.o -L. -lcpgplot $(TK_LIBS) -o libtkpgplot.so.5
++ ln -s libtkpgplot.so.5 libtkpgplot.so
++
+ tkpgplot.h: $(TKDIR)/tkpgplot.h
+ cp $(TKDIR)/tkpgplot.h tkpgplot.h
+
+@@ -983,7 +1005,7 @@
+ cp $(TKDIR)/rvpgplot.h rvpgplot.h
+
+ rvpgplot.o: $(DRVDIR)/pgxwin.h rvpgplot.h $(TKDIR)/tkpgplot.c
+- $(CCOMPL) -o $@ -c -DUSE_RIVET $(CFLAGC) -I$(DRVDIR) -I$(TKDIR) $(RV_INCL) $(TKDIR)/tkpgplot.c
++ $(CCOMPL) -c -DUSE_RIVET $(CFLAGC) -I$(DRVDIR) -I$(TKDIR) $(RV_INCL) $(TKDIR)/tkpgplot.c -o $@
+
+ #-----------------------------------------------------------------------
+ # Target "install" is required for Figaro.
+@@ -1025,12 +1047,12 @@
+ grivas.o : $(DRVDIR)/gadef.h
+ grtv00.o : $(DRVDIR)/imdef.h
+ pgxwin.o : $(DRVDIR)/pgxwin.h
+-pndriv.o : ./png.h ./pngconf.h ./zlib.h ./zconf.h
++pndriv.o : /usr/include/png.h /usr/include/pngconf.h /usr/include/zlib.h /usr/include/zconf.h
+
+ x2driv.o figdisp_comm.o: $(DRVDIR)/commands.h
+
+
+-cpg: libcpgplot.a cpgplot.h cpgdemo
++cpg: cpgplot.h libcpgplot.a
+ @echo ' '
+ @echo '*** Finished compilation of the C PGPLOT wrapper library ***'
+ @echo ' '
+@@ -1039,24 +1061,36 @@
+ @echo 'will be needed.'
+ @echo ' '
+
++cpg-shared: libcpgplot.so
++
+ pgbind: $(SRC)/cpg/pgbind.c
+ $(CCOMPL) $(CFLAGC) $(SRC)/cpg/pgbind.c -o pgbind
+
+-libcpgplot.a cpgplot.h: $(PG_SOURCE) pgbind
++cpgplot.h: $(PG_SOURCE) pgbind
+ ./pgbind $(PGBIND_FLAGS) -h -w $(PG_SOURCE)
++
++libcpgplot.a: cpgplot.h
+ $(CCOMPL) -c $(CFLAGC) cpg*.c
+ rm -f cpg*.c
+ ar ru libcpgplot.a cpg*.o
+ $(RANLIB) libcpgplot.a
+ rm -f cpg*.o
+
++libcpgplot.so: cpgplot.h $(PG_SOURCE) pgbind
++ ./pgbind $(PGBIND_FLAGS) -w $(PG_SOURCE)
++ $(CCOMPL) -c $(CFLAGC) cpg*.c
++ rm -f cpg*.c
++ $(SHARED_LD) $(SHARED_LD_CPGPLOT_OPTS) cpg*.o -L. -lpgplot $(SHARED_LIB_LIBS) -o $(SHARED_CLIB)
++ ln -s $(SHARED_CLIB) libcpgplot.so
++ rm -f cpg*.o
++
+ cpgdemo: cpgplot.h $(SRC)/cpg/cpgdemo.c libcpgplot.a
+ $(CCOMPL) $(CFLAGD) -c -I. $(SRC)/cpg/cpgdemo.c
+- $(FCOMPL) -o cpgdemo cpgdemo.o $(CPGPLOT_LIB) $(LIBS)
++ $(FCOMPL) cpgdemo.o $(CPGPLOT_LIB) $(LIBS) -o cpgdemo
+ rm -f cpgdemo.o
+
+-pgmdemo: pgmdemo.o libXmPgplot.a
+- $(FCOMPL) -o pgmdemo pgmdemo.o -L`pwd` -lXmPgplot $(CPGPLOT_LIB) $(MOTIF_LIBS)
++pgmdemo: pgmdemo.o libXmPgplot.so
++ $(FCOMPL) pgmdemo.o -L`pwd` -lXmPgplot $(CPGPLOT_LIB) $(MOTIF_LIBS) -o pgmdemo
+
+ pgmdemo.o: $(XMDIR)/pgmdemo.c XmPgplot.h libcpgplot.a cpgplot.h
+ $(CCOMPL) $(CFLAGD) -c -I`pwd` $(MOTIF_INCL) $(XMDIR)/pgmdemo.c
+@@ -1067,8 +1101,8 @@
+ pgawdemo.o: $(XADIR)/pgawdemo.c XaPgplot.h libcpgplot.a cpgplot.h
+ $(CCOMPL) $(CFLAGD) -c -I`pwd` $(ATHENA_INCL) $(XADIR)/pgawdemo.c
+
+-pgtkdemo: pgtkdemo.o libtkpgplot.a
+- $(FCOMPL) -o pgtkdemo pgtkdemo.o -L`pwd` -ltkpgplot $(CPGPLOT_LIB) $(TK_LIBS)
++pgtkdemo: pgtkdemo.o libtkpgplot.so
++ $(FCOMPL) pgtkdemo.o -L`pwd` -ltkpgplot $(CPGPLOT_LIB) $(TK_LIBS) -o pgtkdemo
+
+ pgtkdemo.tcl: $(TKDIR)/pgtkdemo.tcl
+ cp $(TKDIR)/pgtkdemo.tcl pgtkdemo.tcl
diff --git a/sci-libs/pgplot/files/pgplot-pgdisp.patch b/sci-libs/pgplot/files/pgplot-pgdisp.patch
new file mode 100644
index 000000000000..9828a3bdbcbd
--- /dev/null
+++ b/sci-libs/pgplot/files/pgplot-pgdisp.patch
@@ -0,0 +1,11 @@
+--- pgdispd/proccom.c 2007-03-08 14:47:15.000000000 +0000
++++ pgdispd/proccom.c.new 2007-03-08 15:34:36.000000000 +0000
+@@ -163,8 +163,6 @@
+ void drawline(); /* draw a line in the bitmap window */
+ Pixmap XCreatePixmap();
+
+- char *malloc();
+-
+ if (!len & savedshorts)
+ { /* an incomplete command was sent! */
+ savedshorts=0;
diff --git a/sci-libs/pgplot/files/pgplot-tk86.patch b/sci-libs/pgplot/files/pgplot-tk86.patch
new file mode 100644
index 000000000000..bc0023eb90d2
--- /dev/null
+++ b/sci-libs/pgplot/files/pgplot-tk86.patch
@@ -0,0 +1,47 @@
+--- drivers/xtk/tkpgplot.c.ORIG 2000-12-13 03:16:28.000000000 +0100
++++ drivers/xtk/tkpgplot.c 2013-01-15 11:02:27.221231471 +0100
+@@ -417,7 +417,7 @@
+ /*
+ * If Tk_Init() hasn't been called, then there won't be a main window
+ * yet. In such cases, Tk_MainWindow() places a suitable error message
+- * in interp->result.
++ * in Tcl_GetStringResult(interp).
+ */
+ if(!main_w)
+ return TCL_ERROR;
+@@ -2136,7 +2136,7 @@
+ tkpg->border = bd;
+ tkpg_draw_3d_border(tkpg);
+ } else {
+- fprintf(stderr, "Tk_Get3DBorder failed: %s\n", tkpg->interp->result);
++ fprintf(stderr, "Tk_Get3DBorder failed: %s\n", Tcl_GetStringResult(tkpg->interp));
+ };
+ }
+
+@@ -2261,7 +2261,7 @@
+ * argv char ** The array of 'argc' configuration arguments.
+ * Output:
+ * return int TCL_ERROR and the context of the error
+- * is recorded in interp->result.
++ * is recorded in Tcl_GetStringResult(result).
+ */
+ static int tkpg_scrollbar_error(TkPgplot *tkpg, Tcl_Interp *interp,
+ char *widget, char *view, int argc,
+@@ -2586,7 +2586,7 @@
+ * Output:
+ * return Tk_Window The top-level window of the path, or NULL if
+ * it doesn't exist. In the latter case an error
+- * message will have been appended to interp->result.
++ * message will have been appended to Tcl_GetStringResult(interp).
+ */
+ static Tk_Window tkpg_toplevel_of_path(Tcl_Interp *interp, Tk_Window main_w,
+ char *path)
+@@ -2630,7 +2630,7 @@
+ free(first);
+ /*
+ * If the window doesn't exist, Tk_NameToWindow() is documented to place
+- * an error message in interp->result, so just return the error condition.
++ * an error message in Tcl_GetStringResult(interp), so just return the error condition.
+ */
+ if(!w)
+ return NULL;