Prototype MacPorts PortFile: Difference between revisions

From Octave
Jump to navigation Jump to search
(Remove "-pthread" as it triggers Qt4's moc command assume Octave's include files are placed in a "thread" subdirectory)
No edit summary
(One intermediate revision by the same user not shown)
Line 1: Line 1:
This prototype [http://www.macports.org/ MacPorts] portfile is intended to be used to produce a [[Create_a_MacOS_X_App_Bundle_Using_MacPorts|Octave App bundle for MacOS X]]. Before using it, please verify that the ''version'' number of Octave is correct. If a change is made to the file, it is recommended that the ''revision'' number be incremented to ensure that MacPorts recognizes that the port is outdated and in need of being upgraded.
This prototype [http://www.macports.org/ MacPorts] portfile is intended to be used to produce a [[Create_a_MacOS_X_App_Bundle_Using_MacPorts|Octave App bundle for MacOS X]]. Before using it, please verify that the ''version'' number of Octave is correct. If a change is made to the file, it is recommended that the ''revision'' number be incremented to ensure that MacPorts recognizes that the port is outdated and in need of being upgraded.


This portfile deviates significantly from the Octave portfile provided by MacPorts.  Specifically, this portfile has fltk-devel, epstool, pstoedit, and transfig as required dependencies. In addition, METIS has been removed, as it's license is not compatible with GPL.
This portfile deviates significantly from the Octave portfile provided by MacPorts.  Specifically, this portfile has fltk-devel, epstool, pstoedit, and transfig as required dependencies. In addition, METIS has been removed, as it's license is not compatible with GPL.  Since the <code>transfig</code> port ultimately includes <code>xord-libx11</code> which triggers an error during the <code>port mdmg</code> the <code>transfig</code> port has also been removed.


  <nowiki># -*- 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
  <nowiki># -*- 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$
# $Id: Portfile 106065 2013-05-14 09:28:04Z ryandesign@macports.org $


PortSystem 1.0
PortSystem 1.0


name                octave-local
name                octave-local
version            3.7.0+
version            3.6.4
revision            10
revision            3
conflicts          octave
conflicts          octave, octave-devel
categories          math science
categories          math science
maintainers        michaelld openmaintainer
maintainers        michaelld openmaintainer
license            GPL-3
platforms          darwin
platforms          darwin
description        a Matlab-like environment for numerical analysis
description        a Matlab-like environment for numerical analysis
long_description    Octave provides a convenient command line interface \
long_description    Octave provides a convenient command line interface \
Line 27: Line 29:
dist_subdir        octave
dist_subdir        octave
distname            octave-${version}
distname            octave-${version}
use_bzip2          yes


checksums          md5    6e4717edea2f64900071a46ba49948c0 \
checksums          rmd160  b0356f0c5d9366b8129d72ac58bbde837fee1a95 \
                    sha1    65592138d92eb5db2d15425f9e6c5ffe258cae48 \
                     sha256 fa185df9591f5d740f4d37ff6eaf06db576fdd3e0ddd9d0737365799e5d1c962
                     rmd160 26b55a770b5c622aa1209558b674e9f33092d610


depends_build      port:bison \
depends_build      port:bison \
Line 37: Line 39:
                     port:gperf \
                     port:gperf \
                     port:grep \
                     port:grep \
                    port:gsed \
                     path:bin/perl:perl5 \
                     path:bin/perl:perl5 \
                    port:pkgconfig \
                     port:texinfo
                     port:texinfo


depends_lib        port:arpack \
depends_lib        port:curl \
                    port:curl \
                     port:fftw-3 \
                     port:fftw-3 \
                     port:fftw-3-single \
                     port:fftw-3-single \
                     port:ftgl \
                     port:ftgl \
                    port:fltk-devel \
                     port:ghostscript \
                     port:ghostscript \
                     port:glpk \
                     port:glpk \
                     port:GraphicsMagick \
                     port:GraphicsMagick \
                     port:gnuplot \
                     port:gnuplot \
                    port:gsed \
                     port:hdf5-18 \
                     port:hdf5-18 \
                     port:less \
                     port:less \
                    port:metis \
                     port:ncurses \
                     port:ncurses \
                     port:pcre \
                     port:pcre \
                    port:readline \
                     port:qhull \
                     port:qhull \
                     port:qrupdate \
                     port:qrupdate \
                    port:readline \
                     port:SuiteSparse
                     port:SuiteSparse


depends_run        port:epstool \
depends_run        port:epstool \
                    port:transfig \
                     port:pstoedit
                     port:pstoedit
# allow us to disable checking for FLTK
# via the environment variable "FLTK_CONFIG"
patchfiles-append  patch-configure.diff


universal_variant  no
universal_variant  no


# do not use CLANG (yet)
# octave requires a fortran compiler, so require the use of one of the
if {${configure.compiler} == "clang"} {
# MacPorts GCC ports (for now).
     configure.compiler llvm-gcc-4.2
 
}
compiler.blacklist gcc-3.3 gcc-4.0 gcc-4.2 llvm-gcc-4.2 \
    apple-gcc-4.0 apple-gcc-4.2 clang macports-clang-2.9 \
    macports-clang-3.0 macports-clang-3.1 macports-clang-3.2 \
     macports-clang-3.3 macports-llvm-gcc-4.2


configure.args      --disable-dependency-tracking \
configure.args      --disable-dependency-tracking \
                     --without-x \
                     --without-x \
                    --with-framework-carbon \
                     --disable-docs \
                     --disable-docs \
                     --with-cholmod="-lcholmod"
                     --with-cholmod="-lcholmod" \
                    --with-umfpack="-lumfpack -lSuiteSparse"


# octave uses a number of other ports to create sources from template:
# octave uses a number of other ports to create sources from template:
Line 90: Line 96:
                     SED="${prefix}/bin/gsed" \
                     SED="${prefix}/bin/gsed" \
                     TEXI2DVI="${prefix}/bin/texi2dvi" \
                     TEXI2DVI="${prefix}/bin/texi2dvi" \
                     TEXI2PDF="${prefix}/bin/texi2pdf"
                     TEXI2PDF="${prefix}/bin/texi2pdf" \
configure.cppflags   -D_THREAD_SAFE
                    APPLE_CXX="/usr/bin/g++"
configure.cxxflags  -O0 -ggdb3 -D_THREAD_SAFE -gstabs
configure.cppflags
configure.cflags    -O0 -ggdb3 -D_THREAD_SAFE -gstabs
configure.ldflags
configure.fflags    -O0 -ggdb3 -D_THREAD_SAFE -gstabs -funroll-loops
 
configure.ldflags    -D_THREAD_SAFE
pre-build {
    reinplace "/'display\.cc'/s@\$(CXX)@\$(APPLE_CXX)@g" \
        ${worksrcpath}/src/Makefile
}
 
build.env-append APPLE_CXX="/usr/bin/g++"


test.run            yes
test.run            yes
test.target        check
test.target        check


variant gcc43 description {build with the macports gcc43 toolchain} conflicts gcc46 gcc45 gcc44 g95 {}
platform darwin 11 {
    # 10.7 requires an extra patch; this patch will break the build on
    # 10.6 and prior, so apply it only under 10.7.
    patchfiles-append patch-src-display.cc.diff
}
 
platform darwin 12 {
    # In 10.8 patch is required as above, also
    # the LANG environment variable needs to
    # be set to "C" otherwise /usr/bin/sed
    # fails with an error, if you installed gsed
    # with default name this should have no effect.
 
    patchfiles-append patch-src-display.cc.diff
    build.args-append LANG="C"
}
 


variant gcc44 description {build with the macports gcc44 toolchain} conflicts gcc46 gcc45 gcc43 g95 {}
variant gcc43 description {build with the macports gcc43 toolchain} conflicts gcc48 gcc47 gcc46 gcc45 gcc44 g95 {}


variant gcc45 description {build with the macports gcc45 toolchain} conflicts gcc46 gcc44 gcc43 g95 {}
variant gcc44 description {build with the macports gcc44 toolchain} conflicts gcc48 gcc47 gcc46 gcc45 gcc43 g95 {}


variant gcc46 description {build with the macports gcc45 toolchain} conflicts gcc45 gcc44 gcc43 g95 {}
variant gcc45 description {build with the macports gcc45 toolchain} conflicts gcc48 gcc47 gcc46 gcc44 gcc43 g95 {}


variant g95 description {build with g95} conflicts gcc43 gcc44 gcc45 gcc46 {
variant gcc46 description {build with the macports gcc46 toolchain} conflicts gcc48 gcc47 gcc45 gcc44 gcc43 g95 {}
 
variant gcc47 description {build with the macports gcc47 toolchain} conflicts gcc48 gcc46 gcc45 gcc44 gcc43 g95 {}
 
variant gcc48 description {build with the macports gcc48 toolchain} conflicts gcc47 gcc46 gcc45 gcc44 gcc43 g95 {}
 
variant g95 description {build with g95} conflicts gcc48 gcc47 gcc46 gcc45 gcc44 gcc43 {
     depends_build-append    port:g95
     depends_build-append    port:g95
     configure.f77          "${prefix}/bin/g95"
     configure.f77          "${prefix}/bin/g95"
Line 119: Line 152:
variant accelerate description {use BLAS from Apple's Accelerate.framework} conflicts atlas {
variant accelerate description {use BLAS from Apple's Accelerate.framework} conflicts atlas {
     depends_lib-append      port:dotwrp
     depends_lib-append      port:dotwrp
     configure.args-append  --with-blas="-ldotwrp -framework Accelerate"
     configure.args-append  --with-blas="-ldotwrp -Wl,-framework -Wl,Accelerate"
     configure.args-append  --with-lapack="-framework Accelerate"
     configure.args-append  --with-lapack="-Wl,-framework -Wl,Accelerate"
}
}


Line 132: Line 165:
# default found in the 'atlas' port (but, this is not checked for).
# default found in the 'atlas' port (but, this is not checked for).


# check for setting the default variant (gcc44)
# check for setting the default variant (gcc47)
if { ![variant_isset gcc43] && ![variant_isset gcc44] && \
 
         ![variant_isset gcc46] && ![variant_isset g95] } {
if {     ![variant_isset gcc43] && ![variant_isset gcc44] && \
     default_variants +gcc45
         ![variant_isset gcc45] && ![variant_isset gcc46] && \
        ![variant_isset gcc47] && ![variant_isset gcc48] && \
        ![variant_isset g95] } {
     default_variants +gcc47
}
}


# check if the user disabled just the default variant: -gcc44
# check if the user disabled just the default variant: -gcc47
if { ![variant_isset gcc43] && ![variant_isset gcc44] && \
 
if {     ![variant_isset gcc43] && ![variant_isset gcc44] && \
         ![variant_isset gcc45] && ![variant_isset gcc46] && \
         ![variant_isset gcc45] && ![variant_isset gcc46] && \
        ![variant_isset gcc47] && ![variant_isset gcc48] && \
         ![variant_isset g95] } {
         ![variant_isset g95] } {
     pre-fetch {
     pre-fetch {
Line 156: Line 194:
} elseif {[variant_isset gcc46]} {
} elseif {[variant_isset gcc46]} {
     set gcc_version "4.6"
     set gcc_version "4.6"
} elseif {[variant_isset gcc47]} {
    set gcc_version "4.7"
} elseif {[variant_isset gcc48]} {
    set gcc_version "4.8"
}
}


if {${gcc_version} != ""} {
if {${gcc_version} != ""} {
     set gcc_version_join [join [split ${gcc_version} "."] ""]
     set gcc_version_join [join [split ${gcc_version} "."] ""]
     configure.ldflags   "${prefix}/lib/gcc${gcc_version_join}/libstdc++.6.dylib"
     configure.ldflags "-L${prefix}/lib/gcc${gcc_version_join}"
    configure.ldflags-append -lstdc++ \
-lgfortran
     depends_build-append port:gcc${gcc_version_join}
     depends_build-append port:gcc${gcc_version_join}
     configure.compiler  macports-gcc-${gcc_version}
     configure.compiler  macports-gcc-${gcc_version}
Line 167: Line 211:
variant docs description {Enable creation and installation of documentation} {
variant docs description {Enable creation and installation of documentation} {
     depends_run-append port:texlive-basic
     depends_run-append port:texlive-basic
    # latex needed for lcircle10 font etc.
    depends_build-append port:texlive-latex
     configure.args-replace s|--disable-docs|--enable-docs|
     configure.args-replace s|--disable-docs|--enable-docs|
}
}
Line 173: Line 219:
     configure.args-replace s|--without-x|--with-x|
     configure.args-replace s|--without-x|--with-x|
     configure.args-append --x-includes=${prefix}
     configure.args-append --x-includes=${prefix}
}
variant fltk description {Include FLTK for graphical front-end} {
    depends_lib-append  path:lib/libfltk.dylib:fltk
    configure.env-delete FLTK_CONFIG=no
}
}


Line 178: Line 229:
livecheck.url      http://www.gnu.org/software/octave/news.html
livecheck.url      http://www.gnu.org/software/octave/news.html
livecheck.regex    Version (\\d+(\\.\\d+)*)
livecheck.regex    Version (\\d+(\\.\\d+)*)
</nowiki>
</nowiki>

Revision as of 09:03, 19 May 2013

This prototype MacPorts portfile is intended to be used to produce a Octave App bundle for MacOS X. Before using it, please verify that the version number of Octave is correct. If a change is made to the file, it is recommended that the revision number be incremented to ensure that MacPorts recognizes that the port is outdated and in need of being upgraded.

This portfile deviates significantly from the Octave portfile provided by MacPorts. Specifically, this portfile has fltk-devel, epstool, pstoedit, and transfig as required dependencies. In addition, METIS has been removed, as it's license is not compatible with GPL. Since the transfig port ultimately includes xord-libx11 which triggers an error during the port mdmg the transfig port has also been removed.

# -*- 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 106065 2013-05-14 09:28:04Z ryandesign@macports.org $

PortSystem 1.0

name                octave-local
version             3.6.4
revision            3
conflicts           octave, 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/
master_sites        gnu:octave
dist_subdir         octave
distname            octave-${version}
use_bzip2           yes

checksums           rmd160  b0356f0c5d9366b8129d72ac58bbde837fee1a95 \
                    sha256  fa185df9591f5d740f4d37ff6eaf06db576fdd3e0ddd9d0737365799e5d1c962

depends_build       port:bison \
                    port:flex \
                    port:gawk \
                    port:gperf \
                    port:grep \
                    path:bin/perl:perl5 \
                    port:pkgconfig \
                    port:texinfo

depends_lib         port:curl \
                    port:fftw-3 \
                    port:fftw-3-single \
                    port:ftgl \
                    port:ghostscript \
                    port:glpk \
                    port:GraphicsMagick \
                    port:gnuplot \
                    port:gsed \
                    port:hdf5-18 \
                    port:less \
                    port:ncurses \
                    port:pcre \
                    port:qhull \
                    port:qrupdate \
                    port:readline \
                    port:SuiteSparse

depends_run         port:epstool \
                    port:pstoedit

# allow us to disable checking for FLTK
# via the environment variable "FLTK_CONFIG"
patchfiles-append   patch-configure.diff

universal_variant   no

# octave requires a fortran compiler, so require the use of one of the
# MacPorts GCC ports (for now).

compiler.blacklist gcc-3.3 gcc-4.0 gcc-4.2 llvm-gcc-4.2 \
    apple-gcc-4.0 apple-gcc-4.2 clang macports-clang-2.9 \
    macports-clang-3.0 macports-clang-3.1 macports-clang-3.2 \
    macports-clang-3.3 macports-llvm-gcc-4.2

configure.args      --disable-dependency-tracking \
                    --without-x \
                    --disable-docs \
                    --with-cholmod="-lcholmod" \
                    --with-umfpack="-lumfpack -lSuiteSparse"

# 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" \
                     FLTK_CONFIG=no \
                     SED="${prefix}/bin/gsed" \
                     TEXI2DVI="${prefix}/bin/texi2dvi" \
                     TEXI2PDF="${prefix}/bin/texi2pdf" \
                     APPLE_CXX="/usr/bin/g++"
configure.cppflags
configure.ldflags

pre-build {
    reinplace "/'display\.cc'/s@\$(CXX)@\$(APPLE_CXX)@g" \
        ${worksrcpath}/src/Makefile
}

build.env-append APPLE_CXX="/usr/bin/g++"

test.run            yes
test.target         check

platform darwin 11 {
    # 10.7 requires an extra patch; this patch will break the build on
    # 10.6 and prior, so apply it only under 10.7.
    patchfiles-append patch-src-display.cc.diff
}

platform darwin 12 {
    # In 10.8 patch is required as above, also
    # the LANG environment variable needs to
    # be set to "C" otherwise /usr/bin/sed
    # fails with an error, if you installed gsed
    # with default name this should have no effect.

    patchfiles-append patch-src-display.cc.diff
    build.args-append LANG="C"
}


variant gcc43 description {build with the macports gcc43 toolchain} conflicts gcc48 gcc47 gcc46 gcc45 gcc44 g95 {}

variant gcc44 description {build with the macports gcc44 toolchain} conflicts gcc48 gcc47 gcc46 gcc45 gcc43 g95 {}

variant gcc45 description {build with the macports gcc45 toolchain} conflicts gcc48 gcc47 gcc46 gcc44 gcc43 g95 {}

variant gcc46 description {build with the macports gcc46 toolchain} conflicts gcc48 gcc47 gcc45 gcc44 gcc43 g95 {}

variant gcc47 description {build with the macports gcc47 toolchain} conflicts gcc48 gcc46 gcc45 gcc44 gcc43 g95 {}

variant gcc48 description {build with the macports gcc48 toolchain} conflicts gcc47 gcc46 gcc45 gcc44 gcc43 g95 {}

variant g95 description {build with g95} conflicts gcc48 gcc47 gcc46 gcc45 gcc44 gcc43 {
    depends_build-append    port:g95
    configure.f77           "${prefix}/bin/g95"
}

variant atlas description {use BLAS from ATLAS} conflicts accelerate {
    depends_lib-append port:atlas
}

variant accelerate description {use BLAS from Apple's Accelerate.framework} conflicts atlas {
    depends_lib-append      port:dotwrp
    configure.args-append   --with-blas="-ldotwrp -Wl,-framework -Wl,Accelerate"
    configure.args-append   --with-lapack="-Wl,-framework -Wl,Accelerate"
}

if {[variant_isset g95]} {
    default_variants +accelerate
} elseif {![variant_isset accelerate]} {
    default_variants +atlas
}

# check for GCC / G95 variants.  The default here must match the
# default found in the 'atlas' port (but, this is not checked for).

# check for setting the default variant (gcc47)

if {     ![variant_isset gcc43] && ![variant_isset gcc44] && \
         ![variant_isset gcc45] && ![variant_isset gcc46] && \
         ![variant_isset gcc47] && ![variant_isset gcc48] && \
         ![variant_isset g95] } {
    default_variants +gcc47
}

# check if the user disabled just the default variant: -gcc47

if {     ![variant_isset gcc43] && ![variant_isset gcc44] && \
         ![variant_isset gcc45] && ![variant_isset gcc46] && \
         ![variant_isset gcc47] && ![variant_isset gcc48] && \
         ![variant_isset g95] } {
    pre-fetch {
        error "You must select one of the compiler variants."
    }
}

set gcc_version ""
if {[variant_isset gcc43]} {
    set gcc_version "4.3"
} elseif {[variant_isset gcc44]} {
    set gcc_version "4.4"
} elseif {[variant_isset gcc45]} {
    set gcc_version "4.5"
} elseif {[variant_isset gcc46]} {
    set gcc_version "4.6"
} elseif {[variant_isset gcc47]} {
    set gcc_version "4.7"
} elseif {[variant_isset gcc48]} {
    set gcc_version "4.8"
}

if {${gcc_version} != ""} {
    set gcc_version_join [join [split ${gcc_version} "."] ""]
    configure.ldflags		"-L${prefix}/lib/gcc${gcc_version_join}"
    configure.ldflags-append	-lstdc++ \
				-lgfortran
    depends_build-append port:gcc${gcc_version_join}
    configure.compiler   macports-gcc-${gcc_version}
}

variant docs description {Enable creation and installation of documentation} {
    depends_run-append port:texlive-basic
    # latex needed for lcircle10 font etc.
    depends_build-append port:texlive-latex
    configure.args-replace s|--disable-docs|--enable-docs|
}

variant x11 description {Enable use of X11} {
    configure.args-replace s|--without-x|--with-x|
    configure.args-append --x-includes=${prefix}
}

variant fltk description {Include FLTK for graphical front-end} {
    depends_lib-append  path:lib/libfltk.dylib:fltk
    configure.env-delete FLTK_CONFIG=no
}

livecheck.type      regex
livecheck.url       http://www.gnu.org/software/octave/news.html
livecheck.regex     Version (\\d+(\\.\\d+)*)