From 9f438679ceb6a248777509e4e5f64c67944b2593 Mon Sep 17 00:00:00 2001 From: Sebastien Fabbro Date: Wed, 5 Nov 2008 21:50:18 +0000 Subject: Fix further missing headers, added soname in libcgplot, and as-needed fixes (Portage version: 2.2_rc11/cvs/Linux 2.6.25-gentoo-r7 x86_64) --- sci-libs/pgplot/ChangeLog | 10 +- sci-libs/pgplot/files/pgplot-compile-setup.patch | 89 +++++++++--- sci-libs/pgplot/files/pgplot-headers.patch | 109 +++++++++++++++ sci-libs/pgplot/files/pgplot-makemake.patch | 106 +++++++++++--- sci-libs/pgplot/pgplot-5.2.2-r3.ebuild | 170 +++++++++++++++++++++++ 5 files changed, 440 insertions(+), 44 deletions(-) create mode 100644 sci-libs/pgplot/files/pgplot-headers.patch create mode 100644 sci-libs/pgplot/pgplot-5.2.2-r3.ebuild (limited to 'sci-libs/pgplot') 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 + 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 pgplot-5.2.2-r2.ebuild: Add missing die: || "..." -> || die "..." 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 + #include ++#include ++#include ++#include ++#include + + #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 ++#include + #include ++#include + #include + #include + +--- ./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 ++#include ++#include + + /* 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 + #include + #include ++#include ++ + #ifndef VMS + #include + #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 ++#include + #include + #include + +@@ -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 ++#include + + #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 ++#include + #include + #include + +@@ -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} < ${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 +} -- cgit v1.2.3-65-gdbad