diff options
author | Sebastien Fabbro <bicatali@gentoo.org> | 2010-10-03 23:45:04 +0000 |
---|---|---|
committer | Sebastien Fabbro <bicatali@gentoo.org> | 2010-10-03 23:45:04 +0000 |
commit | 3efb37cffc01b487a44077b069695d9a7f5843a6 (patch) | |
tree | cdc631417c4d9d7d76a9076db294cd4e6daa1fce /sci-mathematics | |
parent | Error in previous patch, now installs all qhull headers to allow reverse depe... (diff) | |
download | gentoo-2-3efb37cffc01b487a44077b069695d9a7f5843a6.tar.gz gentoo-2-3efb37cffc01b487a44077b069695d9a7f5843a6.tar.bz2 gentoo-2-3efb37cffc01b487a44077b069695d9a7f5843a6.zip |
Added a few patches from upstream and debian. Should pass tests now.
(Portage version: 2.2_rc88/cvs/Linux x86_64)
Diffstat (limited to 'sci-mathematics')
8 files changed, 403 insertions, 1 deletions
diff --git a/sci-mathematics/octave/ChangeLog b/sci-mathematics/octave/ChangeLog index 960c7acbbc1c..b5f6b5c0f193 100644 --- a/sci-mathematics/octave/ChangeLog +++ b/sci-mathematics/octave/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for sci-mathematics/octave # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/octave/ChangeLog,v 1.96 2010/09/14 16:45:35 bicatali Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/octave/ChangeLog,v 1.97 2010/10/03 23:45:04 bicatali Exp $ + +*octave-3.2.4-r3 (03 Oct 2010) + + 03 Oct 2010; Sébastien Fabbro <bicatali@gentoo.org> + +octave-3.2.4-r3.ebuild, +files/octave-3.2.4-addpath.patch, + +files/octave-3.2.4-filter-empty-vector.patch, + +files/octave-3.2.4-imshow.patch, +files/octave-3.2.4-interp2.patch, + +files/octave-3.2.4-no-helvetica.patch, + +files/octave-3.2.4-normal-marker-size.patch: + Added a few patches from upstream and debian. Should pass tests now. *octave-3.2.4-r2 (14 Sep 2010) diff --git a/sci-mathematics/octave/files/octave-3.2.4-addpath.patch b/sci-mathematics/octave/files/octave-3.2.4-addpath.patch new file mode 100644 index 000000000000..c3b208b764d1 --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.2.4-addpath.patch @@ -0,0 +1,20 @@ +From: "Thomas Weber" <tweber@debian.org> +Subject: Don't crash on calling addpath('./') +Description: Octave 3.2 crashes when calling something like + echo "addpath('./'); addpath('./')" | octave + This patch originates from a larger patch from upstreams's development version. +Origin: partly upstream, http://hg.savannah.gnu.org/hgweb/octave/rev/4acae5e46738 +Bug-Debian: http://bugs.debian.org/592517 +Applied-Upstream: http://hg.savannah.gnu.org/hgweb/octave/rev/4acae5e46738 + +--- a/src/load-path.cc ++++ b/src/load-path.cc +@@ -653,8 +653,6 @@ + + if (i != dir_info_list.end ()) + move (i, false); +- else +- panic_impossible (); + } + + void diff --git a/sci-mathematics/octave/files/octave-3.2.4-filter-empty-vector.patch b/sci-mathematics/octave/files/octave-3.2.4-filter-empty-vector.patch new file mode 100644 index 000000000000..f6cace5b15e3 --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.2.4-filter-empty-vector.patch @@ -0,0 +1,17 @@ +From: "John W. Eaton" <jwe@octave.org> +Subject: Don't crash on filtering an empty vector +Origin: upstream, http://hg.savannah.gnu.org/hgweb/octave/rev/a277ba5da4dc +Bug-Debian: http://bugs.debian.org/567975 + +--- a/src/DLD-FUNCTIONS/filter.cc ++++ b/src/DLD-FUNCTIONS/filter.cc +@@ -117,6 +117,9 @@ + } + } + ++ if (x_len == 0) ++ return x; ++ + if (norm != static_cast<T>(1.0)) + { + a = a / norm; diff --git a/sci-mathematics/octave/files/octave-3.2.4-imshow.patch b/sci-mathematics/octave/files/octave-3.2.4-imshow.patch new file mode 100644 index 000000000000..5b94e2589947 --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.2.4-imshow.patch @@ -0,0 +1,27 @@ +From: Rik <octave@nomad.inbox5.com> +Subject: Scale image point color according to colormap. + +Origin: upstream, http://hg.savannah.gnu.org/hgweb/octave/rev/bc4eb29e0cb4 +Bug: http://savannah.gnu.org/bugs/?29926 +Bug-Debian: http://bugs.debian.org/581998 + +--- a/scripts/image/imshow.m ++++ b/scripts/image/imshow.m +@@ -64,7 +64,6 @@ + + ## Get the image. + if (ischar (im)) +- ## Eventually, this should be imread. + [im, map] = imread (im); + indexed = true; + colormap (map); +@@ -163,7 +162,8 @@ + if (true_color || indexed) + tmp = image ([], [], im); + else +- tmp = image (round ((rows (colormap ()) - 1) * im)); ++ tmp = image (im); ++ set (tmp, "cdatamapping", "scaled"); + endif + set (gca (), "visible", "off"); + axis ("image"); diff --git a/sci-mathematics/octave/files/octave-3.2.4-interp2.patch b/sci-mathematics/octave/files/octave-3.2.4-interp2.patch new file mode 100644 index 000000000000..dae7db50ec7e --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.2.4-interp2.patch @@ -0,0 +1,160 @@ +From: various upstream authors authors +Description: Implement bicubic interpolation correctly + This patch fixes a bug triggered by octave-image's test suite. + +Origin: upstream, http://hg.savannah.gnu.org/hgweb/octave/file/62bb59f927b1/scripts/general/interp2.m +Bug-Debian: http://bugs.debian.org/582276 + +--- a/scripts/general/interp2.m ++++ b/scripts/general/interp2.m +@@ -57,7 +57,7 @@ + ## @item 'linear' + ## Linear interpolation from nearest neighbors. + ## @item 'pchip' +-## Piece-wise cubic hermite interpolating polynomial (not implemented yet). ++## Piece-wise cubic hermite interpolating polynomial. + ## @item 'cubic' + ## Cubic interpolation from four nearest neighbors. + ## @item 'spline' +@@ -218,18 +218,21 @@ + c = Z(2:zr, 1:(zc - 1)) - a; + d = Z(2:zr, 2:zc) - a - b - c; + +- idx = sub2ind (size (a), yidx, xidx); +- + ## scale XI, YI values to a 1-spaced grid +- Xsc = (XI - X(xidx)) ./ (X(xidx + 1) - X(xidx)); +- Ysc = (YI - Y(yidx)) ./ (Y(yidx + 1) - Y(yidx)); ++ Xsc = (XI - X(xidx)) ./ (diff (X)(xidx)); ++ Ysc = (YI - Y(yidx)) ./ (diff (Y)(yidx)); ++ ++ ## Get 2D index. ++ idx = sub2ind (size (a), yidx, xidx); ++ ## We can dispose of the 1D indices at this point to save memory. ++ clear xidx yidx + + ## apply plane equation + ZI = a(idx) + b(idx).*Xsc + c(idx).*Ysc + d(idx).*Xsc.*Ysc; + + elseif (strcmp (method, "nearest")) +- ii = (XI - X(xidx) > X(xidx + 1) - XI); +- jj = (YI - Y(yidx) > Y(yidx + 1) - YI); ++ ii = (XI - X(xidx) >= X(xidx + 1) - XI); ++ jj = (YI - Y(yidx) >= Y(yidx + 1) - YI); + idx = sub2ind (size (Z), yidx+jj, xidx+ii); + ZI = Z(idx); + +@@ -339,11 +342,64 @@ + + ## FIXME bicubic/__splinen__ don't handle arbitrary XI, YI + if (strcmp (method, "cubic")) +- ZI = bicubic (X, Y, Z, XI(1,:), YI(:,1), extrapval); ++ if (isgriddata (XI) && isgriddata (YI')) ++ ZI = bicubic (X, Y, Z, XI (1, :), YI (:, 1), extrapval); ++ elseif (isgriddata (X) && isgriddata (Y')) ++ ## Allocate output ++ ZI = zeros (size (X)); ++ ++ ## Find inliers ++ inside = !(XI < X (1) | XI > X (end) | YI < Y (1) | YI > Y (end)); ++ ++ ## Scale XI and YI to match indices of Z ++ XI = (columns (Z) - 1) * (XI - X (1)) / (X (end) - X (1)) + 1; ++ YI = (rows (Z) - 1) * (YI - Y (1)) / (Y (end) - Y (1)) + 1; ++ ++ ## Start the real work ++ K = floor (XI); ++ L = floor (YI); ++ ++ ## Coefficients ++ AY1 = bc ((YI - L + 1)); ++ AX1 = bc ((XI - K + 1)); ++ AY0 = bc ((YI - L + 0)); ++ AX0 = bc ((XI - K + 0)); ++ AY_1 = bc ((YI - L - 1)); ++ AX_1 = bc ((XI - K - 1)); ++ AY_2 = bc ((YI - L - 2)); ++ AX_2 = bc ((XI - K - 2)); ++ ++ ## Perform interpolation ++ sz = size(Z); ++ ZI = AY_2 .* AX_2 .* Z (sym_sub2ind (sz, L+2, K+2)) ... ++ + AY_2 .* AX_1 .* Z (sym_sub2ind (sz, L+2, K+1)) ... ++ + AY_2 .* AX0 .* Z (sym_sub2ind (sz, L+2, K)) ... ++ + AY_2 .* AX1 .* Z (sym_sub2ind (sz, L+2, K-1)) ... ++ + AY_1 .* AX_2 .* Z (sym_sub2ind (sz, L+1, K+2)) ... ++ + AY_1 .* AX_1 .* Z (sym_sub2ind (sz, L+1, K+1)) ... ++ + AY_1 .* AX0 .* Z (sym_sub2ind (sz, L+1, K)) ... ++ + AY_1 .* AX1 .* Z (sym_sub2ind (sz, L+1, K-1)) ... ++ + AY0 .* AX_2 .* Z (sym_sub2ind (sz, L, K+2)) ... ++ + AY0 .* AX_1 .* Z (sym_sub2ind (sz, L, K+1)) ... ++ + AY0 .* AX0 .* Z (sym_sub2ind (sz, L, K)) ... ++ + AY0 .* AX1 .* Z (sym_sub2ind (sz, L, K-1)) ... ++ + AY1 .* AX_2 .* Z (sym_sub2ind (sz, L-1, K+2)) ... ++ + AY1 .* AX_1 .* Z (sym_sub2ind (sz, L-1, K+1)) ... ++ + AY1 .* AX0 .* Z (sym_sub2ind (sz, L-1, K)) ... ++ + AY1 .* AX1 .* Z (sym_sub2ind (sz, L-1, K-1)); ++ ZI (!inside) = extrapval; ++ ++ else ++ error ("interp2: input data must have `meshgrid' format"); ++ endif + + elseif (strcmp (method, "spline")) +- ZI = __splinen__ ({Y(:,1).', X(1,:)}, Z, {YI(:,1), XI(1,:)}, extrapval, ++ if (isgriddata (XI) && isgriddata (YI')) ++ ZI = __splinen__ ({Y(:,1).', X(1,:)}, Z, {YI(:,1), XI(1,:)}, extrapval, + "spline"); ++ else ++ error ("interp2: input data must have `meshgrid' format"); ++ endif + else + error ("interpolation method not recognized"); + endif +@@ -351,6 +407,38 @@ + endif + endfunction + ++function b = isgriddata (X) ++ d1 = diff (X, 1, 1); ++ d2 = diff (X, 1, 2); ++ b = all (d1 (:) == 0) & all (d2 (:) == d2 (1)); ++endfunction ++ ++## Compute the bicubic interpolation coefficients ++function o = bc(x) ++ x = abs(x); ++ o = zeros(size(x)); ++ idx1 = (x < 1); ++ idx2 = !idx1 & (x < 2); ++ o(idx1) = 1 - 2.*x(idx1).^2 + x(idx1).^3; ++ o(idx2) = 4 - 8.*x(idx2) + 5.*x(idx2).^2 - x(idx2).^3; ++endfunction ++ ++## This version of sub2ind behaves as if the data was symmetrically padded ++function ind = sym_sub2ind(sz, Y, X) ++ Y (Y < 1) = 1 - Y (Y < 1); ++ while (any (Y (:) > 2 * sz (1))) ++ Y (Y > 2 * sz (1)) = round (Y (Y > 2 * sz (1)) / 2); ++ endwhile ++ Y (Y > sz (1)) = 1 + 2 * sz (1) - Y (Y > sz (1)); ++ X (X < 1) = 1 - X (X < 1); ++ while (any (X (:) > 2 * sz (2))) ++ X (X > 2 * sz (2)) = round (X (X > 2 * sz (2)) / 2); ++ endwhile ++ X (X > sz (2)) = 1 + 2 * sz (2) - X (X > sz (2)); ++ ind = sub2ind(sz, Y, X); ++endfunction ++ ++ + %!demo + %! A=[13,-1,12;5,4,3;1,6,2]; + %! x=[0,1,4]; y=[10,11,12]; +@@ -493,3 +581,7 @@ + %! assert(interp2(x,y,A,x,y,'linear'), A); + %! assert(interp2(x,y,A,x,y,'nearest'), A); + ++%!test % for Matlab-compatible rounding for 'nearest' ++%! X = meshgrid (1:4); ++%! assert (interp2 (X, 2.5, 2.5, 'nearest'), 3); ++ diff --git a/sci-mathematics/octave/files/octave-3.2.4-no-helvetica.patch b/sci-mathematics/octave/files/octave-3.2.4-no-helvetica.patch new file mode 100644 index 000000000000..62297c9806f3 --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.2.4-no-helvetica.patch @@ -0,0 +1,25 @@ +Don't set Helvetica as default font, it's not available as TrueType +font. Fixes Bug#477688. + + -- Rafael Laboissiere <rafael@debian.org> Sat, 19 Jul 2008 10:27:26 +0200 + +--- a/scripts/plot/__go_draw_axes__.m ++++ b/scripts/plot/__go_draw_axes__.m +@@ -1751,7 +1751,7 @@ + + function [f, s, fnt, it, bld] = get_fontname_and_size (t) + if (isempty (t.fontname)) +- fnt = "Helvetica"; ++ fnt = "*"; + else + fnt = t.fontname; + endif +@@ -1789,7 +1789,7 @@ + if (strcmp (fld, "string")) + [f, s, fnt, it, bld] = get_fontname_and_size (obj); + else +- f = "Helvetica"; ++ f = "*"; + s = 10; + fnt = f; + it = false; diff --git a/sci-mathematics/octave/files/octave-3.2.4-normal-marker-size.patch b/sci-mathematics/octave/files/octave-3.2.4-normal-marker-size.patch new file mode 100644 index 000000000000..b263498b2afe --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.2.4-normal-marker-size.patch @@ -0,0 +1,25 @@ +Revert the symbol markers in plots to their normal size. Thanks to +Francesco Potorti for the patch. + + -- Rafael Laboissiere <rafael@debian.org> Tue, 24 Feb 2009 11:40:01 +0100 + +--- a/scripts/plot/__go_draw_axes__.m ++++ b/scripts/plot/__go_draw_axes__.m +@@ -689,7 +689,7 @@ + usingclause{data_idx} = sprintf ("record=%d", numel (obj.xdata)); + + if (isfield (obj, "markersize")) +- mdat = obj.markersize / 3; ++ mdat = obj.markersize / 6; + endif + + if (isfield (obj, "edgecolor")) +@@ -1471,7 +1471,7 @@ + endif + + if (isfield (obj, "markersize")) +- fprintf (plot_stream, " pointsize %f", obj.markersize / 3); ++ fprintf (plot_stream, " pointsize %f", obj.markersize / 6); + found_style = true; + endif + else diff --git a/sci-mathematics/octave/octave-3.2.4-r3.ebuild b/sci-mathematics/octave/octave-3.2.4-r3.ebuild new file mode 100644 index 000000000000..c1920bc59ba8 --- /dev/null +++ b/sci-mathematics/octave/octave-3.2.4-r3.ebuild @@ -0,0 +1,118 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/octave/octave-3.2.4-r3.ebuild,v 1.1 2010/10/03 23:45:04 bicatali Exp $ + +EAPI="2" +inherit flag-o-matic xemacs-elisp-common autotools + +DESCRIPTION="High-level interactive language for numerical computations" +LICENSE="GPL-3" +HOMEPAGE="http://www.octave.org/" +SRC_URI="ftp://ftp.gnu.org/pub/gnu/${PN}/${P}.tar.bz2" + +SLOT="0" +IUSE="curl doc emacs fltk fftw opengl readline sparse test xemacs zlib" +KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86" + +RDEPEND="dev-libs/libpcre + media-gfx/graphicsmagick[cxx] + media-libs/qhull + sci-libs/qrupdate + sci-mathematics/glpk + sci-visualization/gnuplot + sys-libs/ncurses + virtual/lapack + x11-libs/libX11 + curl? ( net-misc/curl ) + fltk? ( x11-libs/fltk:1.1[opengl?] ) + fftw? ( sci-libs/fftw:3.0 ) + opengl? ( virtual/opengl media-libs/ftgl ) + sparse? ( sci-libs/arpack + sci-libs/camd + sci-libs/ccolamd + sci-libs/cholmod + sci-libs/colamd + sci-libs/cxsparse + sci-libs/umfpack ) + xemacs? ( app-editors/xemacs ) + zlib? ( sys-libs/zlib ) + !sci-mathematics/octave-forge" + +DEPEND="${RDEPEND} + virtual/latex-base + sys-apps/texinfo + || ( dev-texlive/texlive-genericrecommended + app-text/ptex ) + dev-util/gperf + dev-util/pkgconfig" + +src_prepare() { + epatch "${FILESDIR}"/${PN}-3.2.0_parallel_make.patch + epatch "${FILESDIR}"/${PN}-3.2.0_as_needed.patch + epatch "${FILESDIR}"/${PN}-3.2.4-imread.patch + epatch "${FILESDIR}"/${PN}-3.2.4-ldflags.patch + epatch "${FILESDIR}"/${PN}-3.2.4-fltk-magic.patch + epatch "${FILESDIR}"/${PN}-3.2.4-dlmread-speedup.patch + epatch "${FILESDIR}"/${PN}-3.2.4-addpath.patch + epatch "${FILESDIR}"/${PN}-3.2.4-filter-empty-vector.patch + epatch "${FILESDIR}"/${PN}-3.2.4-imshow.patch + epatch "${FILESDIR}"/${PN}-3.2.4-interp2.patch + epatch "${FILESDIR}"/${PN}-3.2.4-no-helvetica.patch + epatch "${FILESDIR}"/${PN}-3.2.4-normal-marker-size.patch + eautoreconf +} + +src_configure() { + # hdf5 disabled because not really useful (bug #299876) + econf \ + --localstatedir=/var/state/octave \ + --enable-shared \ + --without-hdf5 \ + --with-qrupdate \ + --with-blas="$(pkg-config --libs blas)" \ + --with-lapack="$(pkg-config --libs lapack)" \ + $(use_enable readline) \ + $(use_with curl) \ + $(use_with fftw) \ + $(use_with fltk) \ + $(use_with opengl framework-opengl) \ + $(use_with sparse arpack) \ + $(use_with sparse umfpack) \ + $(use_with sparse colamd) \ + $(use_with sparse ccolamd) \ + $(use_with sparse cholmod) \ + $(use_with sparse cxsparse) \ + $(use_with zlib) +} + +src_compile() { + emake || die "emake failed" + if use xemacs; then + cd "${S}/emacs" + xemacs-elisp-comp *.el + fi +} + +src_install() { + emake install DESTDIR="${D}" || die "emake install failed" + + if use doc; then + einfo "Installing documentation..." + insinto /usr/share/doc/${PF} + doins $(find doc -name \*.pdf) + fi + + if use emacs || use xemacs; then + cd emacs + exeinto /usr/bin + doexe octave-tags || die "Failed to install octave-tags" + doman octave-tags.1 || die "Failed to install octave-tags.1" + if use xemacs; then + xemacs-elisp-install ${PN} *.el *.elc + fi + cd .. + fi + use test && dodoc test/fntests.log + echo "LDPATH=/usr/$(get_libdir)/octave-${PV}" > 99octave + doenvd 99octave || die +} |