Changeset 148698 for trunk/dports/math


Ignore:
Timestamp:
May 15, 2016, 9:55:48 AM (3 years ago)
Author:
mcalhoun@…
Message:

octave: update version 3.8.2->4.0.2 (major changes; fixes #47979)

Location:
trunk/dports/math/octave
Files:
2 added
3 deleted
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/dports/math/octave/Portfile

    r148380 r148698  
    1 # -*- 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
     1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
    22# $Id$
    33
    44PortSystem          1.0
     5PortGroup           compilers  1.0
     6PortGroup           muniversal 1.0
    57PortGroup           active_variants 1.1
    68PortGroup           compiler_blacklist_versions 1.0
    7 PortGroup           compilers 1.0
    89
    910name                octave
    10 
    11 version             3.8.2
    12 revision            18
    13 #conflicts           octave-devel
     11version             4.0.2
    1412categories          math science
    15 maintainers         michaelld openmaintainer
    16 license             GPL-3
    1713platforms           darwin
    18 
    19 description         a Matlab-like environment for numerical analysis
    20 long_description    Octave provides a convenient command line interface \
    21                     for solving linear and nonlinear problems numerically, \
    22                     using a language that is mostly compatible with Matlab. \
    23                     It is easily extensible and customizable via \
    24                     user-defined functions or using dynamically loaded \
    25                     modules written in e.g. C++, C or Fortran.
    26 
    27 homepage            http://www.gnu.org/software/octave/
    28 dist_subdir         octave
    29 distname            octave-${version}
     14license             GPL-3+
     15maintainers         michaelld mcalhoun openmaintainer
     16description         a high-level language for numerical computations
     17long_description    \
     18    GNU Octave is a high-level language, primarily intended for numerical \
     19    computations.  It provides a convenient command line interface for \
     20    solving linear and nonlinear problems numerically.
     21
     22homepage            http://www.gnu.org/software/octave
     23
    3024master_sites        gnu:octave
    31 use_bzip2           yes
    32 
    33 checksums           rmd160  60201b29d368d0c935a34288c227d202ae286c6c \
    34                     sha256  83bbd701aab04e7e57d0d5b8373dd54719bebb64ce0a850e69bf3d7454f33bae
    35 
    36 compilers.choose    fc f77 f90
    37 compilers.setup     require_fortran
    38 
    39 depends_build-append \
    40                     port:bison \
    41                     port:flex \
    42                     port:gperf \
    43                     path:bin/perl:perl5 \
    44                     port:pkgconfig
    45 
    46 depends_lib-append \
    47                     port:arpack \
    48                     port:curl \
    49                     port:fftw-3 \
    50                     port:fftw-3-single \
    51                     port:gawk \
    52                     port:glpk \
    53                     port:gnuplot \
    54                     port:GraphicsMagick \
    55                     port:grep \
    56                     port:gsed \
    57                     port:hdf5 \
    58                     port:less \
    59                     port:ncurses \
    60                     port:pcre \
    61                     port:qhull \
    62                     port:qrupdate \
    63                     port:readline \
    64                     port:SuiteSparse \
    65                     port:zlib \
    66                     port:texinfo
    67 
    68 depends_run-append  port:epstool \
    69                     port:ghostscript \
    70                     port:transfig \
    71                     port:pstoedit
    72 
    73 # Octave's build system does not produce universal binaries
    74 
    75 universal_variant   no
    76 
    77 # Don't link with "-flat_namespace -undefined suppress"
    78 # on Mac OS X 10.10 Yosemite and later.
    79 
    80 patchfiles-append   patch-yosemite-libtool.diff
    81 
    82 # Fix certain versions of libc++ use of 'pow';
    83 # See also: < http://llvm.org/bugs/show_bug.cgi?id=21083 >
    84 #           < https://trac.macports.org/ticket/45210 >
    85 # Adding in this patch will not hurt when using a working
    86 # version of libcxx (< 1101), nor with using libstdcxx
    87 # (where _LIBCPP_VERSION is not defined).
    88 #
    89 # REMINDER: check without this patch when new libcxx
    90 # is available, to determine a stopping point for
    91 # when this issue was fixed; add that version to
    92 # the patch to "mx-inlines.cc".
    93 
    94 patchfiles-append   patch-clang-libcxx.diff
    95 
    96 # fix gl2ps renderer interface for compiling using older clang.
    97 # See also: < https://trac.macports.org/ticket/44704 >
    98 
    99 patchfiles-append   patch-gl2ps_renderer.diff
    100 
    101 # common configure arguments
    102 
    103 configure.args \
    104     --disable-dependency-tracking \
    105     --with-umfpack="-lumfpack -lSuiteSparse" \
    106     --enable-docs \
    107     --enable-strict-warning-flags \
    108     --disable-silent-rules
    109 
    110 # when using "hdf5 +mpich", have to manually include
    111 # "/opt/local/include/mpich-mp". See also:
    112 # < https://trac.macports.org/ticket/47618 >
    113 
    114 pre-configure {
    115     # is hdf5 installed and active?
    116     if {![catch {set installed [lindex [registry_active hdf5] 0]}]} {
    117         # yes: is this one installed with +mpich*?
    118         set _variants [lindex ${installed} 3]
    119         if {[string first {mpich} ${_variants}] != -1} {
    120             # yes; set cpath for both configure and build stages
    121             compiler.cpath-append ${prefix}/include/mpich-mp
    122             # and, set the configure flag, just in case
    123             configure.args-append \
    124                 "--with-hdf5-includedir=${prefix}/include/mpich-mp"
    125         }
    126     }
    127 }
    128 
    129 # octave uses a number of other ports to create sources from template:
    130 # perl, gawk, gsed, flex, bison, texinfo.  Make sure these are the
    131 # MacPorts' versions.  Python is not used if perl is available, so
    132 # clear it out.  grep is checked for in 'configure', but not used
    133 # except inside that script; include it here for completion.
    134 
    135 configure.perl      ${prefix}/bin/perl
    136 configure.python    ' '
    137 configure.awk       ${prefix}/bin/gawk
    138 configure.env-append GREP="${prefix}/bin/grep" \
    139                      SED="${prefix}/bin/gsed" \
    140                      TEXI2DVI="${prefix}/bin/texi2dvi" \
    141                      TEXI2PDF="${prefix}/bin/texi2pdf"
    142 configure.cppflags
    143 configure.ldflags
    144 
    145 test.run            yes
    146 test.target         check
     25
     26checksums           rmd160  2f910e95b01d49d9ecfece61c901709b124227ac \
     27                    sha256  39cd8fd36c218fc00adace28d74a6c7c9c6faab7113a5ba3c4372324c755bdc1
    14728
    14829# Block compilers: Some older versions of CLANG do not honor the CPATH
     
    15334# See also < http://llvm.org/bugs/show_bug.cgi?id=8971 >
    15435#          < https://trac.macports.org/ticket/40250 >.
    155 
    15636compiler.blacklist-append { clang <= 318.0.61 }
    15737
    158 platform darwin {
    159     if {${os.major} >= 12} {
    160 
    161         # In 10.8+, the LANG environment variable needs to be set to
    162         # "C" otherwise /usr/bin/sed fails with an error.  Ideally,
    163         # octave's build system would honor the environment variable
    164         # ${SED} throughout; reality is that it does not, so this
    165         # addition is required because /usr/bin/sed will be used.
    166 
    167         build.args-append LANG="C"
    168     }
    169 }
    170 
    171 # atlas does not work with g95, so always conflict with it
    172 
    173 variant atlas description {use BLAS from MacPorts' atlas port} \
    174     conflicts g95 accelerate {
    175 
     38# see http://savannah.gnu.org/bugs/?func=detailitem&item_id=46592
     39patchfiles-append \
     40    patch-e870a68742a6.diff
     41
     42# see http://savannah.gnu.org/bugs/?41027
     43patchfiles-append   \
     44    octave-bug_41027.patch
     45
     46# Don't link with "-flat_namespace -undefined suppress"
     47# on Mac OS X 10.10 Yosemite and later.
     48patchfiles-append   patch-yosemite-libtool.diff
     49
     50pre-patch {
     51    # code located in pre-patch because variants from PortGroup compilers must
     52    #    be evaluated before it can be determined if clang is being used
     53
     54    # see http://trac.macports.org/ticket/45011
     55    # see http://savannah.gnu.org/bugs/?43298
     56    set libcxxbug no
     57    if { ${configure.cc} eq "/usr/bin/clang" && [lindex [split ${xcodeversion} .] 0] eq 6 } {
     58        set libcxxbug yes
     59    } elseif { [variant_exists clang35] && [variant_isset clang35] } {
     60        set libcxxbug yes
     61    }
     62    if { ${libcxxbug} } {
     63        patchfiles-append   \
     64            clang-libcxx-fix.patch
     65    }
     66
     67    # see https://trac.macports.org/ticket/44704
     68    set gl2psbug no
     69    if { ${configure.cc} eq "/usr/bin/clang" && [vercmp ${xcodeversion} 5.0.0] < 0 } {
     70        set gl2psbug yes
     71    } elseif { [variant_exists clang33] && [variant_isset clang33] } {
     72        set gl2psbug yes
     73    }
     74    if { ${gl2psbug} } {
     75        patchfiles-append   patch-gl2ps_renderer.diff
     76    }
     77}
     78
     79# avoid depends_build-append port:coreutils
     80configure.env-append MKDIR_P="/bin/mkdir -p"
     81
     82# avoid depends_build-append port:cctools
     83configure.env-append RANLIB=/usr/bin/ranlib
     84
     85# main octave port lists as a depends_lib
     86# configure.ac list it among the "[p]rograms used in Makefiles"
     87depends_build-append port:gawk
     88configure.awk ${prefix}/bin/gawk
     89
     90# in configure.ac, said to be "[p]rograms used to generate icons file formats
     91depends_build-append \
     92    port:icoutils    \
     93    port:librsvg
     94configure.env-append              \
     95    ICOTOOL=${prefix}/bin/icotool \
     96    RSVG_CONVERT=${prefix}/bin/rsvg-convert
     97
     98# main octave port lists as a depends_lib
     99# configure.ac list it among the "[p]rograms used in Makefiles"
     100depends_build-append port:grep
     101configure.env-append  GREP=${prefix}/bin/grep
     102configure.env-append EGREP=${prefix}/bin/egrep
     103configure.env-append FGREP=${prefix}/bin/fgrep
     104
     105# configure.ac list it among the "[p]rograms used in Makefiles"
     106depends_build-append port:findutils
     107configure.env-append FIND=${prefix}/bin/gfind
     108
     109# main octave port lists as a depends_lib
     110# configure.ac list it among the "[p]rograms used in Makefiles"
     111depends_build-append port:gsed
     112configure.env-append SED=${prefix}/bin/gsed
     113
     114depends_build-append port:flex
     115configure.env-append LEX=${prefix}/bin/flex
     116
     117depends_build-append port:bison
     118configure.env-append YACC="${prefix}/bin/bison -y"
     119
     120depends_build-append port:gperf
     121configure.env-append GPERF=/usr/bin/gperf
     122
     123# configure.ac list it among the "[p]rograms used in Makefiles"
     124depends_build-append port:perl5
     125configure.perl ${prefix}/bin/perl5
     126
     127# avoid depends_build-append port:desktop-file-utils
     128#configure.env-append DESKTOP_FILE_INSTALL=""
     129configure.env-append ac_cv_prog_DESKTOP_FILE_INSTALL=""
     130
     131depends_build-append \
     132    port:pkgconfig
     133
     134compilers.choose    fc f77 f90 cc cxx
     135
     136# for now, limit the number of variants
     137# some of these compilers may work fine
     138compilers.setup     \
     139    require_fortran \
     140    -dragonegg      \
     141    -gcc49          \
     142    -gcc48          \
     143    -gcc46          \
     144    -gcc45          \
     145    -gcc44          \
     146    -g95            \
     147    -llvm           \
     148    -gcc47          \
     149    -gcc46          \
     150    -gcc45          \
     151    -gcc44          \
     152    -clang36        \
     153    -clang35        \
     154    -clang34        \
     155    -clang33
     156
     157# offscreen rendering with OpenGL via osmesa would be nice to have, but the following
     158#    causes a segmentation fault:
     159#    h = figure ("visible", "off"); fn = tempname (); sombrero (); __osmesa_print__ (h, fn, "svg");
     160#
     161# solution is ???
     162#
     163#depends_lib-append port:mesa
     164configure.args-append       \
     165    --without-OSMesa
     166
     167#configure.args-append --with-shell=???
     168
     169configure.args-append       \
     170    --with-framework-carbon \
     171    --without-x             \
     172    --enable-static
     173
     174configure.args-append       \
     175    --disable-openmp
     176
     177configure.args-append       \
     178    --disable-java          \
     179    --disable-gui           \
     180    --without-fltk          \
     181    --without-opengl        \
     182    --disable-jit           \
     183    --without-sndfile       \
     184    --without-portaudio     \
     185    --without-magick        \
     186    --disable-docs
     187
     188# in configure.ac, listed as one of "[p]rograms used when running Octave"
     189depends_lib-append port:python27
     190configure.python ${prefix}/bin/python2.7
     191
     192# in configure.ac, listed as one of "[p]rograms used when running Octave"
     193depends_lib-append port:ghostscript
     194configure.env-append GHOSTSCRIPT=${prefix}/bin/gs
     195
     196# in configure.ac, listed as one of "[p]rograms used when running Octave"
     197depends_lib-append port:gnuplot
     198configure.env-append GNUPLOT=${prefix}/bin/gnuplot
     199
     200# in configure.ac, listed as one of "[p]rograms used when running Octave"
     201depends_lib-append port:less
     202configure.env-append DEFAULT_PAGER=${prefix}/bin/less
     203
     204depends_lib-append   port:ncurses
     205depends_lib-append   port:readline
     206depends_lib-append   port:pcre
     207
     208#--without-amd
     209#--without-camd
     210#--without-colamd
     211#--without-cholmod
     212#--without-cxsparse
     213#--without-umfpack
     214depends_lib-append  port:SuiteSparse
     215foreach lib {amd camd colamd cholmod cxsparse umfpack} {
     216    configure.args-append \
     217        --with-${lib}="-l${lib} -lsuitesparseconfig"
     218}
     219
     220#--without-qhull
     221depends_lib-append  port:qhull
     222
     223#--without-z
     224depends_lib-append  port:zlib
     225
     226#--without-hdf5
     227depends_lib-append  port:hdf5
     228
     229#--disable-fftw-threads
     230#--without-fftw3
     231#--without-fftw3f
     232depends_lib-append  port:fftw-3
     233depends_lib-append  port:fftw-3-single
     234
     235#--without-glpk
     236depends_lib-append  port:glpk
     237
     238#--without-curl
     239depends_lib-append  port:curl
     240
     241#--without-qrupdate
     242depends_lib-append port:qrupdate
     243
     244#--without-arpack
     245depends_lib-append port:arpack
     246
     247#--without-openssl
     248depends_lib-append port:openssl
     249
     250# fortran arch flag is not set automatically
     251if {![variant_isset universal]} {
     252    if {${build_arch} eq "x86_64" || ${build_arch} eq "ppc64"} {
     253        configure.fflags-append -m64
     254    } else {
     255        configure.fflags-append -m32
     256    }
     257}
     258
     259# see etc/README.MacOS
     260depends_run-append   \
     261    port:epstool     \
     262    port:ghostscript \
     263    port:transfig    \
     264    port:pstoedit
     265
     266variant accelerate description {use BLAS from Apple's Accelerate.framework} conflicts atlas openblas {
     267    depends_lib-append port:vecLibFort
     268
     269    configure.args-append        \
     270        --with-blas=-lvecLibFort \
     271        --with-lapack=""
     272}
     273
     274variant openblas description {use BLAS from MacPorts' openblas port} conflicts atlas accelerate {
     275
     276    depends_lib-append path:lib/libopenblas.dylib:OpenBLAS
     277    # LAPACK required
     278    require_active_variants path:lib/libopenblas.dylib:OpenBLAS lapack
     279
     280    # replicate default values if configure script finds openblas on its own
     281    configure.args-append        \
     282        --with-blas=-lopenblas   \
     283        --with-lapack=""
     284}
     285
     286variant atlas description {use BLAS from MacPorts' atlas port} conflicts accelerate openblas {
    176287    depends_lib-append port:atlas
    177     # NOTE: libtatlas does not work as of 3.10.1_5
    178     configure.args-append \
     288
     289    # replicate default values if configure script finds atlas on its own
     290    configure.args-append        \
    179291        --with-blas="-lcblas -lf77blas -latlas" \
    180         --with-lapack="-llapack"
    181 
    182 }
    183 
    184 variant accelerate description \
    185     {use BLAS from Apple's Accelerate.framework [might be buggy]} \
    186     conflicts atlas {
    187 
    188     depends_lib-append port:vecLibFort
    189     configure.args-append \
    190         --with-blas=-lvecLibFort \
    191         --with-lapack="-Wl,-framework -Wl,Accelerate"
    192 
    193 }
    194 
    195 if {![variant_isset accelerate] && ![variant_isset atlas]} {
    196 
    197     # when neither +accelerate nor +atlas is selected, default to the
    198     # correct one for the selected Fortran compiler.
    199     if {![variant_isset g95]} {
    200         default_variants +atlas
    201     } else {
    202         default_variants +accelerate
    203     }
    204 
    205 }
    206 
    207 # make sure that either +accelerate or +atlas is selected
    208 
    209 if {![variant_isset accelerate] && ![variant_isset atlas]} {
    210 
    211     ui_error "\n\nYou must select either the +accelerate or +atlas variant.\n"
     292        --with-lapack=-llapack
     293}
     294
     295if {![variant_isset accelerate] && ![variant_isset openblas] && ![variant_isset atlas] } {
     296    default_variants-append +accelerate
     297}
     298
     299if {![variant_isset accelerate] && ![variant_isset openblas] && ![variant_isset atlas] } {
     300    ui_error "\n\nYou must select either the +accelerate, +atlas, or +openblas variant.\n"
    212301    return -code error "Invalid variant selection"
    213 
    214 }
    215 
    216 variant x11 conflicts glgui description {Enable use of X11} {}
    217 
    218 if {[variant_isset x11]} {
    219 
    220     configure.args-append --with-x --x-includes=${prefix}
    221 
     302}
     303
     304variant java description {enable Java interface} {
     305    PortGroup java 1.0
     306    configure.args-replace --disable-java --enable-java
     307}
     308default_variants-append +java
     309
     310variant qt4gui description {build the GUI using Qt4} {
     311    PortGroup qt4 1.0
     312    depends_lib-append  port:qscintilla
     313    configure.args-replace --disable-gui --enable-gui
     314}
     315default_variants-append +qt4gui
     316
     317variant fltk description {enable fltk as a graphics toolkit for plotting} {
     318    depends_lib-append path:lib/libfltk.dylib:fltk
     319
     320    configure.args-replace --without-fltk --with-fltk
     321}
     322default_variants-append +fltk
     323
     324if {[variant_isset fltk] || [variant_isset qt4gui]} {
     325
     326    # native_graphics (fltk) and gui (Qt) require OpenGL and font and printing capabilities
     327    depends_lib-append  \
     328        port:fontconfig \
     329        port:freetype   \
     330        port:gl2ps
     331
     332    configure.args-replace --without-opengl --with-framework-opengl
     333}
     334
     335if {[variant_isset fltk] && [variant_isset qt4gui]} {
     336    notes-append "unless octave is run with --no-gui-libs, graphics_toolkit(\"fltk\") will cause a crash"
     337}
     338
     339variant jit description {enable JIT compiler (EXPERIMENTAL)} {
     340    # JIT requires LLVM, so select a version to use
     341    set llvm_ver 3.8
     342
     343    # prevent multiple versions of llvm being required
     344    # if clangXY compiler is requested, use llvm-X.Y
     345    foreach clang ${compilers.clang_variants} {
     346        if { [variant_exists ${clang}] && [variant_isset ${clang}] } {
     347            set llvm_ver [string index ${clang} end-1].[string index ${clang} end]
     348        }
     349    }
     350
     351    depends_lib-append port:llvm-${llvm_ver}
     352    configure.args-replace --disable-jit --enable-jit
     353    configure.env-append LLVM_CONFIG=${prefix}/bin/llvm-config-mp-${llvm_ver}
     354    configure.cxxflags-append -std=c++11
     355}
     356
     357variant sound description {enable audio support (file I/O and playback)} {
     358    depends_lib-append port:libsndfile
     359    depends_lib-append port:portaudio
     360
     361    configure.args-replace --without-sndfile   --with-sndfile
     362    configure.args-replace --without-portaudio --with-portaudio
     363}
     364default_variants-append +sound
     365
     366variant app description "build application bundle to launch ${subport}" {
     367    depends_build-append port:ImageMagick
     368
     369    global appName
     370    set appName Octave.app
     371
     372    post-build {
     373        xinstall -d -p -m 0755 ${worksrcpath}/${appName}/Contents
     374        xinstall -d -p -m 0755 ${worksrcpath}/${appName}/Contents/Resources
     375        xinstall -d -p -m 0755 ${worksrcpath}/${appName}/Contents/MacOS
     376
     377        set script [open "${worksrcpath}/${appName}/Contents/MacOS/Octave" w 0755]
     378        if { [variant_isset qt4gui] } {
     379            puts ${script} "#!/bin/sh"
     380            puts ${script} ""
     381            puts ${script} "${prefix}/bin/octave-${version} --force-gui"
     382        } else {
     383            puts ${script} "#!/usr/bin/osascript"
     384            puts ${script} ""
     385            puts ${script} "tell application \"Terminal\" to do script \"${prefix}/bin/octave-${version} --no-gui-libs; exit\""
     386        }
     387        close ${script}
     388
     389        #NSHumanReadableCopyright      ''
     390        #LSUIElement                   1
     391        set values "
     392            CFBundleDevelopmentRegion     English
     393            CFBundleExecutable            Octave
     394            CFBundleIconFile              Octave.icns
     395            CFBundleDocumentTypes         {-array \'{\"CFBundleTypeExtensions\" = (\"m\"); \"CFBundleTypeOSTypes\" = (\"Mfile\"); \"CFBundleTypeRole\" = \"Editor\";}\'}
     396            CFBundleIdentifier            org.octave.Octave
     397            CFBundleInfoDictionaryVersion 6.0
     398            CFBundleSignature             Octave
     399            CFBundleVersion               ${version}
     400            CFBundleShortVersionString    ${version}
     401        "
     402        foreach {key value} ${values} {
     403            system "/usr/bin/defaults write ${worksrcpath}/${appName}/Contents/Info ${key} ${value}"
     404        }
     405
     406        # have Info.plist be human readable
     407        system "/usr/bin/plutil -convert xml1 ${worksrcpath}/${appName}/Contents/Info.plist"
     408
     409        # conversion by plutil set verys limited permissions
     410        system "/bin/chmod 0644 ${worksrcpath}/${appName}/Contents/Info.plist"
     411
     412        xinstall -d -m 0755 ${worksrcpath}/Octave.iconset
     413
     414        # values from original SVG file
     415        set svg    etc/icons/octave-logo.svg
     416        set width  283.28912
     417        set height 283.28833
     418        set dpi    90
     419
     420        foreach res {16 32 128 256 512} {
     421
     422            set hres [expr 2*${res}]
     423
     424            # find new density so that converted PNG files do not look pixelated
     425            set denw  [expr ${dpi}*${res}/${width}]
     426            set denh  [expr ${dpi}*${res}/${height}]
     427
     428            set hdenw [expr 2*${denw}]
     429            set hdenh [expr 2*${denh}]
     430
     431            system -W ${worksrcpath} "${prefix}/bin/convert -background transparent -resize ${res}x${res}   -density ${denw}x${denh}   ${svg} Octave.iconset/icon_${res}x${res}.png"
     432            system -W ${worksrcpath} "${prefix}/bin/convert -background transparent -resize ${hres}x${hres} -density ${hdenw}x${hdenh} ${svg} Octave.iconset/icon_${res}x${res}@2x.png"
     433        }
     434
     435        system -W ${worksrcpath} "/usr/bin/iconutil -c icns -o ${appName}/Contents/Resources/Octave.icns Octave.iconset"
     436    }
     437
     438    post-destroot {
     439        copy ${worksrcpath}/${appName} ${destroot}${applications_dir}
     440    }
     441}
     442default_variants-append +app
     443
     444variant docs description {build documentation files} {
     445    depends_build-append port:texinfo
     446    configure.env-append                \
     447        MAKEINFO=${prefix}/bin/makeinfo \
     448        TEXI2DVI=${prefix}/bin/texi2dvi \
     449        TEXI2PDF=${prefix}/bin/texi2pdf
     450
     451    # see https://lists.macosforge.org/pipermail/macports-dev/2016-January/032293.html
     452    depends_build-append \
     453        port:texlive-basic \
     454        port:texlive-latex
     455
     456    # see #51132
     457    depends_build-append \
     458        port:texlive-fonts-recommended
     459
     460    configure.args-replace --disable-docs --enable-docs
     461}
     462default_variants-append +docs
     463
     464# GraphicsMagick and octave need to be built with the same C++ standard library
     465# or else undefined symbols:
     466#    "Magick::Image::ping(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)"
     467set magickConflict {}
     468set magickDefault yes
     469if {${configure.cxx_stdlib} ne "libstdc++"} {
     470    foreach gccVar ${compilers.gcc_variants} {
     471        if {[variant_exists ${gccVar}] } {
     472            lappend magickConflict ${gccVar}
     473
     474            if {[variant_isset ${gccVar}] } {
     475                set magickDefault no
     476            }
     477        }
     478    }
     479}
     480eval "variant graphicsmagick description {use GraphicsMagick for image I/O} conflicts ${magickConflict} {
     481    depends_lib-append port:GraphicsMagick
     482    configure.args-replace --without-magick --with-magick=GraphicsMagick
     483}"
     484if {${magickDefault}} {
     485    default_variants-append +graphicsmagick
     486}
     487
     488# remove architecture flags from header file
     489if { [variant_exists universal] && [variant_isset universal] } {
     490    merger-post-destroot {
     491        foreach arch ${universal_archs_to_use} {
     492            set hfile ${destroot}-${arch}${prefix}/include/octave-${version}/octave/oct-conf.h
     493            reinplace -E "s:\\w*-arch ${arch}::g" ${hfile}
     494            reinplace -E {s:\\w*-m32::g}          ${hfile}
     495            reinplace -E {s:\\w*-m64::g}          ${hfile}
     496        }
     497    }
    222498} else {
    223 
    224     configure.args-append --without-x
    225 
    226 }
    227 
    228 if {![variant_isset x11]} {
    229 
    230     default_variants +glgui
    231 
    232 }
    233 
    234 variant glgui conflicts x11 description {Enable OpenGL GUI (via FLTK) as the default graphical front-end} {
    235 
    236     depends_lib-append path:lib/libfltk.dylib:fltk
    237     depends_lib-append port:fontconfig \
    238                        port:freetype \
    239                        port:gl2ps
    240 
    241 }
    242 
    243 if {[variant_isset glgui]} {
    244 
    245     configure.args-append --with-opengl
    246 
    247 } else {
    248 
    249     configure.args-append --without-opengl
    250 
    251 }
    252 
    253 variant gui requires qtgui description {Legacy variant} {}
    254 
    255 variant qtgui description {Enable experimental Qt GUI Application} {
    256 
    257     PortGroup qt4 1.0
    258     depends_lib-append port:qscintilla
    259 
    260 }
    261 
    262 if {[variant_isset qtgui]} {
    263 
    264     configure.args-append --enable-gui
    265 
    266 } else {
    267 
    268     configure.args-append --disable-gui
    269 
    270 }
    271 
    272 variant java description {Enable Java interface} {}
    273 
    274 if {[variant_isset java]} {
    275 
    276     configure.args-append --enable-java
    277 
    278 } else {
    279 
    280     configure.args-append --disable-java
    281 
    282 }
    283 
    284 # jit build fails for 3.8.1
    285 # variant jit description {Enable experimental JIT compiler} {}
    286 
    287 # if {[variant_isset jit]} {
    288 
    289 #     depends_lib-append    port:clang-3.3
    290 #     configure.args-append --enable-jit
    291 #     configure.env-append  LLVM_CONFIG=${prefix}/bin/llvm-config-mp-3.3 \
    292 #                           SHLIB_CXXLD=clang++-mp-3.3
    293 #     configure.cc          clang-mp-3.3
    294 #     configure.cxx         clang++-mp-3.3
    295 
    296 # } else {
    297 
    298 #     configure.args-append --disable-jit
    299 
    300 # }
    301 
    302 variant metis description {Use SuiteSparse + Metis for graph partitioning} {
    303 
    304     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)."
    305 
    306     depends_lib-append      port:metis
    307 
    308 }
    309 
    310 if {[variant_isset metis]} {
    311 
    312     configure.args-append   --with-cholmod="-lcholmod -lmetis"
    313 
    314     # make sure SuiteSparse is installed with +metis
    315     require_active_variants SuiteSparse metis
    316 
    317 } else {
    318 
    319     configure.args-append   --with-cholmod="-lcholmod"
    320 
    321     # make sure SuiteSparse is installed without +metis
    322     require_active_variants SuiteSparse {} metis
    323 
    324 }
    325 
    326 # check for +accelerate here as well as in dependent ports;
    327 # Apple's VecLib has bugs that cause Octave to crash sometimes,
    328 # while Atlas does not have these issues.  Print a warning if this
    329 # variant is in use, but do not force the use of +atlas (for now).
    330 
    331 if {![catch {set result [active_variants arpack accelerate {}]}]} {
    332     if {$result} {
    333         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"
    334     }
    335 }
    336 
    337 if {[variant_isset accelerate]} {
    338     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"
     499    post-destroot {
     500        set hfile ${destroot}${prefix}/include/octave-${version}/octave/oct-conf.h
     501        reinplace -E "s:\\w*-arch ${build_arch}::g" ${hfile}
     502        reinplace -E {s:\\w*-m32::g}                ${hfile}
     503        reinplace -E {s:\\w*-m64::g}                ${hfile}
     504    }
    339505}
    340506
    341507post-destroot {
    342 
    343     # select the default graphics toolkit depending on the +glgui variant
    344 
    345     if {[variant_isset glgui]} {
    346         system "echo 'graphics_toolkit(\"fltk\");' >> ${destroot}${prefix}/share/octave/site/m/startup/octaverc"
    347     } else {
    348         system "echo 'graphics_toolkit(\"gnuplot\");' >> ${destroot}${prefix}/share/octave/site/m/startup/octaverc"
    349     }
    350 
    351     # install the libc++ fix, no matter if used or not, since it is
    352     # required for projects including these headers.
    353 
    354     xinstall -m 644 ${worksrcpath}/liboctave/operators/libcxx-fix.h \
    355         ${destroot}${prefix}/include/${name}-${version}/${name}/libcxx-fix.h
    356 
    357     # when doing +qtgui variant, create the Mac OS X .app
    358 
    359     if {[variant_isset qtgui]} {
    360         set appdir ${destroot}${applications_dir}/Octave.app
    361         xinstall -d ${appdir}/Contents/MacOS
    362         xinstall -d ${appdir}/Contents/Resources
    363 
    364         xinstall -m 644 ${filespath}/Info.plist ${appdir}/Contents/
    365         xinstall -m 644 ${filespath}/Octave.icns ${appdir}/Contents/Resources/
    366         xinstall -m 755 ${filespath}/Octave ${appdir}/Contents/MacOS
    367 
    368         reinplace -W ${appdir}/Contents "s,@@VERSION@@,${version},g" Info.plist
    369         reinplace -W ${appdir}/Contents/MacOS "s,@@PREFIX@@,${prefix},g" Octave
    370     }
    371 }
    372 
    373 livecheck.type      regex
    374 livecheck.url       http://www.gnu.org/software/octave/download.html
    375 livecheck.regex     GNU Octave (\[\^\ \]*) was
     508    # put any startup commands in ${destroot}${prefix}/share/octave/${version}/m/startup/octaverc
     509    # see https://www.gnu.org/software/octave/doc/interpreter/Startup-Files.html
     510    file delete ${destroot}${prefix}/share/octave/site/m/startup/octaverc
     511
     512    if {[file exists ${worksrcpath}/liboctave/operators/libcxx-fix.h]} {
     513        # install the libc++ fix, no matter if used or not, since it is
     514        # required for projects including these headers.
     515        xinstall -m 644 ${worksrcpath}/liboctave/operators/libcxx-fix.h \
     516            ${destroot}${prefix}/include/${name}-${version}/${name}/libcxx-fix.h
     517    }
     518}
     519
     520test.run    yes
     521test.target check
  • trunk/dports/math/octave/files/clang-libcxx-fix.patch

    r148686 r148698  
    8888+}
    8989diff -r 91a6f06c5052 -r 1433cd4f7b7b liboctave/operators/mx-inlines.cc
    90 --- liboctave/operators/mx-inlines.cc   Thu Oct 09 20:38:04 2014 -0700
     90--- a/liboctave/operators/mx-inlines.cc Thu Oct 09 20:38:04 2014 -0700
    9191+++ liboctave/operators/mx-inlines.cc   Sun Oct 12 00:00:55 2014 +0800
    92 @@ -306,7 +306,13 @@
     92@@ -307,7 +307,13 @@
    9393 
    9494 // Let the compiler decide which pow to use, whichever best matches the
  • trunk/dports/math/octave/files/patch-gl2ps_renderer.diff

    r133137 r148698  
    1 --- libinterp/corefcn/gl2ps-renderer.cc.orig
    2 +++ libinterp/corefcn/gl2ps-renderer.cc
    3 @@ -34,6 +34,9 @@ along with Octave; see the file COPYING.  If not, see
    4  #include "gl2ps-renderer.h"
     1--- libinterp/corefcn/gl2ps-renderer.h.orig     2016-05-08 02:17:06.000000000 -0700
     2+++ libinterp/corefcn/gl2ps-renderer.h  2016-05-08 02:26:05.000000000 -0700
     3@@ -35,8 +35,7 @@
     4 glps_renderer : public opengl_renderer
     5 {
     6 public:
     7-  glps_renderer (FILE *_fp, const std::string& _term)
     8-    : opengl_renderer () , fp (_fp), term (_term), fontsize (), fontname () { }
     9+  glps_renderer (FILE *_fp, const std::string& _term);
     10 
     11   ~glps_renderer (void) { }
     12 
     13@@ -54,34 +53,9 @@
     14   void draw_pixels (GLsizei w, GLsizei h, GLenum format,
     15                     GLenum type, const GLvoid *data);
     16 
     17-  void set_linestyle (const std::string& s, bool use_stipple = false)
     18-  {
     19-    opengl_renderer::set_linestyle (s, use_stipple);
     20-
     21-    if (s == "-" && ! use_stipple)
     22-      gl2psDisable (GL2PS_LINE_STIPPLE);
     23-    else
     24-      gl2psEnable (GL2PS_LINE_STIPPLE);
     25-  }
     26-
     27-  void set_polygon_offset (bool on, float offset = 0.0f)
     28-  {
     29-    if (on)
     30-      {
     31-        opengl_renderer::set_polygon_offset (on, offset);
     32-        gl2psEnable (GL2PS_POLYGON_OFFSET_FILL);
     33-      }
     34-    else
     35-      {
     36-        gl2psDisable (GL2PS_POLYGON_OFFSET_FILL);
     37-        opengl_renderer::set_polygon_offset (on, offset);
     38-      }
     39-  }
     40-
     41-  void set_linewidth (float w)
     42-  {
     43-    gl2psLineWidth (w);
     44-  }
     45+  void set_linestyle (const std::string& s, bool use_stipple = false);
     46+  void set_polygon_offset (bool on, float offset = 0.0f);
     47+  void set_linewidth (float w);
     48 
     49 private:
     50   int alignment_to_mode (int ha, int va) const;
     51--- libinterp/corefcn/gl2ps-renderer.cc.orig    2016-05-08 02:16:56.000000000 -0700
     52+++ libinterp/corefcn/gl2ps-renderer.cc 2016-05-08 02:29:17.000000000 -0700
     53@@ -38,6 +38,9 @@
    554 #include "gl2ps.h"
     55 #include "sysdep.h"
    656 
    757+glps_renderer::glps_renderer (FILE *_fp, const std::string& _term)
     
    959+
    1060 void
    11  glps_renderer::draw (const graphics_object& go, const std::string print_cmd)
     61 glps_renderer::draw (const graphics_object& go, const std::string& print_cmd)
    1262 {
    13 @@ -253,4 +256,31 @@ glps_renderer::draw_text (const text::properties& props)
    14                  alignment_to_mode (halign, valign), props.get_rotation ());
     63@@ -346,6 +349,38 @@
     64     octave_pclose (f);
    1565 }
    1666 
     
    2777+
    2878+void
    29 +glps_renderer::set_polygon_offset (bool on, double offset)
     79+glps_renderer::set_polygon_offset (bool on, float offset)
    3080+{
    31 +  opengl_renderer::set_polygon_offset (on, offset);
    3281+  if (on)
    33 +    gl2psEnable (GL2PS_POLYGON_OFFSET_FILL);
     82+    {
     83+      opengl_renderer::set_polygon_offset (on, offset);
     84+      gl2psEnable (GL2PS_POLYGON_OFFSET_FILL);
     85+    }
    3486+  else
    35 +    gl2psDisable (GL2PS_POLYGON_OFFSET_FILL);
     87+    {
     88+      gl2psDisable (GL2PS_POLYGON_OFFSET_FILL);
     89+      opengl_renderer::set_polygon_offset (on, offset);
     90+    }
    3691+}
    3792+
     
    4398+
    4499 #endif
    45 --- libinterp/corefcn/gl2ps-renderer.h.orig
    46 +++ libinterp/corefcn/gl2ps-renderer.h
    47 @@ -33,8 +33,7 @@ OCTINTERP_API
    48  glps_renderer : public opengl_renderer
    49  {
    50  public:
    51 -  glps_renderer (FILE *_fp, const std::string& _term)
    52 -    : opengl_renderer () , fp (_fp), term (_term), fontsize (), fontname () { }
    53 +  glps_renderer (FILE *_fp, const std::string& _term);
    54100 
    55    ~glps_renderer (void) { }
    56  
    57 @@ -52,29 +51,9 @@ protected:
    58    void draw_pixels (GLsizei w, GLsizei h, GLenum format,
    59                      GLenum type, const GLvoid *data);
    60  
    61 -  void set_linestyle (const std::string& s, bool use_stipple = false)
    62 -  {
    63 -    opengl_renderer::set_linestyle (s, use_stipple);
    64 -
    65 -    if (s == "-" && ! use_stipple)
    66 -      gl2psDisable (GL2PS_LINE_STIPPLE);
    67 -    else
    68 -      gl2psEnable (GL2PS_LINE_STIPPLE);
    69 -  }
    70 -
    71 -  void set_polygon_offset (bool on, double offset = 0.0)
    72 -  {
    73 -    opengl_renderer::set_polygon_offset (on, offset);
    74 -    if (on)
    75 -      gl2psEnable (GL2PS_POLYGON_OFFSET_FILL);
    76 -    else
    77 -      gl2psDisable (GL2PS_POLYGON_OFFSET_FILL);
    78 -  }
    79 -
    80 -  void set_linewidth (float w)
    81 -  {
    82 -    gl2psLineWidth (w);
    83 -  }
    84 +  void set_linestyle (const std::string& s, bool use_stipple = false);
    85 +  void set_polygon_offset (bool on, double offset = 0.0);
    86 +  void set_linewidth (float w);
    87  
    88  private:
    89    int alignment_to_mode (int ha, int va) const;
     101 void
  • trunk/dports/math/octave/files/patch-yosemite-libtool.diff

    r132228 r148698  
    1 Index: configure
    2 ===================================================================
    3 --- configure.orig
    4 +++ configure
    5 @@ -21080,7 +21080,7 @@ $as_echo "$lt_cv_ld_force_load" >&6; }
     1--- configure.orig      2016-05-08 01:48:51.000000000 -0700
     2+++ configure   2016-05-08 01:48:40.000000000 -0700
     3@@ -21982,7 +21982,7 @@
    64       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
    75        10.0,*86*-darwin8*|10.0,*-darwin[91]*)
Note: See TracChangeset for help on using the changeset viewer.