diff options
author | 2002-11-20 07:50:45 +0000 | |
---|---|---|
committer | 2002-11-20 07:50:45 +0000 | |
commit | 0ad23f0d8c8f2c5d025ba7b24855dc92da9e93bd (patch) | |
tree | 041619b2181969b743d485493bb22667efa82b78 /app-sci | |
parent | ~x86 -> x86 (diff) | |
download | gentoo-2-0ad23f0d8c8f2c5d025ba7b24855dc92da9e93bd.tar.gz gentoo-2-0ad23f0d8c8f2c5d025ba7b24855dc92da9e93bd.tar.bz2 gentoo-2-0ad23f0d8c8f2c5d025ba7b24855dc92da9e93bd.zip |
fixed bug for gcc3.2
Diffstat (limited to 'app-sci')
-rw-r--r-- | app-sci/netcdf/ChangeLog | 11 | ||||
-rw-r--r-- | app-sci/netcdf/files/digest-netcdf-3.5.0-r2 | 1 | ||||
-rw-r--r-- | app-sci/netcdf/files/gcc3-gentoo.patch | 245 | ||||
-rw-r--r-- | app-sci/netcdf/netcdf-3.5.0-r2.ebuild | 41 |
4 files changed, 297 insertions, 1 deletions
diff --git a/app-sci/netcdf/ChangeLog b/app-sci/netcdf/ChangeLog index 57f5737228c5..33fd6a6b2a3b 100644 --- a/app-sci/netcdf/ChangeLog +++ b/app-sci/netcdf/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for app-sci/netcdf # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL -# $Header: /var/cvsroot/gentoo-x86/app-sci/netcdf/ChangeLog,v 1.2 2002/09/15 04:52:02 seemant Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-sci/netcdf/ChangeLog,v 1.3 2002/11/20 07:50:45 mkennedy Exp $ + +*netcdf-3.5.0-r2 (1 Feb 2002) + + 18 Nov 2002; Matthew Kennedy <mkennedy@gentoo.org> + netcdf-3.5.0-r2.ebuild, files/digest-netcdf-3.5.0-r2, + files/gcc3-gentoo.patch : + + C++ fixing for compatibility for GCC3.2 and ANSI C++. Patch thanks to + Sam Yates <sam@quux.dropbear.id.au> of bug #5784 fame. *netcdf-3.5.0-r1 (1 Feb 2002) diff --git a/app-sci/netcdf/files/digest-netcdf-3.5.0-r2 b/app-sci/netcdf/files/digest-netcdf-3.5.0-r2 new file mode 100644 index 000000000000..25d6e8d0de3d --- /dev/null +++ b/app-sci/netcdf/files/digest-netcdf-3.5.0-r2 @@ -0,0 +1 @@ +MD5 28640a40a44f982f90f5eeb15e917a1f netcdf-3.5.0.tar.Z 1319419 diff --git a/app-sci/netcdf/files/gcc3-gentoo.patch b/app-sci/netcdf/files/gcc3-gentoo.patch new file mode 100644 index 000000000000..ab495321ca7d --- /dev/null +++ b/app-sci/netcdf/files/gcc3-gentoo.patch @@ -0,0 +1,245 @@ +*** cxx/ncvalues.h.orig 2002-07-31 03:03:17.000000000 +0930 +--- cxx/ncvalues.h 2002-07-31 03:26:14.000000000 +0930 +*************** +*** 10,25 **** + #ifndef Ncvalues_def + #define Ncvalues_def + +! #include <iostream.h> +! #ifdef STRSTREAM_H_SPEC +! # include STRSTREAM_H_SPEC +! #else +! # include <strstream.h> +! #endif + #include <limits.h> + #include <string.h> + #include "netcdf.h" +! + typedef unsigned char ncbyte; + + #define NC_UNSPECIFIED ((nc_type)0) +--- 10,22 ---- + #ifndef Ncvalues_def + #define Ncvalues_def + +! #include <iostream> +! #include <sstream> +! extern "C" { + #include <limits.h> + #include <string.h> + #include "netcdf.h" +! } + typedef unsigned char ncbyte; + + #define NC_UNSPECIFIED ((nc_type)0) +*************** +*** 82,88 **** + virtual int invalid( void ) const; \ + private: \ + TYPE* the_values; \ +! ostream& print(ostream&) const; \ + }; + + #define NcTypeEnum(TYPE) makename2(_nc__,TYPE) +--- 79,85 ---- + virtual int invalid( void ) const; \ + private: \ + TYPE* the_values; \ +! std::ostream& print(std::ostream&) const; \ + }; + + #define NcTypeEnum(TYPE) makename2(_nc__,TYPE) +*************** +*** 218,228 **** + + #define as_string_implement(TYPE) \ + char* NcVal(TYPE)::as_string( long n ) const \ +! { \ + char* s = new char[32]; \ +! ostrstream ostr(s, sizeof(s)); \ +! ostr << the_values[n] << ends; \ +! return s; \ + } + + class NcValues // ABC for value blocks +--- 215,227 ---- + + #define as_string_implement(TYPE) \ + char* NcVal(TYPE)::as_string( long n ) const \ +! { \ + char* s = new char[32]; \ +! ostringstream ostr; \ +! ostr << the_values[n]; \ +! strncpy(s,ostr.str().c_str(),32); \ +! s[31]=0; \ +! return s; \ + } + + class NcValues // ABC for value blocks +*************** +*** 232,238 **** + NcValues(NcType, long); + virtual ~NcValues( void ); + virtual long num( void ); +! virtual ostream& print(ostream&) const = 0; + virtual void* base( void ) const = 0; + virtual int bytes_for_one( void ) const = 0; + +--- 231,237 ---- + NcValues(NcType, long); + virtual ~NcValues( void ); + virtual long num( void ); +! virtual std::ostream& print(std::ostream&) const = 0; + virtual void* base( void ) const = 0; + virtual int bytes_for_one( void ) const = 0; + +*************** +*** 252,258 **** + protected: + NcType the_type; + long the_number; +! friend ostream& operator<< (ostream&, const NcValues&); + }; + + declare(NcValues,ncbyte) +--- 251,257 ---- + protected: + NcType the_type; + long the_number; +! friend std::ostream& operator<< (std::ostream&, const NcValues&); + }; + + declare(NcValues,ncbyte) +*** cxx/ncvalues.cpp.orig 2002-07-31 03:12:52.000000000 +0930 +--- cxx/ncvalues.cpp 2002-07-31 03:13:56.000000000 +0930 +*************** +*** 7,15 **** + * $Header: /var/cvsroot/gentoo-x86/app-sci/netcdf/files/gcc3-gentoo.patch,v 1.1 2002/11/20 07:50:45 mkennedy Exp $ + *********************************************************************/ + +! #include <iostream.h> // for debugging + #include "ncvalues.h" + + NcValues::NcValues( void ) : the_number(0), the_type(ncNoType) + {} + +--- 7,17 ---- + * $Header: /var/cvsroot/gentoo-x86/app-sci/netcdf/files/gcc3-gentoo.patch,v 1.1 2002/11/20 07:50:45 mkennedy Exp $ + *********************************************************************/ + +! #include <iostream> // for debugging + #include "ncvalues.h" + ++ using namespace std; ++ + NcValues::NcValues( void ) : the_number(0), the_type(ncNoType) + {} + +*************** +*** 304,310 **** + + ostream& NcValues_float::print(ostream& os) const + { +! long save=os.flags(); + os.precision(7); + for(int i = 0; i < the_number - 1; i++) + os << the_values[i] << ", "; +--- 306,312 ---- + + ostream& NcValues_float::print(ostream& os) const + { +! ios::fmtflags save=os.flags(); + os.precision(7); + for(int i = 0; i < the_number - 1; i++) + os << the_values[i] << ", "; +*************** +*** 316,322 **** + + ostream& NcValues_double::print(ostream& os) const + { +! long save=os.flags(); + os.precision(15); + for(int i = 0; i < the_number - 1; i++) + os << the_values[i] << ", "; +--- 318,324 ---- + + ostream& NcValues_double::print(ostream& os) const + { +! ios::fmtflags save=os.flags(); + os.precision(15); + for(int i = 0; i < the_number - 1; i++) + os << the_values[i] << ", "; +*** cxx/netcdfcpp.h.orig 2002-07-31 03:07:35.000000000 +0930 +--- cxx/netcdfcpp.h 2002-07-31 03:07:56.000000000 +0930 +*************** +*** 154,160 **** + virtual ~NcDim( void ); + + // to construct dimensions, since constructor is private +! friend NcFile; + }; + + +--- 154,160 ---- + virtual ~NcDim( void ); + + // to construct dimensions, since constructor is private +! friend class NcFile; + }; + + +*************** +*** 357,363 **** + void init_cur( void ); + + // to make variables, since constructor is private +! friend NcFile; + }; + + +--- 357,363 ---- + void init_cur( void ); + + // to make variables, since constructor is private +! friend class NcFile; + }; + + +*************** +*** 388,394 **** + NcAtt( NcFile*, NcToken); // global attribute + + // To make attributes, since constructor is private +! friend NcFile; + friend NcAtt* NcVar::get_att( NcToken ) const; + }; + +--- 388,394 ---- + NcAtt( NcFile*, NcToken); // global attribute + + // To make attributes, since constructor is private +! friend class NcFile; + friend NcAtt* NcVar::get_att( NcToken ) const; + }; + +*** cxx/nctst.cpp.orig 2002-07-31 04:00:10.000000000 +0930 +--- cxx/nctst.cpp 2002-07-31 04:00:19.000000000 +0930 +*************** +*** 1,7 **** +! #include <iostream.h> + #include <string.h> + #include "netcdfcpp.h" + + void gen(const char* path) // Generate a netCDF file + { + NcFile nc(path, NcFile::Replace); // Create, leave in define mode +--- 1,9 ---- +! #include <iostream> + #include <string.h> + #include "netcdfcpp.h" + ++ using namespace std; ++ + void gen(const char* path) // Generate a netCDF file + { + NcFile nc(path, NcFile::Replace); // Create, leave in define mode diff --git a/app-sci/netcdf/netcdf-3.5.0-r2.ebuild b/app-sci/netcdf/netcdf-3.5.0-r2.ebuild new file mode 100644 index 000000000000..ebd638a74ad9 --- /dev/null +++ b/app-sci/netcdf/netcdf-3.5.0-r2.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-sci/netcdf/netcdf-3.5.0-r2.ebuild,v 1.1 2002/11/20 07:50:45 mkennedy Exp $ + +S=${WORKDIR}/${P}/src +DESCRIPTION="Interface for array oriented data access" +SRC_URI="ftp://ftp.unidata.ucar.edu/pub/netcdf/${P}.tar.Z" +HOMEPAGE="http://www.unidaa.ucar.edu/packages/netcdf/" + +LICENSE="as-is" +SLOT="0" +KEYWORDS="x86" + +src_unpack() { + unpack ${A} + cd ${S} + # welcome to ANSI C++ coding with sed + cp configure configure~ && sed \ + -e 's/iostream\.h/iostream/g' \ + -e 's/cout/std::cout/g' \ + -e 's/^extern "C".*//g' <configure~ >configure || die + + cd cxx && patch -p1 <${FILESDIR}/gcc3-gentoo.patch || die +} + +src_compile() { + export CPPFLAGS=-Df2cFortran + econf || die + make || die + make test || die +} + +src_install() { + dodir /usr/{lib,share} + + einstall \ + MANDIR=${D}/usr/share/man || die + + dodoc COMPATIBILITY COPYRIGHT MANIFEST README RELEASE_NOTES VERSION + dohtml -r . +} |