2017-07-22 13:25:38 +00:00
|
|
|
class Octave < Formula
|
|
|
|
desc "High-level interpreted language for numerical computing"
|
|
|
|
homepage "https://www.gnu.org/software/octave/index.html"
|
|
|
|
url "https://ftp.gnu.org/gnu/octave/octave-4.2.1.tar.gz"
|
|
|
|
mirror "https://ftpmirror.gnu.org/octave/octave-4.2.1.tar.gz"
|
|
|
|
sha256 "80c28f6398576b50faca0e602defb9598d6f7308b0903724442c2a35a605333b"
|
2017-08-19 13:43:08 +00:00
|
|
|
revision 6
|
2017-07-22 13:25:38 +00:00
|
|
|
|
2017-07-23 15:45:50 +00:00
|
|
|
bottle do
|
2017-08-17 21:25:38 +00:00
|
|
|
sha256 "f608e821613391e30be7e0b32e8de5c02f010f82f1c4f7fbdc4569151dcde19c" => :sierra
|
|
|
|
sha256 "bc9b32cba8bee633d3004938739ab36f44cb6a7f40b3d1a8ceb34775d22e460f" => :el_capitan
|
|
|
|
sha256 "b88de43bb49088900538bd7e697e1ead07f100f65901a8940fae9646797412d9" => :yosemite
|
2017-07-23 15:45:50 +00:00
|
|
|
end
|
|
|
|
|
2017-07-22 13:25:38 +00:00
|
|
|
head do
|
2017-07-31 21:44:57 +00:00
|
|
|
url "https://hg.savannah.gnu.org/hgweb/octave", :branch => "default", :using => :hg
|
2017-07-22 13:25:38 +00:00
|
|
|
depends_on :hg => :build
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "bison" => :build
|
|
|
|
depends_on "icoutils" => :build
|
|
|
|
depends_on "librsvg" => :build
|
2017-08-15 09:19:43 +00:00
|
|
|
depends_on "sundials"
|
2017-07-22 13:25:38 +00:00
|
|
|
end
|
|
|
|
|
2017-08-15 09:19:43 +00:00
|
|
|
# Complete list of dependencies at https://wiki.octave.org/Building
|
2017-07-31 21:44:57 +00:00
|
|
|
depends_on "gnu-sed" => :build # https://lists.gnu.org/archive/html/octave-maintainers/2016-09/msg00193.html
|
2017-07-22 13:25:38 +00:00
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on :fortran
|
|
|
|
depends_on "arpack"
|
|
|
|
depends_on "epstool"
|
|
|
|
depends_on "fftw"
|
2017-08-15 09:19:43 +00:00
|
|
|
depends_on "fig2dev"
|
2017-07-22 13:25:38 +00:00
|
|
|
depends_on "fltk"
|
|
|
|
depends_on "fontconfig"
|
|
|
|
depends_on "freetype"
|
|
|
|
depends_on "ghostscript"
|
|
|
|
depends_on "gl2ps"
|
|
|
|
depends_on "glpk"
|
|
|
|
depends_on "gnuplot"
|
|
|
|
depends_on "graphicsmagick"
|
|
|
|
depends_on "hdf5"
|
|
|
|
depends_on "libsndfile"
|
2017-07-29 07:27:07 +00:00
|
|
|
depends_on "libtool" => :run
|
2017-07-22 13:25:38 +00:00
|
|
|
depends_on "pcre"
|
|
|
|
depends_on "portaudio"
|
|
|
|
depends_on "pstoedit"
|
|
|
|
depends_on "qhull"
|
|
|
|
depends_on "qrupdate"
|
2017-07-29 07:27:07 +00:00
|
|
|
depends_on "readline"
|
2017-07-22 13:25:38 +00:00
|
|
|
depends_on "suite-sparse"
|
|
|
|
depends_on "veclibfort"
|
2017-08-19 13:43:08 +00:00
|
|
|
depends_on :java => ["1.6+", :optional]
|
2017-07-22 13:25:38 +00:00
|
|
|
|
|
|
|
# Dependencies use Fortran, leading to spurious messages about GCC
|
|
|
|
cxxstdlib_check :skip
|
|
|
|
|
|
|
|
def install
|
|
|
|
if build.stable?
|
|
|
|
# Remove for > 4.2.1
|
|
|
|
# Remove inline keyword on file_stat destructor which breaks macOS
|
|
|
|
# compilation (bug #50234).
|
2017-07-31 21:44:57 +00:00
|
|
|
# Upstream commit from 24 Feb 2017 https://hg.savannah.gnu.org/hgweb/octave/rev/a6e4157694ef
|
2017-07-22 13:25:38 +00:00
|
|
|
inreplace "liboctave/system/file-stat.cc",
|
|
|
|
"inline file_stat::~file_stat () { }", "file_stat::~file_stat () { }"
|
|
|
|
end
|
|
|
|
|
|
|
|
# Default configuration passes all linker flags to mkoctfile, to be
|
|
|
|
# inserted into every oct/mex build. This is unnecessary and can cause
|
|
|
|
# cause linking problems.
|
|
|
|
inreplace "src/mkoctfile.in.cc", /%OCTAVE_CONF_OCT(AVE)?_LINK_(DEPS|OPTS)%/, '""'
|
|
|
|
|
2017-08-15 09:19:43 +00:00
|
|
|
args = %W[
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--disable-silent-rules
|
|
|
|
--enable-link-all-dependencies
|
|
|
|
--enable-shared
|
|
|
|
--disable-static
|
|
|
|
--disable-docs
|
|
|
|
--without-OSMesa
|
|
|
|
--without-qt
|
|
|
|
--with-hdf5-includedir=#{Formula["hdf5"].opt_include}
|
|
|
|
--with-hdf5-libdir=#{Formula["hdf5"].opt_lib}
|
|
|
|
--with-x=no
|
|
|
|
--with-blas=-L#{Formula["veclibfort"].opt_lib}\ -lvecLibFort
|
|
|
|
--with-portaudio
|
|
|
|
--with-sndfile
|
|
|
|
]
|
|
|
|
|
|
|
|
args << "--disable-java" if build.without? "java"
|
|
|
|
|
2017-07-22 13:25:38 +00:00
|
|
|
system "./bootstrap" if build.head?
|
2017-08-15 09:19:43 +00:00
|
|
|
system "./configure", *args
|
2017-07-22 13:25:38 +00:00
|
|
|
system "make", "all"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system bin/"octave", "--eval", "(22/7 - pi)/pi"
|
2017-08-15 09:19:43 +00:00
|
|
|
# This is supposed to crash octave if there is a problem with veclibfort
|
2017-07-22 13:25:38 +00:00
|
|
|
system bin/"octave", "--eval", "single ([1+i 2+i 3+i]) * single ([ 4+i ; 5+i ; 6+i])"
|
2017-08-15 09:19:43 +00:00
|
|
|
# Test java bindings: check if javaclasspath is working, return error if not
|
|
|
|
system bin/"octave", "--eval", "try; javaclasspath; catch; quit(1); end;" if build.with? "java"
|
2017-07-22 13:25:38 +00:00
|
|
|
end
|
|
|
|
end
|