summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sci-mathematics/octave
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sci-mathematics/octave')
-rw-r--r--sci-mathematics/octave/Manifest4
-rw-r--r--sci-mathematics/octave/files/octave-3.4.3-pkgbuilddir.patch44
-rw-r--r--sci-mathematics/octave/files/octave-3.4.3-texi.patch11
-rw-r--r--sci-mathematics/octave/files/octave-3.6.3-legendtext.patch13
-rw-r--r--sci-mathematics/octave/files/octave-3.6.4-gcc-4.8.patch34
-rw-r--r--sci-mathematics/octave/files/octave-3.6.4-texinfo.patch378
-rw-r--r--sci-mathematics/octave/files/octave-3.8.0-disable-getcwd-path-max-test-as-it-is-too-slow.patch11
-rw-r--r--sci-mathematics/octave/files/octave-3.8.0-fix-compile.patch11
-rw-r--r--sci-mathematics/octave/files/octave-3.8.0-imagemagick-configure.patch16
-rw-r--r--sci-mathematics/octave/files/octave-3.8.0-llvm-3.4.patch63
-rw-r--r--sci-mathematics/octave/files/octave-3.8.0-llvm-configure.patch12
-rw-r--r--sci-mathematics/octave/files/octave-3.8.0-pkgbuilddir.patch40
-rw-r--r--sci-mathematics/octave/files/octave-3.8.1-imagemagick.patch138
-rw-r--r--sci-mathematics/octave/files/octave-3.8.1-pkgbuilddir.patch41
-rw-r--r--sci-mathematics/octave/files/octave-4.0.0-imagemagick-configure.patch16
-rw-r--r--sci-mathematics/octave/files/octave-4.0.0-imagemagick.patch139
-rw-r--r--sci-mathematics/octave/files/octave-4.0.0-llvm-3.5-gnulib-hg.patch19
-rw-r--r--sci-mathematics/octave/files/octave-4.0.0-llvm-3.5.patch130
-rw-r--r--sci-mathematics/octave/metadata.xml20
-rw-r--r--sci-mathematics/octave/octave-3.6.4-r1.ebuild134
-rw-r--r--sci-mathematics/octave/octave-3.6.4.ebuild132
-rw-r--r--sci-mathematics/octave/octave-3.8.1-r1.ebuild163
-rw-r--r--sci-mathematics/octave/octave-3.8.1.ebuild202
-rw-r--r--sci-mathematics/octave/octave-3.8.2.ebuild163
-rw-r--r--sci-mathematics/octave/octave-4.0.0.ebuild169
25 files changed, 2103 insertions, 0 deletions
diff --git a/sci-mathematics/octave/Manifest b/sci-mathematics/octave/Manifest
new file mode 100644
index 000000000000..ec9e36b2543b
--- /dev/null
+++ b/sci-mathematics/octave/Manifest
@@ -0,0 +1,4 @@
+DIST octave-3.6.4.tar.bz2 15627315 SHA256 fa185df9591f5d740f4d37ff6eaf06db576fdd3e0ddd9d0737365799e5d1c962 SHA512 a49ef50161272618c9543057be5903e1e50b7f4ecb929777f6715d4b3a07a92c36a5b13958c52d8b942b6c7e7e3f7844409d0062eb02bdb3972d7194312b7a81 WHIRLPOOL f51c764ce1ed911661bb3dd1d31a2321f09c0d887ead7bbe8c1f4ad1ebe05137223afb5ff18fc57b83d631936975964a85e4fed9a087760935acb5a35050cda0
+DIST octave-3.8.1.tar.bz2 17664241 SHA256 d6762ed2ad4a042243a095fb44c7a1d3a91c635b6dca37fcef15a5efdffa9bbd SHA512 673ff37692d2ef1116a10afb36448494e69cb01de609017af1a72c3258a1fe71012e9986aafc29127509f7e6664127b4e9b7f269322820b3464eb30ab4b4ef7f WHIRLPOOL 85729283a65051159245f31ab53951c756ea55d1cc93518dbb55b740329a89cffbdf3679ae8d2b957e1a4b47dbf5f2dd9d60f51acf32e159d821979661a5fa54
+DIST octave-3.8.2.tar.bz2 17834980 SHA256 83bbd701aab04e7e57d0d5b8373dd54719bebb64ce0a850e69bf3d7454f33bae SHA512 c2bf4cc844a5b8dbabf2b54d2458ee7573f87dc92ca8cd7829e8c057591387b3a0995b5b48c6e50ff2944411f2b28521de26e438ed431f68ab5b49b8ce1d94cc WHIRLPOOL c117b935a060572577b3506a508d558a2af85b2785af02647e9edc47c5df97e357d954449edc90cc40a6af3230f99faccf6c7cf1b9b2bc6044f35749d3ae1af0
+DIST octave-4.0.0.tar.xz 15759196 SHA256 cf6be2fac6796fda68971e249c96d026ce4a1b0ed074ce49a5791365a958c474 SHA512 54559686d017b7fe731a89a24e74d08781365028d2799a86f25ebf4c433013eab03e5b4381a992b79e40bce1827a6eee2aefd0798b739128dd8dd7b41d936b89 WHIRLPOOL 0e0154dac5ac76268d99533186a88f54bc811817cdf2222c3c0bc22ff456fd23829f7015eebcb9d441665c1d2782ed57c06ab00880f64d63b22ef4aad43f132a
diff --git a/sci-mathematics/octave/files/octave-3.4.3-pkgbuilddir.patch b/sci-mathematics/octave/files/octave-3.4.3-pkgbuilddir.patch
new file mode 100644
index 000000000000..5340c9a19b92
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-3.4.3-pkgbuilddir.patch
@@ -0,0 +1,44 @@
+Description: Allow installation of already extracted packages with pkg.m
+Forwarded: not-needed
+Author: Thomas Weber <tweber@debian.org>
+--- scripts/pkg/pkg.m.orig 2011-02-08 03:00:51.000000000 -0700
++++ scripts/pkg/pkg.m 2011-03-18 09:31:24.670165643 -0600
+@@ -644,7 +644,14 @@
+ for i = 1:length (files)
+ 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;
+@@ -671,20 +678,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/files/octave-3.4.3-texi.patch b/sci-mathematics/octave/files/octave-3.4.3-texi.patch
new file mode 100644
index 000000000000..661ddae4198a
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-3.4.3-texi.patch
@@ -0,0 +1,11 @@
+--- doc/interpreter/Makefile.am.orig 2012-01-31 17:47:52.000000000 +0000
++++ doc/interpreter/Makefile.am 2012-01-31 17:49:37.000000000 +0000
+@@ -202,6 +202,8 @@
+ $(AWK) -f $(srcdir)/mkcontrib.awk $(srcdir)/contributors.in > $@-t
+ mv $@-t $@
+
++preface.texi: contributors.texi
++
+ ../../AUTHORS: preface.texi contributors.texi
+ rm -f AUTHORS
+ -$(MAKEINFO) -D AUTHORSONLY \
diff --git a/sci-mathematics/octave/files/octave-3.6.3-legendtext.patch b/sci-mathematics/octave/files/octave-3.6.3-legendtext.patch
new file mode 100644
index 000000000000..046c721fdb22
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-3.6.3-legendtext.patch
@@ -0,0 +1,13 @@
+should be fixed in octave-3.8 and above
+
+--- src/gl2ps-renderer.cc.orig 2012-05-31 03:43:29.000000000 +0200
++++ src/gl2ps-renderer.cc 2012-10-10 18:41:10.526639551 +0200
+@@ -223,7 +223,7 @@
+
+ // FIXME: handle margin and surrounding box
+
+- glRasterPos3d (pos(0), pos(1), pos(2));
++ glRasterPos3d (pos(0), pos(1), pos.numel() > 2 ? pos(2) : 0.0);
+
+ octave_value string_prop = props.get_string ();
+
diff --git a/sci-mathematics/octave/files/octave-3.6.4-gcc-4.8.patch b/sci-mathematics/octave/files/octave-3.6.4-gcc-4.8.patch
new file mode 100644
index 000000000000..1e13ebce38e2
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-3.6.4-gcc-4.8.patch
@@ -0,0 +1,34 @@
+Description: Fix compilation of C++ MEX files with GCC 4.8
+ The header mex.h was including mexproto.h within an extern "C" block. In turn,
+ mexproto.h includes cstdlib.
+ .
+ Apparently, including cstdlib within an extern "C" block was working with GCC
+ 4.7, but this is no longer the case with GCC 4.8.
+ .
+ The fix consists in including mexproto.h outside of the extern "C" block.
+Author: Sébastien Villemot <sebastien@debian.org>
+Bug: https://savannah.gnu.org/bugs/index.php?38746
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=705485
+Last-Update: 2013-05-29
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/mex.h
++++ b/src/mex.h
+@@ -64,6 +64,8 @@
+
+ #define mxMAXNAME 64
+
++#include "mexproto.h"
++
+ #if defined (__cplusplus)
+ extern "C" {
+ #endif
+@@ -74,8 +76,6 @@
+ void mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray *prhs[]);
+ #endif
+
+-#include "mexproto.h"
+-
+ /* V4 floating point routines renamed in V5. */
+ #define mexIsNaN mxIsNaN
+ #define mexIsFinite mxIsFinite
diff --git a/sci-mathematics/octave/files/octave-3.6.4-texinfo.patch b/sci-mathematics/octave/files/octave-3.6.4-texinfo.patch
new file mode 100644
index 000000000000..67f876f7bc42
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-3.6.4-texinfo.patch
@@ -0,0 +1,378 @@
+diff -Nur octave-3.6.4.orig/doc/interpreter/audio.texi octave-3.6.4/doc/interpreter/audio.texi
+--- octave-3.6.4.orig/doc/interpreter/audio.texi 2013-02-21 12:37:50.000000000 -0800
++++ octave-3.6.4/doc/interpreter/audio.texi 2013-06-19 08:52:43.259790240 -0700
+@@ -146,18 +146,18 @@
+ Load the RIFF/WAVE sound file @var{filename}, and return the samples
+ in vector @var{y}. If the file contains multichannel data, then
+ @var{y} is a matrix with the channels represented as columns.
+-
+-@deftypefnx {Function File} {[@var{y}, @var{Fs}, @var{bps}] =} wavread (@var{filename})
++@end deftypefn
++@deftypefn {Function File} {[@var{y}, @var{Fs}, @var{bps}] =} wavread (@var{filename})
+ Additionally return the sample rate (@var{fs}) in Hz and the number of bits
+ per sample (@var{bps}).
+-
+-@deftypefnx {Function File} {[@dots{}] =} wavread (@var{filename}, @var{n})
++@end deftypefn
++@deftypefn {Function File} {[@dots{}] =} wavread (@var{filename}, @var{n})
+ Read only the first @var{n} samples from each channel.
+-
+-@deftypefnx {Function File} {[@dots{}] =} wavread (@var{filename}, @var{n1} @var{n2})
++@end deftypefn
++@deftypefn {Function File} {[@dots{}] =} wavread (@var{filename}, @var{n1} @var{n2})
+ Read only samples @var{n1} through @var{n2} from each channel.
+-
+-@deftypefnx {Function File} {[@var{samples}, @var{channels}] =} wavread (@var{filename}, "size")
++@end deftypefn
++@deftypefn {Function File} {[@var{samples}, @var{channels}] =} wavread (@var{filename}, "size")
+ Return the number of samples (@var{n}) and channels (@var{ch})
+ instead of the audio data.
+ @seealso{@ref{doc-wavwrite,,wavwrite}}
+diff -Nur octave-3.6.4.orig/doc/interpreter/io.texi octave-3.6.4/doc/interpreter/io.texi
+--- octave-3.6.4.orig/doc/interpreter/io.texi 2013-02-21 12:37:51.000000000 -0800
++++ octave-3.6.4/doc/interpreter/io.texi 2013-06-19 08:52:43.259790240 -0700
+@@ -1391,22 +1391,22 @@
+ for the file. Valid values for @var{arch} are:
+
+ @table @asis
+-@samp{native}
++@item @samp{native}
+ The format of the current machine (this is the default).
+
+-@samp{ieee-be}
++@item @samp{ieee-be}
+ IEEE big endian format.
+
+-@samp{ieee-le}
++@item @samp{ieee-le}
+ IEEE little endian format.
+
+-@samp{vaxd}
++@item @samp{vaxd}
+ VAX D floating format.
+
+-@samp{vaxg}
++@item @samp{vaxg}
+ VAX G floating format.
+
+-@samp{cray}
++@item @samp{cray}
+ Cray floating format.
+ @end table
+
+diff -Nur octave-3.6.4.orig/doc/interpreter/octave.texi octave-3.6.4/doc/interpreter/octave.texi
+--- octave-3.6.4.orig/doc/interpreter/octave.texi 2013-02-21 12:19:23.000000000 -0800
++++ octave-3.6.4/doc/interpreter/octave.texi 2013-06-19 08:52:43.259790240 -0700
+@@ -129,7 +129,9 @@
+ @sp 2
+ @multitable @columnfractions 0.4 0.025 0.65
+ @item
+-@flushright @image{octave_logo,2.1in} @end flushright
++@flushright
++@image{octave_logo,2.1in}
++@end flushright
+ @tab
+ @c this is a spacer column
+ @tab
+diff -Nur octave-3.6.4.orig/doc/interpreter/plot.texi octave-3.6.4/doc/interpreter/plot.texi
+--- octave-3.6.4.orig/doc/interpreter/plot.texi 2013-02-21 12:37:52.000000000 -0800
++++ octave-3.6.4/doc/interpreter/plot.texi 2013-06-19 08:52:43.260790204 -0700
+@@ -2707,21 +2707,20 @@
+ Set the data aspect ratio of the current axes. The aspect ratio is
+ a normalized 3-element vector representing the span of the x, y, and
+ z-axes limits.
+-
+-@deftypefnx {Function File} {@var{data_aspect_ratio} =} daspect ( )
++@end deftypefn
++@deftypefn {Function File} {@var{data_aspect_ratio} =} daspect ( )
+ Return the data aspect ratio of the current axes.
+-
+-@deftypefnx {Function File} {} daspect (@var{mode})
++@end deftypefn
++@deftypefn {Function File} {} daspect (@var{mode})
+ Set the data aspect ratio mode of the current axes.
+-
+-@deftypefnx {Function File} {@var{data_aspect_ratio_mode} =} daspect ("mode")
++@end deftypefn
++@deftypefn {Function File} {@var{data_aspect_ratio_mode} =} daspect ("mode")
+ Return the data aspect ratio mode of the current axes.
+-
+-@deftypefnx {Function File} {} daspect (@var{hax}, @dots{})
++@end deftypefn
++@deftypefn {Function File} {} daspect (@var{hax}, @dots{})
+ Use the axes, with handle @var{hax}, instead of the current axes.
+-
+-@seealso{@ref{doc-axis,,axis}, @ref{doc-pbaspect,,pbaspect}, @ref{doc-xlim,,xlim}, @ref{doc-ylim,,ylim}, @ref{doc-zlim,,zlim}}
+ @end deftypefn
++@seealso{@ref{doc-axis,,axis}, @ref{doc-pbaspect,,pbaspect}, @ref{doc-xlim,,xlim}, @ref{doc-ylim,,ylim}, @ref{doc-zlim,,zlim}}
+
+
+ @c pbaspect scripts/plot/pbaspect.m
+@@ -2730,21 +2729,20 @@
+ Set the plot box aspect ratio of the current axes. The aspect ratio
+ is a normalized 3-element vector representing the rendered lengths of
+ the x, y, and z-axes.
+-
+-@deftypefnx {Function File} {@var{plot_box_aspect_ratio} =} pbaspect ( )
++@end deftypefn
++@deftypefn {Function File} {@var{plot_box_aspect_ratio} =} pbaspect ( )
+ Return the plot box aspect ratio of the current axes.
+-
+-@deftypefnx {Function File} {} pbaspect (@var{mode})
++@end deftypefn
++@deftypefn {Function File} {} pbaspect (@var{mode})
+ Set the plot box aspect ratio mode of the current axes.
+-
+-@deftypefnx {Function File} {@var{plot_box_aspect_ratio_mode} =} pbaspect ("mode")
++@end deftypefn
++@deftypefn {Function File} {@var{plot_box_aspect_ratio_mode} =} pbaspect ("mode")
+ Return the plot box aspect ratio mode of the current axes.
+-
+-@deftypefnx {Function File} {} pbaspect (@var{hax}, @dots{})
++@end deftypefn
++@deftypefn {Function File} {} pbaspect (@var{hax}, @dots{})
+ Use the axes, with handle @var{hax}, instead of the current axes.
+-
+-@seealso{@ref{doc-axis,,axis}, @ref{doc-daspect,,daspect}, @ref{doc-xlim,,xlim}, @ref{doc-ylim,,ylim}, @ref{doc-zlim,,zlim}}
+ @end deftypefn
++@seealso{@ref{doc-axis,,axis}, @ref{doc-daspect,,daspect}, @ref{doc-xlim,,xlim}, @ref{doc-ylim,,ylim}, @ref{doc-zlim,,zlim}}
+
+
+ @node Three-dimensional Function Plotting
+@@ -3147,7 +3145,7 @@
+ @item "hide"
+ Hide legend on the plot
+
+-@itemx "toggle"
++@item "toggle"
+ Toggles between "hide" and "show"
+
+ @item "boxon"
+@@ -3162,7 +3160,7 @@
+ @item "right"
+ Place text to the right of the keys
+
+-@itemx "off"
++@item "off"
+ Delete the legend object
+ @end table
+ @end deftypefn
+@@ -4139,11 +4137,11 @@
+ is sent to a file the size is determined by the plot box defined by
+ the figure's "paperposition" property.
+
+-@itemx -append
++@item -append
+ Appends the PS, or PDF output to a pre-existing file of the
+ same type.
+
+-@itemx -r@var{NUM}
++@item -r@var{NUM}
+ Resolution of bitmaps in pixels per inch. For both metafiles and
+ SVG the default is the screen resolution, for other it is 150 dpi.
+ To specify screen resolution, use "-r0".
+@@ -6296,15 +6294,15 @@
+ A character indicating a plot marker to be place at each data point, or
+ @code{"none"}, meaning no markers should be displayed.
+
+-@itemx markeredgecolor
++@item markeredgecolor
+ The color of the edge around the marker, or @code{"auto"}, meaning that
+ the edge color is the same as the face color. @xref{Colors}.
+
+-@itemx markerfacecolor
++@item markerfacecolor
+ The color of the marker, or @code{"none"} to indicate that the marker
+ should not be filled. @xref{Colors}.
+
+-@itemx markersize
++@item markersize
+ A number specifying the size of the marker. The default is 1. A value
+ of 2 is twice as large as the default, etc.
+ @end table
+@@ -6442,7 +6440,8 @@
+ @deftypefn {Function File} {@var{value} =} getappdata (@var{h}, @var{name})
+ Return the @var{value} for named application data for the object(s) with
+ handle(s) @var{h}.
+-@deftypefnx {Function File} {@var{appdata} =} getappdata (@var{h})
++@end deftypefn
++@deftypefn {Function File} {@var{appdata} =} getappdata (@var{h})
+ Return a structure, @var{appdata}, whose fields correspond to the appdata
+ properties.
+ @end deftypefn
+diff -Nur octave-3.6.4.orig/doc/interpreter/poly.texi octave-3.6.4/doc/interpreter/poly.texi
+--- octave-3.6.4.orig/doc/interpreter/poly.texi 2013-02-21 12:37:52.000000000 -0800
++++ octave-3.6.4/doc/interpreter/poly.texi 2013-06-19 08:52:43.260790204 -0700
+@@ -82,8 +82,8 @@
+ (@var{x}-@var{mu}(1))/@var{mu}(2).
+ If @var{x} is a vector or matrix, the polynomial is evaluated for each of
+ the elements of @var{x}.
+-
+-@deftypefnx {Function File} {[@var{y}, @var{dy}] =} polyval (@var{p}, @var{x}, @var{s})
++@end deftypefn
++@deftypefn {Function File} {[@var{y}, @var{dy}] =} polyval (@var{p}, @var{x}, @var{s})
+ @deftypefnx {Function File} {[@var{y}, @var{dy}] =} polyval (@var{p}, @var{x}, @var{s}, @var{mu})
+ In addition to evaluating the polynomial, the second output
+ represents the prediction interval, @var{y} +/- @var{dy}, which
+diff -Nur octave-3.6.4.orig/doc/interpreter/set.texi octave-3.6.4/doc/interpreter/set.texi
+--- octave-3.6.4.orig/doc/interpreter/set.texi 2013-02-21 12:37:52.000000000 -0800
++++ octave-3.6.4/doc/interpreter/set.texi 2013-06-19 08:52:43.260790204 -0700
+@@ -150,8 +150,9 @@
+ 3 4
+ @end group
+ @end example
++@end deftypefn
+
+-@deftypefnx {Function File} {[@var{c}, @var{ia}, @var{ib}] =} union (@var{a}, @var{b})
++@deftypefn {Function File} {[@var{c}, @var{ia}, @var{ib}] =} union (@var{a}, @var{b})
+
+ Return index vectors @var{ia} and @var{ib} such that @code{a(ia)} and
+ @code{b(ib)} are disjoint sets whose union is @var{c}.
+diff -Nur octave-3.6.4.orig/doc/interpreter/signal.texi octave-3.6.4/doc/interpreter/signal.texi
+--- octave-3.6.4.orig/doc/interpreter/signal.texi 2013-02-21 12:37:52.000000000 -0800
++++ octave-3.6.4/doc/interpreter/signal.texi 2013-06-19 08:52:43.261790169 -0700
+@@ -454,17 +454,17 @@
+
+ For fastest computation, @var{n} should factor into a small number of
+ small primes.
+-
+-@deftypefnx {Function File} {@var{h} =} freqz (@var{b}, @var{a}, @var{w})
++@end deftypefn
++@deftypefn {Function File} {@var{h} =} freqz (@var{b}, @var{a}, @var{w})
+ Evaluate the response at the specific frequencies in the vector @var{w}.
+ The values for @var{w} are measured in radians.
+-
+-@deftypefnx {Function File} {[@dots{}] =} freqz (@dots{}, @var{Fs})
++@end deftypefn
++@deftypefn {Function File} {[@dots{}] =} freqz (@dots{}, @var{Fs})
+ Return frequencies in Hz instead of radians assuming a sampling rate
+ @var{Fs}. If you are evaluating the response at specific frequencies
+ @var{w}, those frequencies should be requested in Hz rather than radians.
+-
+-@deftypefnx {Function File} {} freqz (@dots{})
++@end deftypefn
++@deftypefn {Function File} {} freqz (@dots{})
+ Plot the pass band, stop band and phase response of @var{h} rather
+ than returning them.
+ @end deftypefn
+diff -Nur octave-3.6.4.orig/doc/interpreter/strings.texi octave-3.6.4/doc/interpreter/strings.texi
+--- octave-3.6.4.orig/doc/interpreter/strings.texi 2013-02-21 12:37:52.000000000 -0800
++++ octave-3.6.4/doc/interpreter/strings.texi 2013-06-19 08:52:43.261790169 -0700
+@@ -1136,7 +1136,7 @@
+ @item %s
+ The word is parsed as a string.
+
+-@itemx %f
++@item %f
+ @itemx %n
+ The word is parsed as a number and converted to double.
+
+diff -Nur octave-3.6.4.orig/doc/interpreter/system.texi octave-3.6.4/doc/interpreter/system.texi
+--- octave-3.6.4.orig/doc/interpreter/system.texi 2013-02-21 12:37:52.000000000 -0800
++++ octave-3.6.4/doc/interpreter/system.texi 2013-06-19 08:52:43.261790169 -0700
+@@ -839,7 +839,7 @@
+ @deftypefnx {Function File} {} datetick (@var{axis}, @var{form})
+ @deftypefnx {Function File} {} datetick (@dots{}, "keeplimits")
+ @deftypefnx {Function File} {} datetick (@dots{}, "keepticks")
+-@deftypefnx {Function File} {} datetick (@dots{ax}, @dots{})
++@comment @deftypefnx {Function File} {} datetick (@dots{ax}, @dots{})
+ Add date formatted tick labels to an axis. The axis the apply the
+ ticks to is determined by @var{axis} that can take the values "x",
+ "y" or "z". The default value is "x". The formatting of the labels is
+@@ -1261,9 +1261,10 @@
+ interpreted as filename globbing patterns (as they are used by Unix shells).
+ Within a pattern
+ @table @code
+-@itemx *
++
++@item *
+ matches any string, including the null string,
+-@itemx ?
++@item ?
+ matches any single character, and
+
+ @item [@dots{}]
+@@ -2789,8 +2790,8 @@
+ Display a header containing the current Octave version number, license
+ string and operating system, followed by the installed package names,
+ versions, and installation directories.
+-
+-@deftypefnx {Function File} {v =} ver ()
++@end deftypefn
++@deftypefn {Function File} {v =} ver ()
+ Return a vector of structures, respecting Octave and each installed package.
+ The structure includes the following fields.
+
+@@ -2807,11 +2808,11 @@
+ @item Date
+ Date respecting the version/revision.
+ @end table
+-
+-@deftypefnx {Function File} {v =} ver ("Octave")
++@end deftypefn
++@deftypefn {Function File} {v =} ver ("Octave")
+ Return version information for Octave only.
+-
+-@deftypefnx {Function File} {v =} ver (@var{package})
++@end deftypefn
++@deftypefn {Function File} {v =} ver (@var{package})
+ Return version information for @var{package}.
+
+ @seealso{@ref{doc-version,,version}, @ref{doc-octave_config_info,,octave_config_info}}
+@@ -2878,19 +2879,19 @@
+ @anchor{doc-license}
+ @deftypefn {Function File} {} license
+ Display the license of Octave.
+-
+-@deftypefnx {Function File} {} license ("inuse")
++@end deftypefn
++@deftypefn {Function File} {} license ("inuse")
+ Display a list of packages currently being used.
+-
+-@deftypefnx {Function File} {@var{retval} =} license ("inuse")
++@end deftypefn
++@deftypefn {Function File} {@var{retval} =} license ("inuse")
+ Return a structure containing the fields @code{feature} and @code{user}.
+-
+-@deftypefnx {Function File} {@var{retval} =} license ("test", @var{feature})
++@end deftypefn
++@deftypefn {Function File} {@var{retval} =} license ("test", @var{feature})
+ Return 1 if a license exists for the product identified by the string
+ @var{feature} and 0 otherwise. The argument @var{feature} is case
+ insensitive and only the first 27 characters are checked.
+-
+-@deftypefnx {Function File} {} license ("test", @var{feature}, @var{toggle})
++@end deftypefn
++@deftypefn {Function File} {} license ("test", @var{feature}, @var{toggle})
+ Enable or disable license testing for @var{feature}, depending on
+ @var{toggle}, which may be one of:
+
+@@ -2902,8 +2903,8 @@
+ @item "disable"
+ Future tests for the specified license of @var{feature} return 0.
+ @end table
+-
+-@deftypefnx {Function File} {@var{retval} =} license ("checkout", @var{feature})
++@end deftypefn
++@deftypefn {Function File} {@var{retval} =} license ("checkout", @var{feature})
+ Check out a license for @var{feature}, returning 1 on success and 0
+ on failure.
+
+diff -Nur octave-3.6.4.orig/doc/liboctave/liboctave.texi octave-3.6.4/doc/liboctave/liboctave.texi
+--- octave-3.6.4.orig/doc/liboctave/liboctave.texi 2013-02-21 12:19:23.000000000 -0800
++++ octave-3.6.4/doc/liboctave/liboctave.texi 2013-06-19 08:54:27.914379692 -0700
+@@ -80,10 +80,10 @@
+ @end ifnottex
+
+ @titlepage
+-@title{Octave C++ Classes}
+-@subtitle{Edition 1.0 for Octave version @value{VERSION}}
+-@subtitle{September 1993}
+-@author{John W. Eaton}
++@title@{Octave C++ Classes@}
++@subtitle@{Edition 1.0 for Octave version @value{VERSION}@}
++@subtitle@{September 1993@}
++@author@{John W. Eaton@}
+ @page
+ @vskip 0pt plus 1filll
+ Copyright @copyright{} 1996, 1997 John W. Eaton.
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-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/files/octave-3.8.1-imagemagick.patch b/sci-mathematics/octave/files/octave-3.8.1-imagemagick.patch
new file mode 100644
index 000000000000..f3415505dffb
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-3.8.1-imagemagick.patch
@@ -0,0 +1,138 @@
+--- octave-3.8.1-orig/libinterp/dldfcn/__magick_read__.cc 2014-03-07 06:37:51.000000000 +1100
++++ octave-3.8.1/libinterp/dldfcn/__magick_read__.cc 2014-03-09 00:18:04.593088077 +1100
+@@ -38,8 +38,15 @@
+ #include "gripes.h"
+
+ #ifdef HAVE_MAGICK
+-
++#define MAGICKCORE_EXCLUDE_DEPRECATED 1
+ #include <Magick++.h>
++#if !defined(QuantumRange) && defined(MaxRGB)
++#define QuantumRange MaxRGB
++#endif
++#if !defined(MAGICKCORE_QUANTUM_DEPTH) && defined(QuantumDepth)
++#define MAGICKCORE_QUANTUM_DEPTH QuantumDepth
++#endif
++
+ #include <clocale>
+
+ // In theory, it should be enough to check the class:
+@@ -104,12 +111,18 @@
+ get_depth (Magick::Image& img)
+ {
+ octave_idx_type depth = img.depth ();
++#if defined(MagickLibVersion) && (MagickLibVersion <= 0x686)
++#define Magick MagickCore
++#endif
+ if (depth == 8
+ && img.channelDepth (Magick::RedChannel) == 1
+ && img.channelDepth (Magick::CyanChannel) == 1
+ && img.channelDepth (Magick::OpacityChannel) == 1
+ && img.channelDepth (Magick::GrayChannel) == 1)
+ depth = 1;
++#if defined(MagickLibVersion) && (MagickLibVersion <= 0x686)
++#undef Magick
++#endif
+
+ return depth;
+ }
+@@ -332,7 +345,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
+@@ -464,7 +480,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++;
+ }
+@@ -541,7 +558,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++;
+ }
+@@ -626,7 +644,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++;
+ }
+@@ -685,9 +704,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;
+ }
+@@ -1060,8 +1080,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 ();
+@@ -1111,8 +1132,9 @@
+ for (octave_idx_type row = 0; row < nRows; row++)
+ {
+ double grey = double (*img_fvec) / divisor;
++ using namespace Magick;
+ Magick::Color c (grey, grey, grey,
+- MaxRGB - (double (*a_fvec) / divisor));
++ QuantumRange - (double (*a_fvec) / divisor));
+ pix[GM_idx] = c;
+ img_fvec++;
+ a_fvec++;
+@@ -1178,10 +1200,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++;
+@@ -1257,7 +1280,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.1-pkgbuilddir.patch b/sci-mathematics/octave/files/octave-3.8.1-pkgbuilddir.patch
new file mode 100644
index 000000000000..98fe3d5e8eed
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-3.8.1-pkgbuilddir.patch
@@ -0,0 +1,41 @@
+--- scripts/pkg/private/install.m.orig 2014-04-15 08:45:55.487258887 -0700
++++ scripts/pkg/private/install.m 2014-04-15 12:12:40.985606248 -0700
+@@ -62,7 +62,14 @@
+ for i = 1:length (files)
+ 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 +96,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/files/octave-4.0.0-imagemagick-configure.patch b/sci-mathematics/octave/files/octave-4.0.0-imagemagick-configure.patch
new file mode 100644
index 000000000000..4e88ac07b13a
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-4.0.0-imagemagick-configure.patch
@@ -0,0 +1,16 @@
+--- octave-4.0.0-orig/configure.ac 2015-05-27 02:16:39.000000000 +1000
++++ octave-4.0.0/configure.ac 2015-07-06 18:11:43.461136517 +1000
+@@ -1086,11 +1086,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-4.0.0-imagemagick.patch b/sci-mathematics/octave/files/octave-4.0.0-imagemagick.patch
new file mode 100644
index 000000000000..9e3689176cbd
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-4.0.0-imagemagick.patch
@@ -0,0 +1,139 @@
+--- octave-4.0.0-orig/libinterp/dldfcn/__magick_read__.cc 2015-05-24 00:21:53.000000000 +1000
++++ octave-4.0.0/libinterp/dldfcn/__magick_read__.cc 2015-07-06 18:17:52.263146804 +1000
+@@ -38,8 +38,15 @@
+ #include "gripes.h"
+
+ #ifdef HAVE_MAGICK
+-
++#define MAGICKCORE_EXCLUDE_DEPRECATED 1
+ #include <Magick++.h>
++#if !defined(QuantumRange) && defined(MaxRGB)
++#define QuantumRange MaxRGB
++#endif
++#if !defined(MAGICKCORE_QUANTUM_DEPTH) && defined(QuantumDepth)
++#define MAGICKCORE_QUANTUM_DEPTH QuantumDepth
++#endif
++
+ #include <clocale>
+
+ // In theory, it should be enough to check the class:
+@@ -121,12 +128,18 @@
+ get_depth (Magick::Image& img)
+ {
+ octave_idx_type depth = img.depth ();
++#if defined(MagickLibVersion) && (MagickLibVersion <= 0x686)
++#define Magick MagickCore
++#endif
+ if (depth == 8
+ && img.channelDepth (Magick::RedChannel) == 1
+ && img.channelDepth (Magick::CyanChannel) == 1
+ && img.channelDepth (Magick::OpacityChannel) == 1
+ && img.channelDepth (Magick::GrayChannel) == 1)
+ depth = 1;
++#if defined(MagickLibVersion) && (MagickLibVersion <= 0x686)
++#undef Magick
++#endif
+
+ return depth;
+ }
+@@ -350,7 +363,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
+@@ -484,7 +500,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++;
+ }
+@@ -563,7 +580,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++;
+ }
+@@ -650,7 +668,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++;
+ }
+@@ -709,10 +728,11 @@
+ // Restore locale from before GraphicsMagick initialisation
+ setlocale (LC_ALL, locale.c_str ());
+
+- if (QuantumDepth < 32)
++ using namespace Magick;
++ if (MAGICKCORE_QUANTUM_DEPTH < 32)
+ warning_with_id ("Octave:GraphicsMagic-Quantum-Depth",
+ "your version of %s limits images to %d bits per pixel",
+- MagickPackageName, QuantumDepth);
++ MagickPackageName, MAGICKCORE_QUANTUM_DEPTH);
+
+ initialized = true;
+ }
+@@ -1087,8 +1107,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 ();
+@@ -1140,8 +1161,9 @@
+ for (octave_idx_type row = 0; row < nRows; row++)
+ {
+ double grey = double (*img_fvec) / divisor;
++ using namespace Magick;
+ Magick::Color c (grey, grey, grey,
+- MaxRGB - (double (*a_fvec) / divisor));
++ QuantumRange - (double (*a_fvec) / divisor));
+ pix[GM_idx] = c;
+ img_fvec++;
+ a_fvec++;
+@@ -1209,10 +1231,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++;
+@@ -1290,7 +1313,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-4.0.0-llvm-3.5-gnulib-hg.patch b/sci-mathematics/octave/files/octave-4.0.0-llvm-3.5-gnulib-hg.patch
new file mode 100644
index 000000000000..e74d123b6418
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-4.0.0-llvm-3.5-gnulib-hg.patch
@@ -0,0 +1,19 @@
+diff -r 7f19e7f2afa2 lib/stddef.in.h
+--- a/libgnu/stddef.in.h Sat Feb 21 06:19:32 2015 -0800
++++ b/libgnu/stddef.in.h Fri May 01 06:01:06 2015 +0200
+@@ -82,6 +82,7 @@
+ #endif
+
+ /* Some platforms lack max_align_t. */
++#ifndef _GCC_MAX_ALIGN_T
+ #if !@HAVE_MAX_ALIGN_T@
+ typedef union
+ {
+@@ -91,6 +92,7 @@
+ long int __i;
+ } max_align_t;
+ #endif
++#endif
+
+ # endif /* _@GUARD_PREFIX@_STDDEF_H */
+ # endif /* _@GUARD_PREFIX@_STDDEF_H */
diff --git a/sci-mathematics/octave/files/octave-4.0.0-llvm-3.5.patch b/sci-mathematics/octave/files/octave-4.0.0-llvm-3.5.patch
new file mode 100644
index 000000000000..31b1bed74e2d
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-4.0.0-llvm-3.5.patch
@@ -0,0 +1,130 @@
+diff -r 3797df921988 configure.ac
+--- a/configure.ac Wed Apr 29 17:09:24 2015 -0700
++++ b/configure.ac Sun May 03 22:48:56 2015 +0200
+@@ -815,8 +815,13 @@
+ AC_MSG_NOTICE([using -isystem for LLVM headers])])
+
+ dnl Use -isystem so we don't get warnings from llvm headers
+- LLVM_CPPFLAGS="$LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`"
+- LLVM_CXXFLAGS=
++ AX_CHECK_COMPILE_FLAG([-std=c++11],[
++ LLVM_CPPFLAGS="-std=c++11 $LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`"
++ LLVM_CXXFLAGS="-std=c++11"
++ ],[
++ LLVM_CPPFLAGS="$LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`"
++ LLVM_CXXFLAGS=
++ ])
+ LLVM_LDFLAGS="-L`$LLVM_CONFIG --libdir`"
+
+
+@@ -860,6 +865,8 @@
+ OCTAVE_LLVM_CALLINST_ADDATTRIBUTE_API
+ OCTAVE_LLVM_RAW_FD_OSTREAM_API
+ OCTAVE_LLVM_LEGACY_PASSMANAGER_API
++ OCTAVE_LLVM_DATALAYOUTPASS_API
++
+ AC_LANG_POP(C++)
+ CPPFLAGS="$save_CPPFLAGS"
+ CXXFLAGS="$save_CXXFLAGS"
+diff -r 3797df921988 libinterp/corefcn/jit-typeinfo.cc
+--- a/libinterp/corefcn/jit-typeinfo.cc Wed Apr 29 17:09:24 2015 -0700
++++ b/libinterp/corefcn/jit-typeinfo.cc Sun May 03 22:48:56 2015 +0200
+@@ -1208,7 +1208,7 @@
+ for (int op = 0; op < octave_value::num_binary_ops; ++op)
+ {
+ llvm::Twine fn_name ("octave_jit_binary_any_any_");
+- fn_name = fn_name + llvm::Twine (op);
++ fn_name.concat( llvm::Twine (op) );
+
+ fn = create_internal (fn_name, any, any, any);
+ fn.mark_can_error ();
+diff -r 3797df921988 libinterp/corefcn/pt-jit.cc
+--- a/libinterp/corefcn/pt-jit.cc Wed Apr 29 17:09:24 2015 -0700
++++ b/libinterp/corefcn/pt-jit.cc Sun May 03 22:48:56 2015 +0200
+@@ -59,6 +59,7 @@
+
+ #include <llvm/Bitcode/ReaderWriter.h>
+ #include <llvm/ExecutionEngine/ExecutionEngine.h>
++#include <llvm/ExecutionEngine/MCJIT.h>
+ #include <llvm/ExecutionEngine/JIT.h>
+
+ #ifdef LEGACY_PASSMANAGER
+@@ -83,6 +84,7 @@
+ #include <llvm/IRBuilder.h>
+ #endif
+
++#include <llvm/Support/FileSystem.h>
+ #include <llvm/Support/raw_os_ostream.h>
+ #include <llvm/Support/TargetSelect.h>
+
+@@ -2077,7 +2079,11 @@
+ module_pass_manager->add (llvm::createAlwaysInlinerPass ());
+
+ #ifdef HAVE_LLVM_DATALAYOUT
++#ifdef HAVE_LLVM_DATALAYOUTPASS
++ pass_manager->add (new llvm::DataLayoutPass (*engine->getDataLayout ()));
++#else
+ pass_manager->add (new llvm::DataLayout (*engine->getDataLayout ()));
++#endif
+ #else
+ pass_manager->add (new llvm::TargetData (*engine->getTargetData ()));
+ #endif
+@@ -2192,7 +2198,7 @@
+ std::string error;
+ #ifdef RAW_FD_OSTREAM_ARG_IS_LLVM_SYS_FS
+ llvm::raw_fd_ostream fout ("test.bc", error,
+- llvm::sys::fs::F_Binary);
++ llvm::sys::fs::F_Text);
+ #else
+ llvm::raw_fd_ostream fout ("test.bc", error,
+ llvm::raw_fd_ostream::F_Binary);
+diff -r 3797df921988 m4/acinclude.m4
+--- a/m4/acinclude.m4 Wed Apr 29 17:09:24 2015 -0700
++++ b/m4/acinclude.m4 Sun May 03 22:48:56 2015 +0200
+@@ -1784,10 +1784,11 @@
+ [AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
++ #include <llvm/Support/FileSystem.h>
+ #include <llvm/Support/raw_os_ostream.h>
+ ]], [[
+ std::string str;
+- llvm::raw_fd_ostream fout ("", str, llvm::sys::fs::F_Binary);
++ llvm::raw_fd_ostream fout ("", str, llvm::sys::fs::F_Text);
+ ]])],
+ octave_cv_raw_fd_ostream_arg_is_llvm_sys_fs=yes,
+ octave_cv_raw_fd_ostream_arg_is_llvm_sys_fs=no)
+@@ -1828,6 +1829,33 @@
+ fi
+ ])
+ dnl
++dnl Check for llvm::DataLayoutPass API
++dnl
++AC_DEFUN([OCTAVE_LLVM_DATALAYOUTPASS_API], [
++ AC_CACHE_CHECK([check for LLVM::DataLayoutPass],
++ [octave_cv_datalayoutpass],
++ [AC_LANG_PUSH(C++)
++ save_LIBS="$LIBS"
++ LIBS="$LLVM_LIBS $LIBS"
++ AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM([[
++ #include <llvm/IR/DataLayout.h>
++ ]], [[
++ llvm::Module *module;
++ llvm::DataLayoutPass *datalayoutpass;
++ datalayoutpass = new llvm::DataLayoutPass (module)
++ ]])],
++ octave_cv_datalayoutpass=yes,
++ octave_cv_datalayoutpass=no)
++ LIBS="$save_LIBS"
++ AC_LANG_POP(C++)
++ ])
++ if test $octave_cv_datalayoutpass = yes; then
++ AC_DEFINE(HAVE_LLVM_DATALAYOUTPASS, 1,
++ [Define to 1 if LLVM::DataLayoutPass exists.])
++ fi
++])
++dnl
+ dnl Check for ar.
+ dnl
+ AC_DEFUN([OCTAVE_PROG_AR], [
diff --git a/sci-mathematics/octave/metadata.xml b/sci-mathematics/octave/metadata.xml
new file mode 100644
index 000000000000..b135f553475f
--- /dev/null
+++ b/sci-mathematics/octave/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-mathematics</herd>
+<longdescription lang="en">
+ Octave is a high-level language, primarily intended for numerical
+ computations. It provides a convenient command line interface for
+ solving linear and nonlinear problems numerically, and for performing
+ other numerical experiments. It may also be used as a batch-oriented
+ language.
+</longdescription>
+<use>
+ <flag name="glpk">Add support for <pkg>sci-libs/glpk</pkg> for linear programming</flag>
+ <flag name="gui">Enable the graphical user interface</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>
+</use>
+</pkgmetadata>
diff --git a/sci-mathematics/octave/octave-3.6.4-r1.ebuild b/sci-mathematics/octave/octave-3.6.4-r1.ebuild
new file mode 100644
index 000000000000..9e8f5ab6a281
--- /dev/null
+++ b/sci-mathematics/octave/octave-3.6.4-r1.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+inherit autotools-utils multilib toolchain-funcs fortran-2
+
+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 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
+ 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[cxx] ) )
+ opengl? (
+ media-libs/freetype:2
+ media-libs/fontconfig
+ >=x11-libs/fltk-1.3:1[opengl]
+ virtual/glu )
+ postscript? (
+ app-text/epstool
+ media-gfx/pstoedit
+ media-gfx/transfig )
+ qhull? ( media-libs/qhull )
+ qrupdate? ( sci-libs/qrupdate )
+ readline? ( sys-libs/readline:0 )
+ 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}
+ doc? (
+ virtual/latex-base
+ dev-texlive/texlive-genericrecommended
+ dev-texlive/texlive-metapost
+ sys-apps/texinfo )
+ dev-util/gperf
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.4.3-{pkgbuilddir,texi}.patch
+ "${FILESDIR}"/${PN}-3.6.3-legendtext.patch
+ "${FILESDIR}"/${P}-texinfo.patch
+ "${FILESDIR}"/${P}-gcc-4.8.patch
+)
+
+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
+ 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 prefix rpath)
+ $(use_enable doc docs)
+ $(use_enable readline)
+ $(use_with curl)
+ $(use_with fftw fftw3)
+ $(use_with fftw fftw3f)
+ $(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_install() {
+ autotools-utils_src_install
+ use doc && dodoc $(find doc -name \*.pdf)
+ [[ -e test/fntests.log ]] && dodoc test/fntests.log
+ echo "LDPATH=${EROOT}usr/$(get_libdir)/${PN}/${PV}" > 99octave
+ doenvd 99octave
+}
diff --git a/sci-mathematics/octave/octave-3.6.4.ebuild b/sci-mathematics/octave/octave-3.6.4.ebuild
new file mode 100644
index 000000000000..378b11642a89
--- /dev/null
+++ b/sci-mathematics/octave/octave-3.6.4.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+inherit autotools-utils multilib toolchain-funcs fortran-2
+
+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 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
+ 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[cxx] ) )
+ opengl? (
+ media-libs/freetype:2
+ media-libs/fontconfig
+ >=x11-libs/fltk-1.3:1[opengl]
+ virtual/glu )
+ postscript? (
+ app-text/epstool
+ media-gfx/pstoedit
+ media-gfx/transfig )
+ qhull? ( media-libs/qhull )
+ qrupdate? ( sci-libs/qrupdate )
+ readline? ( sys-libs/readline:0 )
+ 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}
+ doc? (
+ virtual/latex-base
+ dev-texlive/texlive-genericrecommended
+ sys-apps/texinfo )
+ dev-util/gperf
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.4.3-{pkgbuilddir,texi}.patch
+ "${FILESDIR}"/${PN}-3.6.3-legendtext.patch
+ "${FILESDIR}"/${PN}-3.6.4-texinfo.patch
+)
+
+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
+ 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 prefix rpath)
+ $(use_enable doc docs)
+ $(use_enable readline)
+ $(use_with curl)
+ $(use_with fftw fftw3)
+ $(use_with fftw fftw3f)
+ $(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_install() {
+ autotools-utils_src_install
+ use doc && dodoc $(find doc -name \*.pdf)
+ [[ -e test/fntests.log ]] && dodoc test/fntests.log
+ echo "LDPATH=${EROOT}usr/$(get_libdir)/${PN}/${PV}" > 99octave
+ doenvd 99octave
+}
diff --git a/sci-mathematics/octave/octave-3.8.1-r1.ebuild b/sci-mathematics/octave/octave-3.8.1-r1.ebuild
new file mode 100644
index 000000000000..67e3cb0ffdb8
--- /dev/null
+++ b/sci-mathematics/octave/octave-3.8.1-r1.ebuild
@@ -0,0 +1,163 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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 gui 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:3=
+ sys-libs/ncurses:5=
+ virtual/lapack
+ curl? ( net-misc/curl:0= )
+ fftw? ( sci-libs/fftw:3.0= )
+ glpk? ( sci-mathematics/glpk:0= )
+ gnuplot? ( sci-visualization/gnuplot )
+ gui? ( x11-libs/qscintilla:0= )
+ hdf5? ( sci-libs/hdf5:0= )
+ imagemagick? ( || (
+ media-gfx/graphicsmagick[cxx]
+ media-gfx/imagemagick[cxx] ) )
+ java? ( >=virtual/jre-1.6.0:* )
+ jit? ( <sys-devel/llvm-3.5 )
+ opengl? (
+ media-libs/freetype:2=
+ media-libs/fontconfig:1.0=
+ >=x11-libs/fltk-1.3:1=[opengl]
+ x11-libs/gl2ps:0=
+ virtual/glu )
+ postscript? (
+ app-text/epstool
+ media-gfx/pstoedit
+ media-gfx/transfig )
+ qhull? ( media-libs/qhull:0= )
+ qrupdate? ( sci-libs/qrupdate:0= )
+ readline? ( sys-libs/readline:0= )
+ sparse? (
+ sci-libs/arpack:0=
+ sci-libs/camd:0=
+ sci-libs/ccolamd:0=
+ sci-libs/cholmod:0=
+ sci-libs/colamd:0=
+ sci-libs/cxsparse:0=
+ sci-libs/umfpack:0= )
+ X? ( x11-libs/libX11:0= )
+ zlib? ( sys-libs/zlib:0= )"
+
+DEPEND="${RDEPEND}
+ qrupdate? ( app-misc/pax-utils )
+ sparse? ( app-misc/pax-utils )
+ java? ( >=virtual/jdk-1.6.0 )
+ doc? (
+ virtual/latex-base
+ dev-texlive/texlive-genericrecommended
+ dev-texlive/texlive-metapost
+ sys-apps/texinfo )
+ dev-util/gperf
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.4.3-texi.patch
+ "${FILESDIR}"/${PN}-3.8.0-disable-getcwd-path-max-test-as-it-is-too-slow.patch
+ "${FILESDIR}"/${PN}-3.8.0-imagemagick-configure.patch
+ "${FILESDIR}"/${PN}-3.8.0-llvm-configure.patch
+ "${FILESDIR}"/${PN}-3.8.1-imagemagick.patch
+ "${FILESDIR}"/${PN}-3.8.1-pkgbuilddir.patch
+)
+
+src_prepare() {
+ # nasty prefix hacks for fltk:1 and qt4 linking
+ if use prefix; then
+ use opengl && append-ldflags -Wl,-rpath,"${EPREFIX}/usr/$(get_libdir)/fltk-1"
+ use gui && append-ldflags -Wl,-rpath,"${EPREFIX}/usr/$(get_libdir)/qt4"
+ fi
+
+ has_version ">=sys-devel/llvm-3.4" && \
+ epatch "${FILESDIR}"/${PN}-3.8.0-llvm-3.4.patch
+
+ # Fix bug 501756
+ sed -i \
+ -e 's@A-Za-z0-9@[:alnum:]@g' \
+ -e 's@A-Za-z@[:alpha:]@g' \
+ libinterp/mkbuiltins || die
+ 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 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)/${PN}/${PV}" > 99octave
+ doenvd 99octave
+}
diff --git a/sci-mathematics/octave/octave-3.8.1.ebuild b/sci-mathematics/octave/octave-3.8.1.ebuild
new file mode 100644
index 000000000000..7dbd71083270
--- /dev/null
+++ b/sci-mathematics/octave/octave-3.8.1.ebuild
@@ -0,0 +1,202 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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 gui hdf5 +imagemagick java jit opengl postscript
+ +qhull +qrupdate readline +sparse static-libs X zlib"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ app-text/ghostscript-gpl
+ dev-libs/libpcre
+ sys-libs/ncurses
+ jit? ( <sys-devel/llvm-3.5 )
+ virtual/lapack
+ curl? ( net-misc/curl )
+ fftw? ( sci-libs/fftw:3.0 )
+ glpk? ( sci-mathematics/glpk )
+ gnuplot? ( sci-visualization/gnuplot )
+ gui? ( x11-libs/qscintilla )
+ hdf5? ( sci-libs/hdf5 )
+ imagemagick? ( || (
+ media-gfx/graphicsmagick[cxx]
+ media-gfx/imagemagick[cxx] ) )
+ opengl? (
+ media-libs/freetype:2
+ media-libs/fontconfig
+ >=x11-libs/fltk-1.3:1[opengl]
+ 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:0 )
+ 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.1-imagemagick.patch
+ "${FILESDIR}"/${PN}-3.8.0-llvm-configure.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=$($(tc-getPKG_CONFIG) --libs-only-l blas | sed -e 's@-l\([^ \t]*\)@lib\1@' | cut -d' ' -f 1)
+ einfo "Checking dependencies are built with 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 [[ $? -ne 0 ]]; then
+ # Does it appear to be linked with some blas or lapack library?
+ scanelf -n ${i} | egrep -q "blas|lapack"
+ if [[ $? -eq 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
+ # Fix bug 501756 - sci-mathematics/octave-3.8.0 LC_ALL=et_EE - octave.cc:485:56:
+ # error: 'Fallow_noninteger_range_as_index' was not declared in this scope
+ sed -e 's@A-Za-z0-9@[:alnum:]@g' \
+ -e 's@A-Za-z@[:alpha:]@g' \
+ -i "${S}/libinterp/mkbuiltins" \
+ || die "Could not patch ${S}/libinterp/mkbuiltins for some non-English locales"
+ 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 gui 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)/${PN}/${PV}" > 99octave
+ doenvd 99octave
+}
diff --git a/sci-mathematics/octave/octave-3.8.2.ebuild b/sci-mathematics/octave/octave-3.8.2.ebuild
new file mode 100644
index 000000000000..f08b76a628ae
--- /dev/null
+++ b/sci-mathematics/octave/octave-3.8.2.ebuild
@@ -0,0 +1,163 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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 gui 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:3=
+ sys-libs/ncurses:5=
+ virtual/lapack
+ curl? ( net-misc/curl:0= )
+ fftw? ( sci-libs/fftw:3.0= )
+ glpk? ( sci-mathematics/glpk:0= )
+ gnuplot? ( sci-visualization/gnuplot )
+ gui? ( x11-libs/qscintilla:0= )
+ hdf5? ( sci-libs/hdf5:0= )
+ imagemagick? ( || (
+ media-gfx/graphicsmagick[cxx]
+ media-gfx/imagemagick[cxx] ) )
+ java? ( >=virtual/jre-1.6.0:* )
+ jit? ( <sys-devel/llvm-3.5:0= )
+ opengl? (
+ media-libs/freetype:2=
+ media-libs/fontconfig:1.0=
+ >=x11-libs/fltk-1.3:1=[opengl,xft]
+ x11-libs/gl2ps:0=
+ virtual/glu )
+ postscript? (
+ app-text/epstool
+ media-gfx/pstoedit
+ media-gfx/transfig )
+ qhull? ( media-libs/qhull:0= )
+ qrupdate? ( sci-libs/qrupdate:0= )
+ readline? ( sys-libs/readline:0= )
+ sparse? (
+ sci-libs/arpack:0=
+ sci-libs/camd:0=
+ sci-libs/ccolamd:0=
+ sci-libs/cholmod:0=
+ sci-libs/colamd:0=
+ sci-libs/cxsparse:0=
+ sci-libs/umfpack:0= )
+ X? ( x11-libs/libX11:0= )
+ zlib? ( sys-libs/zlib:0= )"
+
+DEPEND="${RDEPEND}
+ qrupdate? ( app-misc/pax-utils )
+ sparse? ( app-misc/pax-utils )
+ java? ( >=virtual/jdk-1.6.0 )
+ doc? (
+ virtual/latex-base
+ dev-texlive/texlive-genericrecommended
+ dev-texlive/texlive-metapost
+ sys-apps/texinfo )
+ dev-util/gperf
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.4.3-texi.patch
+ "${FILESDIR}"/${PN}-3.8.0-disable-getcwd-path-max-test-as-it-is-too-slow.patch
+ "${FILESDIR}"/${PN}-3.8.0-imagemagick-configure.patch
+ "${FILESDIR}"/${PN}-3.8.0-llvm-configure.patch
+ "${FILESDIR}"/${PN}-3.8.1-imagemagick.patch
+ "${FILESDIR}"/${PN}-3.8.1-pkgbuilddir.patch
+)
+
+src_prepare() {
+ # nasty prefix hacks for fltk:1 and qt4 linking
+ if use prefix; then
+ use opengl && append-ldflags -Wl,-rpath,"${EPREFIX}/usr/$(get_libdir)/fltk-1"
+ use gui && append-ldflags -Wl,-rpath,"${EPREFIX}/usr/$(get_libdir)/qt4"
+ fi
+
+ has_version ">=sys-devel/llvm-3.4" && \
+ epatch "${FILESDIR}"/${PN}-3.8.0-llvm-3.4.patch
+
+ # Fix bug 501756
+ sed -i \
+ -e 's@A-Za-z0-9@[:alnum:]@g' \
+ -e 's@A-Za-z@[:alpha:]@g' \
+ libinterp/mkbuiltins || die
+ 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 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)/${PN}/${PV}" > 99octave
+ doenvd 99octave
+}
diff --git a/sci-mathematics/octave/octave-4.0.0.ebuild b/sci-mathematics/octave/octave-4.0.0.ebuild
new file mode 100644
index 000000000000..822077444577
--- /dev/null
+++ b/sci-mathematics/octave/octave-4.0.0.ebuild
@@ -0,0 +1,169 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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.xz"
+
+SLOT="0/${PV}"
+IUSE="curl doc fftw +glpk gnuplot gui 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:3=
+ sys-libs/ncurses:5=
+ virtual/blas
+ virtual/lapack
+ curl? ( net-misc/curl:0= )
+ fftw? ( sci-libs/fftw:3.0= )
+ glpk? ( sci-mathematics/glpk:0= )
+ gnuplot? ( sci-visualization/gnuplot )
+ gui? ( x11-libs/qscintilla:0= )
+ hdf5? ( sci-libs/hdf5:0= )
+ imagemagick? ( || (
+ media-gfx/graphicsmagick[cxx]
+ media-gfx/imagemagick[cxx] ) )
+ java? ( >=virtual/jre-1.6.0:* )
+ jit? (
+ >=sys-devel/autoconf-archive-2015.02.04
+ >=sys-devel/llvm-3.3:0= <sys-devel/llvm-3.6:0= )
+ opengl? (
+ media-libs/freetype:2=
+ media-libs/fontconfig:1.0=
+ >=x11-libs/fltk-1.3:1=[opengl,xft]
+ x11-libs/gl2ps:0=
+ virtual/glu )
+ postscript? (
+ app-text/epstool
+ media-gfx/pstoedit
+ media-gfx/transfig )
+ qhull? ( media-libs/qhull:0= )
+ qrupdate? ( sci-libs/qrupdate:0= )
+ readline? ( sys-libs/readline:0= )
+ sparse? (
+ sci-libs/arpack:0=
+ sci-libs/camd:0=
+ sci-libs/ccolamd:0=
+ sci-libs/cholmod:0=
+ sci-libs/colamd:0=
+ sci-libs/cxsparse:0=
+ sci-libs/umfpack:0= )
+ X? ( x11-libs/libX11:0= )
+ zlib? ( sys-libs/zlib:0= )"
+
+DEPEND="${RDEPEND}
+ qrupdate? ( app-misc/pax-utils )
+ sparse? ( app-misc/pax-utils )
+ java? ( >=virtual/jdk-1.6.0 )
+ doc? (
+ virtual/latex-base
+ dev-texlive/texlive-genericrecommended
+ dev-texlive/texlive-metapost
+ sys-apps/texinfo )
+ dev-util/gperf
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.4.3-texi.patch
+ "${FILESDIR}"/${PN}-3.8.0-disable-getcwd-path-max-test-as-it-is-too-slow.patch
+ "${FILESDIR}"/${PN}-4.0.0-imagemagick-configure.patch
+ "${FILESDIR}"/${PN}-4.0.0-imagemagick.patch
+ "${FILESDIR}"/${PN}-3.8.1-pkgbuilddir.patch
+)
+
+src_prepare() {
+ # nasty prefix hacks for fltk:1 and qt4 linking
+ if use prefix; then
+ use opengl && append-ldflags -Wl,-rpath,"${EPREFIX}/usr/$(get_libdir)/fltk-1"
+ use gui && append-ldflags -Wl,-rpath,"${EPREFIX}/usr/$(get_libdir)/qt4"
+ fi
+
+ # Octave fails to build with LLVM 3.5 http://savannah.gnu.org/bugs/?41061
+ use jit && \
+ has_version ">=sys-devel/llvm-3.5" && \
+ epatch "${FILESDIR}"/${PN}-4.0.0-llvm-3.5.patch && \
+ epatch "${FILESDIR}"/${PN}-4.0.0-llvm-3.5-gnulib-hg.patch
+
+ # Fix bug 501756
+ sed -i \
+ -e 's@A-Za-z0-9@[:alnum:]@g' \
+ -e 's@A-Za-z@[:alpha:]@g' \
+ libinterp/mkbuiltins || die
+ 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)"
+ --disable-64
+ $(use_enable doc docs)
+ $(use_enable java)
+ $(use_enable 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)/${PN}/${PV}" > 99octave
+ doenvd 99octave
+}