# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4 # $Id: Portfile 121952 2014-07-12 05:25:04Z sean@macports.org $ PortSystem 1.0 PortGroup active_variants 1.1 PortGroup compiler_blacklist_versions 1.0 PortGroup compilers 1.0 name octave version 3.8.1 #conflicts octave-devel categories math science maintainers michaelld openmaintainer license GPL-3 platforms darwin description a Matlab-like environment for numerical analysis long_description Octave provides a convenient command line interface \ for solving linear and nonlinear problems numerically, \ using a language that is mostly compatible with Matlab. \ It is easily extensible and customizable via \ user-defined functions or using dynamically loaded \ modules written in e.g. C++, C or Fortran. homepage http://www.gnu.org/software/octave/ dist_subdir octave distname octave-${version} master_sites gnu:octave use_bzip2 yes checksums rmd160 a76587b29a964791982bd9c803b0394411b9f874 \ sha256 d6762ed2ad4a042243a095fb44c7a1d3a91c635b6dca37fcef15a5efdffa9bbd compilers.choose fc f77 f90 compilers.setup require_fortran depends_build-append \ port:bison \ port:flex \ port:gperf \ path:bin/perl:perl5 \ port:pkgconfig depends_lib-append \ port:arpack \ port:curl \ port:fftw-3 \ port:fftw-3-single \ port:gawk \ port:glpk \ port:gnuplot \ port:GraphicsMagick \ port:grep \ port:gsed \ port:hdf5-18 \ port:less \ port:ncurses \ port:pcre \ port:qhull \ port:qrupdate \ port:readline \ port:SuiteSparse \ port:zlib depends_run-append port:epstool \ port:ghostscript \ port:transfig \ port:pstoedit universal_variant no # common configure arguments configure.args \ --disable-dependency-tracking \ --with-umfpack="-lumfpack -lSuiteSparse" \ --disable-java \ --with-opengl \ --with-framework-opengl # octave uses a number of other ports to create sources from template: # perl, gawk, gsed, flex, bison, texinfo. Make sure these are the # MacPorts' versions. Python is not used if perl is available, so # clear it out. grep is checked for in 'configure', but not used # except inside that script; include it here for completion. configure.perl ${prefix}/bin/perl configure.python ' ' configure.awk ${prefix}/bin/gawk configure.env-append GREP="${prefix}/bin/grep" \ SED="${prefix}/bin/gsed" \ TEXI2DVI="${prefix}/bin/texi2dvi" \ TEXI2PDF="${prefix}/bin/texi2pdf" configure.cppflags configure.ldflags test.run yes test.target check # Block compilers: Some older versions of CLANG do not honor the CPATH # environment variables, which is required for compiling this port # when using MacPorts. The versions seem to be: MacPorts CLANG 2.9 or # earlier, and Apple CLANG 318.0.58 or older. # # See also < http://llvm.org/bugs/show_bug.cgi?id=8971 > # < https://trac.macports.org/ticket/40250 >. compiler.blacklist-append { clang <= 318.0.61 } macports-clang-2.9 platform darwin { if {${os.major} >= 12} { # In 10.8+, the LANG environment variable needs to be set to # "C" otherwise /usr/bin/sed fails with an error. Ideally, # octave's build system would honor the environment variable # ${SED} throughout; reality is that it does not, so this # addition is required because /usr/bin/sed will be used. build.args-append LANG="C" } } if {![fortran_variant_isset]} { default_variants-append +gcc48 } # atlas does not work with g95, so always conflict with it variant atlas description {use BLAS from MacPorts' atlas port} \ conflicts g95 accelerate {} variant accelerate description \ {use BLAS from Apple's Accelerate.framework [might be buggy]} \ conflicts atlas {} if {![variant_isset accelerate] && ![variant_isset atlas]} { default_variants +atlas } # make sure that either +accelerate or +atlas is selected if {![variant_isset accelerate] && ![variant_isset atlas]} { ui_error "\n\nYou must select either the +accelerate or +atlas variant.\n" return -code error "Invalid variant selection" } if {[variant_isset accelerate]} { depends_lib-append port:dotwrp configure.args-append \ --with-blas="-ldotwrp -Wl,-framework -Wl,Accelerate" \ --with-lapack="-Wl,-framework -Wl,Accelerate" } else { depends_lib-append port:atlas # NOTE: libtatlas does not work as of 3.10.1_5 configure.args-append \ --with-blas="-lcblas -lf77blas -latlas" \ --with-lapack="-llapack" } variant docs description {Enable creation and installation of \ documentation including manpages} {} if {[variant_isset docs]} { depends_lib-append \ port:texinfo \ port:texlive-latex configure.args-append --enable-docs } else { configure.args-append --disable-docs } variant x11 description {Enable use of X11} {} if {[variant_isset x11]} { configure.args-append --with-x --x-includes=${prefix} } else { configure.args-append --without-x } variant gui description {Enable experimental gui} {} if {[variant_isset gui]} { depends_lib-append port:qt4-mac configure.args-append --enable-gui } else { configure.args-append --disable-gui } # jit build fails for 3.8.1 # variant jit description {Enable experimental JIT compiler} {} # if {[variant_isset jit]} { # depends_lib-append port:clang-3.3 # configure.args-append --enable-jit # configure.env-append LLVM_CONFIG=${prefix}/bin/llvm-config-mp-3.3 \ # SHLIB_CXXLD=clang++-mp-3.3 # configure.cc clang-mp-3.3 # configure.cxx clang++-mp-3.3 # } else { # configure.args-append --disable-jit # } variant metis description {Use SuiteSparse + Metis for graph partitioning} { notes-append "\nWARNING: ${name} variant +metis uses the metis port, whose license is incompatible with Octave's. You can use this combination locally, but you cannot distribute them as a single package (e.g., tarball, m/pkg, archive)." } if {[variant_isset metis]} { depends_lib-append port:metis configure.args-append --with-cholmod="-lcholmod -lmetis" # make sure SuiteSparse is installed with +metis require_active_variants SuiteSparse metis } else { configure.args-append --with-cholmod="-lcholmod" # make sure SuiteSparse is installed without +metis require_active_variants SuiteSparse {} metis } # check for +accelerate here as well as in dependent ports; # Apple's VecLib has bugs that cause Octave to crash sometimes, # while Atlas does not have these issues. Print a warning if this # variant is in use, but do not force the use of +atlas (for now). if {![catch {set result [active_variants arpack accelerate {}]}]} { if {$result} { notes-append "\nWARNING: Dependency 'arpack' is installed with the +accelerate variant, using Apple's Vector Libraries which have some known bugs that can cause Octave to crash if using certain functions in arpack. The +atlas variant does not have these issues with Octave, but does take many hours to compile even on modern hardware.\n" } } if {[variant_isset accelerate]} { notes-append "\nWARNING: The +accelerate variant has been selected, using Apple's Vector Libraries which have some known bugs that can cause Octave to crash. The +atlas variant does not have these issues with Octave, but does take many hours to compile even on modern hardware.\n" } post-destroot { system "echo 'graphics_toolkit(\"gnuplot\");' >> ${destroot}${prefix}/share/octave/site/m/startup/octaverc" if {[variant_isset gui]} { set appdir ${destroot}${applications_dir}/Octave.app xinstall -d ${appdir}/Contents/MacOS xinstall -d ${appdir}/Contents/Resources xinstall -m 644 ${filespath}/Info.plist ${appdir}/Contents/ xinstall -m 644 ${filespath}/Octave.icns ${appdir}/Contents/Resources/ xinstall -m 755 ${filespath}/Octave ${appdir}/Contents/MacOS reinplace -W ${appdir}/Contents "s,@@VERSION@@,${version},g" Info.plist } } livecheck.type regex livecheck.url http://www.gnu.org/software/octave/download.html livecheck.regex GNU Octave (\[\^\ \]*) was