summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Fabbro <bicatali@gentoo.org>2008-11-05 21:50:18 +0000
committerSebastien Fabbro <bicatali@gentoo.org>2008-11-05 21:50:18 +0000
commit8fd239db20140ab748149b9d3e5a9377cc2e8f69 (patch)
tree8a763545bd0350b63fb7399cd4f1666ffd69e3d7 /sci-libs
parentFix broken compilation when obexftp libraries are installed and linked with i... (diff)
downloadhistorical-8fd239db20140ab748149b9d3e5a9377cc2e8f69.tar.gz
historical-8fd239db20140ab748149b9d3e5a9377cc2e8f69.tar.bz2
historical-8fd239db20140ab748149b9d3e5a9377cc2e8f69.zip
Fix further missing headers, added soname in libcgplot, and as-needed fixes
Package-Manager: portage-2.2_rc11/cvs/Linux 2.6.25-gentoo-r7 x86_64
Diffstat (limited to 'sci-libs')
-rw-r--r--sci-libs/pgplot/ChangeLog10
-rw-r--r--sci-libs/pgplot/Manifest14
-rw-r--r--sci-libs/pgplot/files/pgplot-compile-setup.patch89
-rw-r--r--sci-libs/pgplot/files/pgplot-headers.patch109
-rw-r--r--sci-libs/pgplot/files/pgplot-makemake.patch106
-rw-r--r--sci-libs/pgplot/pgplot-5.2.2-r3.ebuild170
6 files changed, 448 insertions, 50 deletions
diff --git a/sci-libs/pgplot/ChangeLog b/sci-libs/pgplot/ChangeLog
index 7282cf356ee8..d3c019b8c78f 100644
--- a/sci-libs/pgplot/ChangeLog
+++ b/sci-libs/pgplot/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sci-libs/pgplot
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/pgplot/ChangeLog,v 1.13 2008/06/29 08:07:10 tove Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/pgplot/ChangeLog,v 1.14 2008/11/05 21:50:18 bicatali Exp $
+
+*pgplot-5.2.2-r3 (05 Nov 2008)
+
+ 05 Nov 2008; SĂ©bastien Fabbro <bicatali@gentoo.org>
+ files/pgplot-compile-setup.patch, +files/pgplot-headers.patch,
+ files/pgplot-makemake.patch, +pgplot-5.2.2-r3.ebuild:
+ Fix further missing headers, added soname in libcgplot, and as-needed
+ fixes
29 Jun 2008; Torsten Veller <tove@gentoo.org> pgplot-5.2.2-r2.ebuild:
Add missing die: || "..." -> || die "..."
diff --git a/sci-libs/pgplot/Manifest b/sci-libs/pgplot/Manifest
index 60d6a3d81817..40de68413318 100644
--- a/sci-libs/pgplot/Manifest
+++ b/sci-libs/pgplot/Manifest
@@ -1,18 +1,20 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-AUX pgplot-compile-setup.patch 1600 RMD160 73f4786d421b6d353d0e195cc772e13fea1504ca SHA1 719252ffa8674239c8fab19d65f1e3c471b82e53 SHA256 972cbe86b72e79c15deec3c3ecf44b80b23ad56a4e9da4bfdbeb4e872af65e1b
+AUX pgplot-compile-setup.patch 3078 RMD160 657603774f58429b889dfcdeb814812f8499dfc4 SHA1 6835488ea7427b9c029c3df40b14c7d2f99fcd1d SHA256 840bb9977cd61705a459a9c11d0b7c53440539132d3e3538d901c4a441d1909f
AUX pgplot-drivers.patch 7431 RMD160 d300ecf9d5ed3b3117465330e4c235a3f17d0540 SHA1 d1cd686dd0f93b7550affe1e0d4d36f0a336b440 SHA256 19cabb29fd05c2c44cbb0492167ee3e45ab8890390b1e98de672f2ca2588baed
-AUX pgplot-makemake.patch 1040 RMD160 2181f8c8a5347a41ac78aae0c6a3ac3392fe4342 SHA1 0d98a3893077f07c2927258832d0525e0307709b SHA256 ef819809db1cfcdd89c8756d157fa6c3283697a5d54607074c7f9c2ee493cc77
+AUX pgplot-headers.patch 2716 RMD160 aaad73bfbea9b4f731346a02c390e0adc318f8d0 SHA1 e6b95497b519a5450a24bb5997e18019c73e33eb SHA256 e92a07e38fff278218c09b84453d5c75be663576bdbe19ed9259615bd7a0be7c
+AUX pgplot-makemake.patch 2975 RMD160 93fa93c31441d34644cfd474de42a7d1236438f7 SHA1 0e67adc710bdc6712578e4f116c55791dcc18a47 SHA256 e31ec6dde6a6701213a44655b933e584617b687e74a8305b81c9a0c6806a14be
AUX pgplot-pgdisp.patch 332 RMD160 1bd3c2ed7770bb60be19c50c4610c35d67bf92e9 SHA1 891475823d011156aa919fc2b844d1786ae6d85f SHA256 3aac6127d35f4039023a13182553b24e1902d6e1b46530fbd68e034357d0b078
DIST pgplot522.tar.gz 1197397 RMD160 4c21cad6613772f4104c65ac3d8d9a42e3c4afe1 SHA1 1f1c9aa17eeec9a2fb23fd15a0e4a91dcc49ddc1 SHA256 a5799ff719a510d84d26df4ae7409ae61fe66477e3f1e8820422a9a4727a5be4
EBUILD pgplot-5.2.2-r2.ebuild 4865 RMD160 4e8945c277ea152e07453cd807d5613f27ab1f5a SHA1 5130d185715002ed41d37445e06270f5275e5d0f SHA256 f035308c3a65fc728ab279eb53aa769dec58fa9e5862be2f89ff676360e49841
-MISC ChangeLog 2626 RMD160 ee6c896cb3b338dcbecf6ebed606e1d948ff9b7f SHA1 f82f0299d692d0b51ee20afe8bd749f54b564474 SHA256 d07a5aac3249c23a6d95f55e4f65233b50f5da16d69ae99e0066b5e5b91ada84
+EBUILD pgplot-5.2.2-r3.ebuild 4631 RMD160 e70008606e4ce3f90a5312a4cbd47298598d2f14 SHA1 38bb7a72950a9f9ddae90070f97c144285a8766d SHA256 c33e6155e0279866aa86ca100516f69a4f22d830b0e8ab734d7ca82e630106a2
+MISC ChangeLog 2919 RMD160 a05897df69ce2e2c6ccda8fe8de899f54b22aced SHA1 877864c0bbdc3c1b1337f5ec22f04d9b4239a3da SHA256 22bd4412daadcaa3bed184c2703abfc634a45461e47116b5fcec0bfb05443750
MISC metadata.xml 507 RMD160 8f89aef225b3c7fa4b817bd88ebfa5e73c9f1f4f SHA1 93061e1e4b6fa0967fec2829db49dbcaa74b6410 SHA256 44c0abf74199b2c4780cd7bf4bbc9b7c235ccc5e74e262985517ec8ade97189c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
-iEYEARECAAYFAkhnQrQACgkQV3J2n04Eauz2aQCgyFc2CwbrT69nr6QwqsSKRSzv
-iksAoJad2Qh5dRxO5HcNy4K68zI5WvV2
-=Wi1I
+iEYEARECAAYFAkkSFSIACgkQ1ycZbhPLE2CVxQCeK5sMBgGSmHxP5j22bmhtPdm/
+M30AmwbXZnHE7/LO8AqVF/aMnGMcSYEQ
+=41Us
-----END PGP SIGNATURE-----
diff --git a/sci-libs/pgplot/files/pgplot-compile-setup.patch b/sci-libs/pgplot/files/pgplot-compile-setup.patch
index d7c281057eef..e6eecbc54bd9 100644
--- a/sci-libs/pgplot/files/pgplot-compile-setup.patch
+++ b/sci-libs/pgplot/files/pgplot-compile-setup.patch
@@ -1,44 +1,52 @@
-diff -ur pgplot.orig/sys_linux/g77_gcc.conf pgplot/sys_linux/g77_gcc.conf
---- pgplot.orig/sys_linux/g77_gcc.conf 1999-07-05 11:10:33.000000000 -0700
-+++ pgplot/sys_linux/g77_gcc.conf 2005-12-15 19:59:28.000000000 -0800
-@@ -5,7 +5,7 @@
- # X2DRIV (/xdisp and /figdisp).
- # The arguments needed by the C compiler to locate X-window include files.
+--- 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.
-- XINCL="-I/usr/X11R6/include"
-+# XINCL="-I/usr/X11R6/include"
+- TK_INCL="-I/usr/include $XINCL"
++ TK_INCL="$XINCL"
- # Optional: Needed by XMDRIV (/xmotif).
- # The arguments needed by the C compiler to locate Motif, Xt and
-@@ -40,7 +40,8 @@
+ # 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"
-+ FFLAGOPT="-O"
-+ FFLAGC="-u -Wall -fPIC $FFLAGOPT"
++ FFLAGC="-u -Wall"
# Mandatory.
# The FORTRAN compiler flags to use when compiling fortran demo programs.
-@@ -56,13 +57,14 @@
-
+@@ -57,12 +57,12 @@
# Mandatory.
# The C compiler flags to use when compiling the pgplot library.
--
+
- CFLAGC="-Wall -fPIC -DPG_PPU -O"
-+
-+ CFLAGOPT="-O"
-+ CFLAGC="-Wall -fPIC -DPG_PPU $CFLAGOPT"
++ CFLAGC="-Wall -DPG_PPU"
# Mandatory.
# The C compiler flags to use when compiling C demo programs.
- CFLAGD="-Wall -O"
-+ CFLAGD="-Wall $CFLAGOPT"
++ 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 +76,7 @@
+@@ -74,7 +74,7 @@
# The library-specification flags to use when linking normal pgplot
# demo programs.
@@ -47,3 +55,42 @@ diff -ur pgplot.orig/sys_linux/g77_gcc.conf pgplot/sys_linux/g77_gcc.conf
# 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="-o $SHARED_LIB -Wl,-soname,$SHARED_LIB $LDFLAGS"
++
++ SHARED_LD_CPGPLOT_OPTS="-o $SHARED_CLIB -Wl,-soname,$SHARED_CLIB -L. -lpgplot $LDFLAGS"
++
++ 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-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-makemake.patch b/sci-libs/pgplot/files/pgplot-makemake.patch
index 440f95d72870..9ee0d6168e21 100644
--- a/sci-libs/pgplot/files/pgplot-makemake.patch
+++ b/sci-libs/pgplot/files/pgplot-makemake.patch
@@ -1,35 +1,97 @@
---- pgplot.orig/makemake 1999-05-04 15:35:43.000000000 -0700
-+++ pgplot/makemake 2005-12-15 20:48:42.000000000 -0800
-@@ -666,7 +666,7 @@
- # the library don't have to list a slew of other implementation-specific
- # libraries when they link their executables.
+--- makemake.orig 2008-10-29 15:32:12.000000000 +0000
++++ makemake 2008-10-29 20:08:59.000000000 +0000
+@@ -622,7 +622,7 @@
+ # Fortran compiler and compilation flags
#
--SHARED_LIB_LIBS=$SHARED_LIB_LIBS
-+SHARED_LIB_LIBS=-lpng
+ FCOMPL=$FCOMPL
+-FFLAGC=$FFLAGC
++FFLAGC=$FFLAGC \$(FFLAGS)
+ FFLAGD=$FFLAGD
#
- # Ranlib command if required
+ # 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
+@@ -658,6 +658,8 @@
#
-@@ -681,7 +681,7 @@
- OBSOLETE_ROUTINES=$OBSOLETE_ROUTINES
- DRIVERS=$DRIV_LIST
- PGDISP_ROUTINES=$PGDISP_ROUTINES
--DEMOS=$DEMOS
-+#DEMOS=$DEMOS
+ SHARED_LIB=$SHARED_LIB
+ 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 +808,8 @@
+ # libraries.
#-----------------------------------------------------------------------
- # Target "all" makes everything (except the library of obsolete routines)
-@@ -1025,12 +1025,12 @@
+
+-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 +819,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) \
++ $(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)
++
+ EOD
+
+ # Emit the shared library dependency if requested.
+@@ -824,7 +837,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
+@@ -1025,7 +1038,7 @@
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 :
++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: libcpgplot.a cpgplot.h
- @echo ' '
- @echo '*** Finished compilation of the C PGPLOT wrapper library ***'
+@@ -1039,6 +1052,8 @@
+ @echo 'will be needed.'
@echo ' '
+
++cpg-shared: libcpgplot.so
++
+ pgbind: $(SRC)/cpg/pgbind.c
+ $(CCOMPL) $(CFLAGC) $(SRC)/cpg/pgbind.c -o pgbind
+
+@@ -1050,6 +1065,13 @@
+ $(RANLIB) libcpgplot.a
+ rm -f cpg*.o
+
++libcpgplot.so: $(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 -lpgplot $(SHARED_LIB_LIBS)
++ 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)
diff --git a/sci-libs/pgplot/pgplot-5.2.2-r3.ebuild b/sci-libs/pgplot/pgplot-5.2.2-r3.ebuild
new file mode 100644
index 000000000000..6c57570df1bd
--- /dev/null
+++ b/sci-libs/pgplot/pgplot-5.2.2-r3.ebuild
@@ -0,0 +1,170 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/pgplot/pgplot-5.2.2-r3.ebuild,v 1.1 2008/11/05 21:50:18 bicatali Exp $
+
+inherit eutils toolchain-funcs fortran
+
+MY_P="${PN}${PV//.}"
+DESCRIPTION="FORTRAN/C device-independent scientific graphic library"
+HOMEPAGE="http://www.astro.caltech.edu/~tjp/pgplot/"
+SRC_URI="ftp://ftp.astro.caltech.edu/pub/pgplot/${MY_P}.tar.gz"
+LICENSE="free-noncomm"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~x86"
+IUSE="doc motif tk"
+RDEPEND="x11-libs/libX11
+ x11-libs/libXt
+ media-libs/libpng
+ motif? ( x11-libs/openmotif )
+ tk? ( dev-lang/tk )"
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+S="${WORKDIR}/${PN}"
+
+FORTRAN="g77 gfortran ifc"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${PN}-drivers.patch
+ epatch "${FILESDIR}"/${PN}-makemake.patch
+ epatch "${FILESDIR}"/${PN}-compile-setup.patch
+ epatch "${FILESDIR}"/${PN}-headers.patch
+
+ # gfortran < 4.3 does not compile gif, pp and wd drivers
+ if [[ "${FORTRANC}" == gfortran ]] &&
+ [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]] ; then
+ ewarn
+ ewarn "Warning!"
+ ewarn "gfortran < 4.3 selected: does not compile all drivers"
+ ewarn "disabling gif, wd, and ppd drivers"
+ ewarn "if you want more drivers, use gfortran >= 4.3, g77 or ifort"
+ ewarn
+ epause 4
+ sed -i \
+ -e 's/GIDRIV/! GIDRIV/g' \
+ -e 's/PPDRIV/! GIDRIV/g' \
+ -e 's/WDDRIV/! GIDRIV/g' \
+ drivers.list || die "sed drivers failed"
+ fi
+
+ # fix pointers for 64 bits
+ if use amd64 || use ia64; then
+ sed -i \
+ -e 's/INTEGER PIXMAP/INTEGER*8 PIXMAP/g' \
+ drivers/{gi,pp,wd}driv.f || die "sed 64bits failed"
+ fi
+
+ cp sys_linux/g77_gcc.conf local.conf
+
+ sed -i \
+ -e "s:FCOMPL=.*:FCOMPL=\"${FORTRANC}\":g" \
+ -e "s:CCOMPL=.*:CCOMPL=\"$(tc-getCC)\":g" \
+ local.conf || die "sed flags failed"
+
+ if [[ "${FORTRANC}" = if* ]]; then
+ sed -i \
+ -e 's/-Wall//g' \
+ -e 's/TK_LIBS="/TK_LIBS="-nofor-main /' \
+ local.conf || die "sed drivers failed"
+ fi
+
+ sed -i \
+ -e "s:/usr/local/pgplot:/usr/$(get_libdir)/pgplot:g" \
+ -e "s:/usr/local/bin:/usr/bin:g" \
+ src/grgfil.f makehtml maketex || die "sed path failed"
+
+ use motif && sed -i -e '/XMDRIV/s/!//' drivers.list
+ use tk && sed -i -e '/TKDRIV/s/!//' drivers.list
+}
+
+src_compile() {
+ ./makemake . linux
+
+ emake all cpg || die "emake failed"
+ emake clean
+ einfo "Doing "
+ emake \
+ CFLAGS="${CFLAGS} -fPIC" \
+ FFLAGS="${FFLAGS} -fPIC" \
+ shared cpg-shared || die "emake shared failed"
+
+ if use doc; then
+ emake pgplot.html || die "make pgplot.html failed"
+ emake pgplot-routines.tex || die "make pgplot-routines failed"
+ pdflatex pgplot-routines.tex
+ pdflatex pgplot-routines.tex
+ fi
+
+ # this just cleans out not needed files
+ emake clean
+}
+
+src_test() {
+ einfo "Testing various demo programs"
+ # i can go to 16
+ for i in 1 2 3; do
+ emake pgdemo${i}
+ # j can also be LATEX CPS...
+ for j in NULL PNG PS CPS LATEX; do
+ local testexe=./test_${j}_${i}
+ echo "./pgdemo${i} <<EOF" > ${testexe}
+ echo "/${j}" >> ${testexe}
+ echo "EOF" >> ${testexe}
+ sh ${testexe} || die "test ${i} failed"
+ done
+ done
+}
+
+src_install() {
+ insinto /usr/$(get_libdir)/pgplot
+ doins grfont.dat grexec.f *.inc rgb.txt
+
+ # FORTRAN libs
+ dolib.a libpgplot.a || die "dolib.a failed"
+ dolib.so libpgplot.so.5 || die "dolib.so failed"
+ dosym libpgplot.so.5 /usr/$(get_libdir)/libpgplot.so || die
+ dobin pgxwin_server pgdisp || die "dobin failed"
+
+ # C binding
+ insinto /usr/include
+ doins cpgplot.h || die "doins C binding failed"
+ dolib.a libcpgplot.a || die "dolib.a failed"
+ dolib.so libcpgplot.so.5 || die "dolib C failed"
+ dosym libcpgplot.so.5 /usr/$(get_libdir)/libcpgplot.so || die
+
+ if use motif; then
+ doins XmPgplot.h || die "doins motif failed"
+ dolib.a libXmPgplot.a || die "dolib.a motif failed"
+ fi
+
+ if use tk; then
+ doins tkpgplot.h || die "doins tk failed"
+ dolib.a libtkpgplot.a || die "dolib.a tk failed"
+ fi
+
+ # minimal doc
+ dodoc aaaread.me pgplot.doc || die "dodoc minimal doc failed"
+ newdoc pgdispd/aaaread.me pgdispd.txt || die "install pgdispd doc failed"
+
+ if use doc; then
+ dodoc cpg/cpgplot.doc applications/curvefit/curvefit.doc
+ dohtml pgplot.html
+ insinto /usr/share/doc/${PF}
+ doins pgplot-routines.pdf pgplot-routines.tex
+ insinto /usr/share/doc/${PF}/examples
+ doins examples/* cpg/cpgdemo.c
+ insinto /usr/share/doc/${PF}/applications
+ doins -r applications/*
+ if use motif; then
+ insinto /usr/share/doc/${PF}/pgm
+ doins pgmf/* drivers/xmotif/pgmdemo.c
+ fi
+ if use tk; then
+ insinto /usr/share/doc/${PF}/pgtk
+ doins drivers/xtk/pgtkdemo.*
+ fi
+ fi
+}