summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Grozin <grozin@gentoo.org>2009-08-31 16:18:51 +0000
committerAndrey Grozin <grozin@gentoo.org>2009-08-31 16:18:51 +0000
commit0ab571d340d06c106bc5190d90551acb48178437 (patch)
tree0a8368361f6c1451f6b63fdde263c6cfa020301b /sci-libs/mathgl
parentVersion bump; use savedconfig.eclass. (diff)
downloadgentoo-2-0ab571d340d06c106bc5190d90551acb48178437.tar.gz
gentoo-2-0ab571d340d06c106bc5190d90551acb48178437.tar.bz2
gentoo-2-0ab571d340d06c106bc5190d90551acb48178437.zip
Version bump, bug #282821, many thanks to Kacper Kowalik <xarthisius.kk@gmail.com>
(Portage version: 2.2_rc40/cvs/Linux i686)
Diffstat (limited to 'sci-libs/mathgl')
-rw-r--r--sci-libs/mathgl/ChangeLog9
-rw-r--r--sci-libs/mathgl/files/mathgl-1.9.0.1-gcc43.patch10
-rw-r--r--sci-libs/mathgl/files/mathgl-1.9.0.1-hdf5.patch55
-rw-r--r--sci-libs/mathgl/mathgl-1.9.0.1.ebuild108
4 files changed, 181 insertions, 1 deletions
diff --git a/sci-libs/mathgl/ChangeLog b/sci-libs/mathgl/ChangeLog
index 02c1c01ceddf..d5fb93aec24f 100644
--- a/sci-libs/mathgl/ChangeLog
+++ b/sci-libs/mathgl/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sci-libs/mathgl
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/mathgl/ChangeLog,v 1.6 2009/08/09 13:35:22 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/mathgl/ChangeLog,v 1.7 2009/08/31 16:18:51 grozin Exp $
+
+*mathgl-1.9.0.1 (31 Aug 2009)
+
+ 31 Aug 2009; Andrey Grozin <grozin@gentoo.org> +mathgl-1.9.0.1.ebuild,
+ +files/mathgl-1.9.0.1-gcc43.patch, +files/mathgl-1.9.0.1-hdf5.patch:
+ Version bump, bug #282821, many thanks to Kacper Kowalik
+ <xarthisius.kk@gmail.com>
09 Aug 2009; Samuli Suominen <ssuominen@gentoo.org> mathgl-1.8.1.ebuild,
+files/mathgl-1.8.1-gcc44.patch:
diff --git a/sci-libs/mathgl/files/mathgl-1.9.0.1-gcc43.patch b/sci-libs/mathgl/files/mathgl-1.9.0.1-gcc43.patch
new file mode 100644
index 000000000000..7a639bb9a4ab
--- /dev/null
+++ b/sci-libs/mathgl/files/mathgl-1.9.0.1-gcc43.patch
@@ -0,0 +1,10 @@
+--- utils/mgl2gif.cpp.ORIG 2009-03-04 14:22:12.000000000 +0100
++++ utils/mgl2gif.cpp 2009-04-22 10:15:02.000000000 +0200
+@@ -19,6 +19,7 @@
+ ***************************************************************************/
+ #include <stdio.h>
+ #include <string.h>
++#include <cstdlib>
+ #include <locale.h>
+ #include <wchar.h>
+ #include "mgl/mgl_zb.h"
diff --git a/sci-libs/mathgl/files/mathgl-1.9.0.1-hdf5.patch b/sci-libs/mathgl/files/mathgl-1.9.0.1-hdf5.patch
new file mode 100644
index 000000000000..e0337f824dba
--- /dev/null
+++ b/sci-libs/mathgl/files/mathgl-1.9.0.1-hdf5.patch
@@ -0,0 +1,55 @@
+--- mathgl-1.9.0.1.orig/configure.ac 2009-07-08 11:29:13.000000000 +0200
++++ mathgl-1.9.0.1/configure.ac 2009-08-26 11:09:55.123551155 +0200
+@@ -153,6 +153,7 @@
+
+ AC_CHECK_LIB([hdf5], [main], [(test x$all = xtrue || test x$hdf5 = xtrue) && HDF5_LIBS=-lhdf5 AC_SUBST(HDF5_LIBS)],
+ [(test x$all = xtrue || test x$hdf5 = xtrue) && echo "Please install hdf5 library" && exit])
++AC_CHECK_LIB([hdf5], [H5Literate], [(test x$all = xtrue || test x$hdf5 = xtrue) && HDF5_FLAGS="-DHAVE_HDF5 -DHAVE_HDF5_18" AC_SUBST(HDF5_FLAGS)], [])
+ AM_CONDITIONAL(USE_HDF5, (test x$all = xtrue || test x$hdf5 = xtrue))
+
+ AC_ARG_ENABLE(gif,
+--- mathgl-1.9.0.1.orig/mgl/mgl_data_io.cpp 2009-07-08 11:28:45.000000000 +0200
++++ mathgl-1.9.0.1/mgl/mgl_data_io.cpp 2009-08-26 11:29:45.067804785 +0200
+@@ -919,7 +919,11 @@
+ hid_t hf,hd,hs;
+ hsize_t dims[3];
+ long rank = 3, res;
++#ifdef HAVE_HDF5_18
++ H5Eset_auto(H5E_DEFAULT,0,0);
++#else
+ H5Eset_auto(0,0);
++#endif
+ res=H5Fis_hdf5(fname);
+ if(res>0 && !rewrite) hf = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT);
+ else hf = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+@@ -929,10 +933,18 @@
+ else { rank = 3; dims[0] = nz; dims[1] = ny; dims[2] = nx; }
+ hs = H5Screate_simple(rank, dims, 0);
+ #if(MGL_USE_DOUBLE==1)
++#ifdef HAVE_HDF5_18
++ hd = H5Dcreate(hf, data, H5T_NATIVE_DOUBLE, hs, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
++#else /* ! HAVE_HDF5_18 */
+ hd = H5Dcreate(hf, data, H5T_NATIVE_DOUBLE, hs, H5P_DEFAULT);
++#endif /* HAVE_HDF5_18 */
+ H5Dwrite(hd, H5T_NATIVE_DOUBLE, hs, hs, H5P_DEFAULT, a);
+ #else
++#ifdef HAVE_HDF5_18
++ hd = H5Dcreate(hf, data, H5T_NATIVE_FLOAT, hs, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
++#else /* ! HAVE_HDF5_18 */
+ hd = H5Dcreate(hf, data, H5T_NATIVE_FLOAT, hs, H5P_DEFAULT);
++#endif /* HAVE_HDF5_18 */
+ H5Dwrite(hd, H5T_NATIVE_FLOAT, hs, hs, H5P_DEFAULT, a);
+ #endif
+ H5Dclose(hd); H5Sclose(hs); H5Fclose(hf);
+@@ -944,7 +956,11 @@
+ hsize_t dims[3];
+ long rank;
+ hf = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT);
++#ifdef HAVE_HDF5_18
++ hd = H5Dopen(hf,data,H5P_DEFAULT);
++#else
+ hd = H5Dopen(hf,data);
++#endif
+ hs = H5Dget_space(hd);
+ rank = H5Sget_simple_extent_ndims(hs);
+ if(rank>0 && rank<=3)
diff --git a/sci-libs/mathgl/mathgl-1.9.0.1.ebuild b/sci-libs/mathgl/mathgl-1.9.0.1.ebuild
new file mode 100644
index 000000000000..49f9b94d91ee
--- /dev/null
+++ b/sci-libs/mathgl/mathgl-1.9.0.1.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/mathgl/mathgl-1.9.0.1.ebuild,v 1.1 2009/08/31 16:18:51 grozin Exp $
+
+EAPI=2
+WX_GTK_VER=2.8
+inherit autotools wxwidgets python versionator toolchain-funcs
+
+DESCRIPTION="Math Graphics Library"
+HOMEPAGE="http://mathgl.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tgz mirror://sourceforge/${PN}/STIX_font.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc fltk gif glut gsl hdf5 jpeg octave python qt4 wxwindows"
+
+RDEPEND="media-libs/libpng
+ virtual/glu
+ python? ( dev-python/numpy )
+ glut? ( virtual/glut )
+ fltk? ( x11-libs/fltk:1.1 )
+ gif? ( media-libs/giflib )
+ jpeg? ( media-libs/jpeg )
+ hdf5? ( sci-libs/hdf5 )
+ gsl? ( sci-libs/gsl )
+ octave? ( sci-mathematics/octave )
+ qt4? ( x11-libs/qt-gui:4 )
+ wxwindows? ( x11-libs/wxGTK:2.8 )"
+DEPEND="${RDEPEND}
+ doc? ( app-text/texi2html virtual/texi2dvi )
+ python? ( dev-lang/swig )
+ octave? ( dev-lang/swig )"
+
+pkg_setup() {
+ if ! version_is_at_least "4.3.0" "$(gcc-version)"; then
+ eerror "You need >=gcc-4.3.0 to compile this package"
+ die "Wrong gcc version"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ mkdir "${S}"/fonts
+ cd "${S}"/fonts
+ unpack STIX_font.tgz
+}
+
+src_prepare() {
+ # bug #267061
+ epatch "${FILESDIR}"/${P}-gcc43.patch
+ epatch "${FILESDIR}"/${P}-hdf5.patch
+
+ # correct location of numpy/arrayobject.h
+ if use python; then
+ local numpy_h
+ numpy_h=$(python_get_sitedir)/numpy/core/include/numpy/arrayobject.h
+ einfo "fixing numpy.i"
+ sed -e "s|<numpy/arrayobject.h>|\"${numpy_h}\"|" \
+ -i lang/numpy.i \
+ || die "sed failed"
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ econf --docdir="${ROOT}"usr/share/doc/${PF} \
+ $(use_enable glut) \
+ $(use_enable qt4 qt) \
+ $(use_enable wxwindows wx) \
+ $(use_enable fltk) \
+ $(use_enable gif) \
+ $(use_enable jpeg) \
+ $(use_enable hdf5) \
+ $(use_enable python) \
+ $(use_enable octave) \
+ $(use_enable gsl) \
+ $(use_enable doc docs)
+}
+
+src_compile() {
+ # see bug #249627
+ local JOBS
+ use doc && JOBS=-j1
+ emake ${JOBS} || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc README AUTHORS || die "dodoc failed"
+}
+
+pkg_postinst() {
+ if use octave; then
+ octave <<-EOF
+ pkg install /usr/share/${PN}/octave/${PN}.tar.gz
+ EOF
+ fi
+}
+
+pkg_prerm() {
+ if use octave; then
+ octave <<-EOF
+ pkg uninstall ${PN}
+ EOF
+ fi
+}