diff options
author | 2014-02-19 00:52:33 +0000 | |
---|---|---|
committer | 2014-02-19 00:52:33 +0000 | |
commit | 24214864afbfae10f462a09f187174ffc668b4ac (patch) | |
tree | bb498d953ba846fbcffd731b1e4e0e935fb67710 /sci-mathematics | |
parent | Version bump. (diff) | |
download | gentoo-2-24214864afbfae10f462a09f187174ffc668b4ac.tar.gz gentoo-2-24214864afbfae10f462a09f187174ffc668b4ac.tar.bz2 gentoo-2-24214864afbfae10f462a09f187174ffc668b4ac.zip |
Bump octave to 3.8.0.
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 618E971F)
Diffstat (limited to 'sci-mathematics')
11 files changed, 556 insertions, 1 deletions
diff --git a/sci-mathematics/octave/ChangeLog b/sci-mathematics/octave/ChangeLog index 98d2ae4bb647..e555b0124b33 100644 --- a/sci-mathematics/octave/ChangeLog +++ b/sci-mathematics/octave/ChangeLog @@ -1,6 +1,18 @@ # ChangeLog for sci-mathematics/octave # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/octave/ChangeLog,v 1.147 2014/01/06 14:06:23 jlec Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/octave/ChangeLog,v 1.148 2014/02/19 00:52:33 gienah Exp $ + +*octave-3.8.0 (19 Feb 2014) + + 19 Feb 2014; Mark Wright <gienah@gentoo.org> + +files/octave-3.8.0-JIT-64-bit-indexing.patch, + +files/octave-3.8.0-disable-getcwd-path-max-test-as-it-is-too-slow.patch, + +files/octave-3.8.0-fix-compile.patch, + +files/octave-3.8.0-imagemagick-configure.patch, + +files/octave-3.8.0-imagemagick.patch, +files/octave-3.8.0-llvm-3.4.patch, + +files/octave-3.8.0-llvm-configure.patch, + +files/octave-3.8.0-pkgbuilddir.patch, +octave-3.8.0.ebuild, metadata.xml: + Bump octave to 3.8.0. 06 Jan 2014; Justin Lecher <jlec@gentoo.org> -octave-3.4.3-r1.ebuild: Drop old; punt base.eclass diff --git a/sci-mathematics/octave/files/octave-3.8.0-JIT-64-bit-indexing.patch b/sci-mathematics/octave/files/octave-3.8.0-JIT-64-bit-indexing.patch new file mode 100644 index 000000000000..fc8d6c5884c3 --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.8.0-JIT-64-bit-indexing.patch @@ -0,0 +1,77 @@ + +# HG changeset patch +# User Lasse Schuirmann <lasse@schuirmann.net> +# Date 1389727640 28800 +# Node ID e243b705a726cbcef27fc3c88da984614eece2bc +# Parent ec975e8267288372e957d5b81c8185b504492ba3 +Fix building JIT with 64-bit indexing (bug #41163). + +jit-typeinfo.cc (jit_typeinfo): Create two constants for the value 1. One +constant (one_idx) is of type index_t and the other (one_int) is of int_t. Use +these constants when comparing to objects of the matching type. + +diff --git a/libinterp/corefcn/jit-typeinfo.cc b/libinterp/corefcn/jit-typeinfo.cc +--- a/libinterp/corefcn/jit-typeinfo.cc ++++ b/libinterp/corefcn/jit-typeinfo.cc +@@ -1609,12 +1609,8 @@ + body = fn.new_block (); + builder.SetInsertPoint (body); + { +- llvm::Value *one = llvm::ConstantInt::get (index_t, 1); +- llvm::Value *ione; +- if (index_t == int_t) +- ione = one; +- else +- ione = llvm::ConstantInt::get (int_t, 1); ++ llvm::Value *one_idx = llvm::ConstantInt::get (index_t, 1); ++ llvm::Value *one_int = llvm::ConstantInt::get (int_t, 1); + + llvm::Value *undef = llvm::UndefValue::get (scalar_t); + llvm::Value *mat = fn.argument (builder, 0); +@@ -1624,7 +1620,7 @@ + llvm::Value *int_idx = builder.CreateFPToSI (idx, index_t); + llvm::Value *check_idx = builder.CreateSIToFP (int_idx, scalar_t); + llvm::Value *cond0 = builder.CreateFCmpUNE (idx, check_idx); +- llvm::Value *cond1 = builder.CreateICmpSLT (int_idx, one); ++ llvm::Value *cond1 = builder.CreateICmpSLT (int_idx, one_idx); + llvm::Value *cond = builder.CreateOr (cond0, cond1); + + llvm::BasicBlock *done = fn.new_block ("done"); +@@ -1647,7 +1643,7 @@ + builder.CreateCondBr (cond, bounds_error, success); + + builder.SetInsertPoint (bounds_error); +- gindex_range.call (builder, ione, ione, int_idx, len); ++ gindex_range.call (builder, one_int, one_int, int_idx, len); + builder.CreateBr (done); + + builder.SetInsertPoint (success); +@@ -1681,7 +1677,8 @@ + body = fn.new_block (); + builder.SetInsertPoint (body); + { +- llvm::Value *one = llvm::ConstantInt::get (index_t, 1); ++ llvm::Value *one_idx = llvm::ConstantInt::get (index_t, 1); ++ llvm::Value *one_int = llvm::ConstantInt::get (int_t, 1); + + llvm::Value *mat = fn.argument (builder, 0); + llvm::Value *idx = fn.argument (builder, 1); +@@ -1690,7 +1687,7 @@ + llvm::Value *int_idx = builder.CreateFPToSI (idx, index_t); + llvm::Value *check_idx = builder.CreateSIToFP (int_idx, scalar_t); + llvm::Value *cond0 = builder.CreateFCmpUNE (idx, check_idx); +- llvm::Value *cond1 = builder.CreateICmpSLT (int_idx, one); ++ llvm::Value *cond1 = builder.CreateICmpSLT (int_idx, one_idx); + llvm::Value *cond = builder.CreateOr (cond0, cond1); + + llvm::BasicBlock *done = fn.new_block ("done"); +@@ -1708,7 +1705,7 @@ + + llvm::Value *rcount = builder.CreateExtractValue (mat, 0); + rcount = builder.CreateLoad (rcount); +- cond1 = builder.CreateICmpSGT (rcount, one); ++ cond1 = builder.CreateICmpSGT (rcount, one_int); + cond = builder.CreateOr (cond0, cond1); + + llvm::BasicBlock *bounds_error = fn.new_block ("bounds_error", done); + diff --git a/sci-mathematics/octave/files/octave-3.8.0-disable-getcwd-path-max-test-as-it-is-too-slow.patch b/sci-mathematics/octave/files/octave-3.8.0-disable-getcwd-path-max-test-as-it-is-too-slow.patch new file mode 100644 index 000000000000..135330d2f45a --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.8.0-disable-getcwd-path-max-test-as-it-is-too-slow.patch @@ -0,0 +1,11 @@ +--- octave-3.8.0-orig/m4/getcwd.m4 2013-12-28 09:00:39.000000000 +1100 ++++ octave-3.8.0/m4/getcwd.m4 2014-02-15 13:11:06.783512435 +1100 +@@ -108,7 +108,7 @@ + + gl_abort_bug=no + case "$host_os" in +- mingw*) ++ *-gnu* | gnu* | mingw*) + gl_cv_func_getcwd_path_max=yes + ;; + *) diff --git a/sci-mathematics/octave/files/octave-3.8.0-fix-compile.patch b/sci-mathematics/octave/files/octave-3.8.0-fix-compile.patch new file mode 100644 index 000000000000..72931ee66283 --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.8.0-fix-compile.patch @@ -0,0 +1,11 @@ +--- octave-3.8.0-orig/libinterp/corefcn/jit-typeinfo.cc 2013-12-28 08:57:41.000000000 +1100 ++++ octave-3.8.0/libinterp/corefcn/jit-typeinfo.cc 2014-02-14 15:45:47.388031654 +1100 +@@ -872,7 +872,7 @@ + jit_operation::to_idx (const std::vector<jit_type*>& types) const + { + octave_idx_type numel = types.size (); +- numel = std::max (2, numel); ++ numel = std::max (static_cast<octave_idx_type>(2), numel); + + Array<octave_idx_type> idx (dim_vector (1, numel)); + for (octave_idx_type i = 0; i < static_cast<octave_idx_type> (types.size ()); diff --git a/sci-mathematics/octave/files/octave-3.8.0-imagemagick-configure.patch b/sci-mathematics/octave/files/octave-3.8.0-imagemagick-configure.patch new file mode 100644 index 000000000000..1406237fea44 --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.8.0-imagemagick-configure.patch @@ -0,0 +1,16 @@ +--- octave-3.8.0-orig/configure.ac 2013-12-28 08:58:28.000000000 +1100 ++++ octave-3.8.0/configure.ac 2014-02-15 20:11:53.821172574 +1100 +@@ -995,11 +995,11 @@ + MAGICK_LIBS= + + PKG_CHECK_EXISTS([$magick++], [ +- ## Make sure we only get -I, -L, and -l flags. Some Graphics/ImageMagick++ ++ ## Make sure we only get -I, -D, -L, and -l flags. Some Graphics/ImageMagick++ + ## packages add extra flags that are useful when building + ## Graphics/ImageMagick++ extentions. These extra flags break the + ## Octave build. +- MAGICK_CPPFLAGS=`$PKG_CONFIG --cflags-only-I $magick++` ++ MAGICK_CPPFLAGS=`$PKG_CONFIG --cflags $magick++ | sed -e 's/\(-@<:@DI@:>@@<:@^ \t@:>@*\)\|\(-@<:@^ \t@:>@*\)/\1/g'` + MAGICK_LDFLAGS=`$PKG_CONFIG --libs-only-L $magick++` + MAGICK_LIBS=`$PKG_CONFIG --libs-only-l $magick++` + diff --git a/sci-mathematics/octave/files/octave-3.8.0-imagemagick.patch b/sci-mathematics/octave/files/octave-3.8.0-imagemagick.patch new file mode 100644 index 000000000000..8dc94ca6feb2 --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.8.0-imagemagick.patch @@ -0,0 +1,110 @@ +--- octave-3.8.0-orig/libinterp/dldfcn/__magick_read__.cc 2013-12-28 08:57:41.000000000 +1100 ++++ octave-3.8.0/libinterp/dldfcn/__magick_read__.cc 2014-02-15 00:12:10.909254448 +1100 +@@ -38,7 +38,7 @@ + #include "gripes.h" + + #ifdef HAVE_MAGICK +- ++#define MAGICKCORE_EXCLUDE_DEPRECATED 1 + #include <Magick++.h> + #include <clocale> + +@@ -332,7 +332,10 @@ + if (imvec[def_elem].depth () == 32) + divisor = std::numeric_limits<uint32_t>::max (); + else +- divisor = MaxRGB / ((uint64_t (1) << imvec[def_elem].depth ()) - 1); ++ { ++ using namespace Magick; ++ divisor = QuantumRange / ((uint64_t (1) << imvec[def_elem].depth ()) - 1); ++ } + + // FIXME: this workaround should probably be fixed in GM by creating a + // new ImageType BilevelMatteType +@@ -463,7 +466,8 @@ + for (octave_idx_type row = 0; row < nRows; row++) + { + img_fvec[idx] = pix->red / divisor; +- a_fvec[idx] = (MaxRGB - pix->opacity) / divisor; ++ using namespace Magick; ++ a_fvec[idx] = (QuantumRange - pix->opacity) / divisor; + pix += row_shift; + idx++; + } +@@ -538,7 +542,8 @@ + rbuf[idx] = pix->red / divisor; + gbuf[idx] = pix->green / divisor; + bbuf[idx] = pix->blue / divisor; +- a_fvec[a_idx++] = (MaxRGB - pix->opacity) / divisor; ++ using namespace Magick; ++ a_fvec[a_idx++] = (QuantumRange - pix->opacity) / divisor; + pix += row_shift; + idx++; + } +@@ -620,7 +625,8 @@ + mbuf[idx] = pix->green / divisor; + ybuf[idx] = pix->blue / divisor; + kbuf[idx] = pix->opacity / divisor; +- a_fvec[a_idx++] = (MaxRGB - *apix) / divisor; ++ using namespace Magick; ++ a_fvec[a_idx++] = (QuantumRange - *apix) / divisor; + pix += row_shift; + idx++; + } +@@ -678,9 +684,10 @@ + // Restore locale from before GraphicsMagick initialisation + setlocale (LC_ALL, locale.c_str ()); + +- if (QuantumDepth < 32) ++ using namespace Magick; ++ if (MAGICKCORE_QUANTUM_DEPTH < 32) + warning ("your version of %s limits images to %d bits per pixel", +- MagickPackageName, QuantumDepth); ++ MagickPackageName, MAGICKCORE_QUANTUM_DEPTH); + + initialized = true; + } +@@ -1053,8 +1060,9 @@ + // From GM documentation: + // Color arguments are must be scaled to fit the Quantum size according to + // the range of MaxRGB ++ using namespace Magick; + const double divisor = static_cast<double>((uint64_t (1) << bitdepth) - 1) +- / MaxRGB; ++ / QuantumRange; + + const P *img_fvec = img.fortran_vec (); + const P *a_fvec = alpha.fortran_vec (); +@@ -1105,7 +1113,8 @@ + { + Magick::Color c; + c.redQuantum (double (*img_fvec) / divisor); +- c.alphaQuantum (MaxRGB - (double (*a_fvec) / divisor)); ++ using namespace Magick; ++ c.alphaQuantum (QuantumRange - (double (*a_fvec) / divisor)); + pix[GM_idx] = c; + img_fvec++; + a_fvec++; +@@ -1170,10 +1179,11 @@ + { + for (octave_idx_type row = 0; row < nRows; row++) + { ++ using namespace Magick; + Magick::Color c (double (*img_fvec) / divisor, + double (img_fvec[G_offset]) / divisor, + double (img_fvec[B_offset]) / divisor, +- MaxRGB - (double (*a_fvec) / divisor)); ++ QuantumRange - (double (*a_fvec) / divisor)); + pix[GM_idx] = c; + img_fvec++; + a_fvec++; +@@ -1247,7 +1257,8 @@ + double (img_fvec[Y_offset]) / divisor, + double (img_fvec[K_offset]) / divisor); + pix[GM_idx] = c; +- ind[GM_idx] = MaxRGB - (double (*a_fvec) / divisor); ++ using namespace Magick; ++ ind[GM_idx] = QuantumRange - (double (*a_fvec) / divisor); + img_fvec++; + a_fvec++; + GM_idx += nCols; diff --git a/sci-mathematics/octave/files/octave-3.8.0-llvm-3.4.patch b/sci-mathematics/octave/files/octave-3.8.0-llvm-3.4.patch new file mode 100644 index 000000000000..63c5303d13c7 --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.8.0-llvm-3.4.patch @@ -0,0 +1,63 @@ +diff -aur octave-3.8.0/libinterp/corefcn/jit-util.h octave-3.8.0.fix/libinterp/corefcn/jit-util.h +--- octave-3.8.0/libinterp/corefcn/jit-util.h 2013-12-27 15:57:41.000000000 -0600 ++++ octave-3.8.0.fix/libinterp/corefcn/jit-util.h 2014-01-16 17:06:47.512782643 -0600 +@@ -42,8 +42,10 @@ + { + class Value; + class Module; +- class FunctionPassManager; +- class PassManager; ++ namespace legacy { ++ class FunctionPassManager; ++ class PassManager; ++ } + class ExecutionEngine; + class Function; + class BasicBlock; +diff -aur octave-3.8.0/libinterp/corefcn/pt-jit.cc octave-3.8.0.fix/libinterp/corefcn/pt-jit.cc +--- octave-3.8.0/libinterp/corefcn/pt-jit.cc 2013-12-27 15:58:17.000000000 -0600 ++++ octave-3.8.0.fix/libinterp/corefcn/pt-jit.cc 2014-01-16 17:08:28.030924785 -0600 +@@ -52,7 +52,7 @@ + #include <llvm/Bitcode/ReaderWriter.h> + #include <llvm/ExecutionEngine/ExecutionEngine.h> + #include <llvm/ExecutionEngine/JIT.h> +-#include <llvm/PassManager.h> ++#include <llvm/IR/LegacyPassManager.h> + + #ifdef HAVE_LLVM_IR_FUNCTION_H + #include <llvm/IR/LLVMContext.h> +@@ -1888,10 +1888,10 @@ + if (! engine) + return false; + +- module_pass_manager = new llvm::PassManager (); ++ module_pass_manager = new llvm::legacy::PassManager (); + module_pass_manager->add (llvm::createAlwaysInlinerPass ()); + +- pass_manager = new llvm::FunctionPassManager (module); ++ pass_manager = new llvm::legacy::FunctionPassManager (module); + #ifdef HAVE_LLVM_DATALAYOUT + pass_manager->add (new llvm::DataLayout (*engine->getDataLayout ())); + #else +@@ -2007,7 +2007,7 @@ + { + std::string error; + llvm::raw_fd_ostream fout ("test.bc", error, +- llvm::raw_fd_ostream::F_Binary); ++ llvm::sys::fs::F_Binary); + llvm::WriteBitcodeToFile (module, fout); + } + } +diff -aur octave-3.8.0/libinterp/corefcn/pt-jit.h octave-3.8.0.fix/libinterp/corefcn/pt-jit.h +--- octave-3.8.0/libinterp/corefcn/pt-jit.h 2013-12-27 15:58:17.000000000 -0600 ++++ octave-3.8.0.fix/libinterp/corefcn/pt-jit.h 2014-01-16 17:05:08.224619116 -0600 +@@ -384,8 +384,8 @@ + size_t trip_count (const octave_value& bounds) const; + + llvm::Module *module; +- llvm::PassManager *module_pass_manager; +- llvm::FunctionPassManager *pass_manager; ++ llvm::legacy::PassManager *module_pass_manager; ++ llvm::legacy::FunctionPassManager *pass_manager; + llvm::ExecutionEngine *engine; + }; diff --git a/sci-mathematics/octave/files/octave-3.8.0-llvm-configure.patch b/sci-mathematics/octave/files/octave-3.8.0-llvm-configure.patch new file mode 100644 index 000000000000..82c6c1458093 --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.8.0-llvm-configure.patch @@ -0,0 +1,12 @@ +--- octave-3.8.0-orig/configure.ac 2013-12-28 08:58:28.000000000 +1100 ++++ octave-3.8.0/configure.ac 2014-02-15 20:51:21.431570121 +1100 +@@ -805,7 +805,8 @@ + dnl Use -isystem so we don't get warnings from llvm headers + LLVM_CPPFLAGS="$LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`" + LLVM_CXXFLAGS= +- LLVM_LDFLAGS="-L`$LLVM_CONFIG --libdir`" ++ dnl If llvm-config --ldflags has -L ending with /llvm then specify this directory with -R ++ LLVM_LDFLAGS="`$LLVM_CONFIG --ldflags | sed -e 's/-L\(@<:@^ \t@:>@*\/llvm\)/-L\1 -R\1/' -e 's/-@<:@^LR@:>@.*@<:@ \t@:>@//g'`" + + + LDFLAGS="$LDFLAGS $LLVM_LDFLAGS" diff --git a/sci-mathematics/octave/files/octave-3.8.0-pkgbuilddir.patch b/sci-mathematics/octave/files/octave-3.8.0-pkgbuilddir.patch new file mode 100644 index 000000000000..983f6b54ac57 --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.8.0-pkgbuilddir.patch @@ -0,0 +1,40 @@ +--- octave-3.8.0-orig/scripts/pkg/private/install.m 2013-12-28 08:57:42.000000000 +1100 ++++ octave-3.8.0/scripts/pkg/private/install.m 2014-02-10 00:59:40.747194765 +1100 +@@ -63,6 +63,14 @@ + tgz = files{i}; + + if (exist (tgz, "file")) ++ ## The filename pointed to an uncompressed package to begin with. ++ if (exist (tgz, "dir")) ++ if (tgz(1) == '/') ++ packdir = tgz; ++ else ++ packdir = fullfile (pwd(), tgz); ++ endif ++ elseif (exist (tgz, "file")) + ## Create a temporary directory. + tmpdir = tmpnam (); + tmpdirs{end+1} = tmpdir; +@@ -89,20 +97,12 @@ + if (length (dirlist) > 3) + error ("bundles of packages are not allowed"); + endif +- endif + +- ## The filename pointed to an uncompressed package to begin with. +- if (exist (tgz, "dir")) +- dirlist = {".", "..", tgz}; ++ ## The two first entries of dirlist are "." and "..". ++ packdir = fullfile (tmpdir, dirlist{3}); + endif + + if (exist (tgz, "file") || exist (tgz, "dir")) +- ## The two first entries of dirlist are "." and "..". +- if (exist (tgz, "file")) +- packdir = fullfile (tmpdir, dirlist{3}); +- else +- packdir = fullfile (pwd (), dirlist{3}); +- endif + packdirs{end+1} = packdir; + + ## Make sure the package contains necessary files. diff --git a/sci-mathematics/octave/metadata.xml b/sci-mathematics/octave/metadata.xml index c2dde1ee64bd..96894a89c9c3 100644 --- a/sci-mathematics/octave/metadata.xml +++ b/sci-mathematics/octave/metadata.xml @@ -11,6 +11,7 @@ </longdescription> <use> <flag name="glpk">Add support for <pkg>sci-libs/glpk</pkg> for linear programming</flag> + <flag name="jit">(EXPERIMENTAL) enable JIT compiler</flag> <flag name="qhull">Add support for <pkg>sci-libs/qhull</pkg>, to allow `delaunay', `convhull', and related functions</flag> <flag name="qrupdate">Add support for <pkg>sci-libs/qrupdate</pkg>for QR and Cholesky update functions</flag> <flag name="sparse">Add enhanced support for sparse matrix algebra with SuiteSparse</flag> diff --git a/sci-mathematics/octave/octave-3.8.0.ebuild b/sci-mathematics/octave/octave-3.8.0.ebuild new file mode 100644 index 000000000000..807336a03133 --- /dev/null +++ b/sci-mathematics/octave/octave-3.8.0.ebuild @@ -0,0 +1,202 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/octave/octave-3.8.0.ebuild,v 1.1 2014/02/19 00:52:33 gienah Exp $ + +EAPI=5 + +AUTOTOOLS_AUTORECONF=1 +AUTOTOOLS_IN_SOURCE_BUILD=1 + +inherit autotools-utils multilib toolchain-funcs fortran-2 flag-o-matic java-pkg-opt-2 pax-utils + +DESCRIPTION="High-level interactive language for numerical computations" +LICENSE="GPL-3" +HOMEPAGE="http://www.octave.org/" +SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2" + +SLOT="0/${PV}" +IUSE="curl doc fftw +glpk gnuplot hdf5 +imagemagick java jit opengl postscript + +qhull +qrupdate readline +sparse static-libs X zlib" +KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" + +RDEPEND=" + app-text/ghostscript-gpl + dev-libs/libpcre + sys-libs/ncurses + jit? ( !hppa? ( sys-devel/llvm ) ) + virtual/lapack + curl? ( net-misc/curl ) + fftw? ( sci-libs/fftw:3.0 ) + glpk? ( sci-mathematics/glpk ) + gnuplot? ( sci-visualization/gnuplot ) + hdf5? ( sci-libs/hdf5 ) + imagemagick? ( || ( + media-gfx/graphicsmagick[cxx] + >=media-gfx/imagemagick-6.8.8.5[cxx] ) ) + opengl? ( + media-libs/freetype:2 + media-libs/fontconfig + >=x11-libs/fltk-1.3:1[opengl] + !hppa? ( x11-libs/gl2ps ) + virtual/glu ) + postscript? ( + app-text/epstool + media-gfx/pstoedit + media-gfx/transfig ) + qhull? ( media-libs/qhull ) + qrupdate? ( sci-libs/qrupdate ) + readline? ( sys-libs/readline ) + sparse? ( + sci-libs/arpack + sci-libs/camd + sci-libs/ccolamd + sci-libs/cholmod + sci-libs/colamd + sci-libs/cxsparse + sci-libs/umfpack ) + X? ( x11-libs/libX11 ) + zlib? ( sys-libs/zlib )" + +DEPEND="${RDEPEND} + qrupdate? ( app-misc/pax-utils ) + sparse? ( app-misc/pax-utils ) + doc? ( + virtual/latex-base + dev-texlive/texlive-genericrecommended + dev-texlive/texlive-metapost + sys-apps/texinfo ) + dev-util/gperf + virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/${PN}-3.8.0-pkgbuilddir.patch + "${FILESDIR}"/${PN}-3.4.3-texi.patch + "${FILESDIR}"/${PN}-3.8.0-imagemagick-configure.patch + "${FILESDIR}"/${PN}-3.8.0-imagemagick.patch + "${FILESDIR}"/${PN}-3.8.0-fix-compile.patch + "${FILESDIR}"/${PN}-3.8.0-llvm-configure.patch + "${FILESDIR}"/${PN}-3.8.0-JIT-64-bit-indexing.patch + "${FILESDIR}"/${PN}-3.8.0-disable-getcwd-path-max-test-as-it-is-too-slow.patch +) + +pkg_pretend() { + if use qrupdate || use sparse; then + local blaslib=$(pkg-config --libs-only-l "blas" | sed -e 's@.*-l@lib@' | cut -d' ' -f 1) + einfo "Checking dependencies are built wtih the same blas lib = ${blaslib}" + local usr_lib="${ROOT}usr/$(get_libdir)" + local libs=( ) + use qrupdate && libs+=( "${usr_lib}"/libqrupdate.so ) + use sparse && libs+=( + "${usr_lib}"/libarpack.so + "${usr_lib}"/libcholmod.so + "${usr_lib}"/libspqr.so + "${usr_lib}"/libumfpack.so + ) + for i in ${libs[*]} + do + # Is it not linked with the current blas? This check is not enough though, as + # earlier versions of sci-libs/cholmod were not linked with blas, while as later + # versions are if built with the lapack use flag. + scanelf -n ${i} | grep -q "${blaslib}" + if [[ $? != 0 ]]; then + # Does it appear to be linked with some blas or lapack library? + scanelf -n ${i} | egrep -q "blas|lapack" + if [[ $? == 0 ]]; then + eerror "*******************************************************************************" + eerror "${i} must be rebuilt with ${blaslib}" + eerror "" + eerror "To check the libaries ${i} is currently built with:" + eerror "" + eerror "scanelf -n ${i}" + eerror "" + eerror "To find the package that needs to be rebuilt:" + eerror "" + eerror "equery belongs ${i}" + eerror "*******************************************************************************" + die + fi + fi + done + fi +} + +src_prepare() { + # nasty prefix hack for fltk:1 linking + if use prefix && use opengl; then + sed -i \ + -e "s:ldflags\`:ldflags\` -Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/fltk-1:" \ + configure.ac + fi + if has_version ">=sys-devel/llvm-3.4"; then + epatch "${FILESDIR}"/${PN}-3.8.0-llvm-3.4.patch + fi + if use hppa && use opengl; then + ewarn "http://www.gnu.org/software/octave/NEWS-3.8.html says Printing or saving figures" + ewarn "with OpenGL graphics requires the gl2ps - but at the time of writing x11-libs/gl2ps" + ewarn "does not have the hppa keyword" + fi + autotools-utils_src_prepare +} + +src_configure() { + # occasional fail on install, force regeneration (bug #401189) + rm doc/interpreter/contributors.texi || die + + # unfortunate dependency on mpi from hdf5 (bug #302621) + use hdf5 && has_version sci-libs/hdf5[mpi] && \ + export CXX=mpicxx CC=mpicc FC=mpif77 F77=mpif77 + + local myeconfargs=( + --localstatedir="${EPREFIX}/var/state/octave" + --with-blas="$($(tc-getPKG_CONFIG) --libs blas)" + --with-lapack="$($(tc-getPKG_CONFIG) --libs lapack)" + $(use_enable doc docs) + $(use_enable java) + $(use_enable opengl gui) + $(use_enable jit) + $(use_enable readline) + $(use_with curl) + $(use_with fftw fftw3) + $(use_with fftw fftw3f) + $(use_enable fftw fftw-threads) + $(use_with glpk) + $(use_with hdf5) + $(use_with opengl) + $(use_with qhull) + $(use_with qrupdate) + $(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 X x) + $(use_with zlib z) + ) + if use imagemagick; then + if has_version media-gfx/graphicsmagick[cxx]; then + myeconfargs+=( "--with-magick=GraphicsMagick" ) + else + myeconfargs+=( "--with-magick=ImageMagick" ) + fi + else + myeconfargs+=( "--without-magick" ) + fi + autotools-utils_src_configure +} + +src_compile() { + emake + if use java || use jit ; then + pax-mark m "${S}/src/.libs/octave-cli" + fi +} + +src_install() { + autotools-utils_src_install + use doc && dodoc $(find doc -name \*.pdf) + [[ -e test/fntests.log ]] && dodoc test/fntests.log + use java && java-pkg_regjar "${ED}/usr/share/${PN}/${PV}/m/java/octave.jar" + echo "LDPATH=${EROOT%/}/usr/$(get_libdir)/${P}" > 99octave + doenvd 99octave +} |