d77a920e949c865a25cba18261a54fa1ec6c87c8~suv# -*- 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
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv# $Id: Portfile 113172 2013-11-11 10:24:44Z jeremyhu@macports.org $
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvPortSystem 1.0
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvPortGroup python 1.0
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvPortGroup github 1.0
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvgithub.setup numpy numpy 1.7.1 v
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvname py25-numpy
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvdist_subdir ${name}/${version}_1
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvcategories-append math
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvlicense BSD
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvplatforms darwin
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvmaintainers dh michaelld openmaintainer
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvdescription The core utilities for the scientific library scipy for Python
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvlong_description ${description}
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvchecksums rmd160 16df4216f40b22077e1f14cc41b8c8ae486b45af \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv sha256 14964724915e5fa1ed34d2cdb93eed5a86bc16edd4a1203cf521ad8bbbcb5215
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvif {$subport == $name} {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv revision 100
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv depends_lib-append port:fftw-3 \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv port:py${python.version}-nose
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv CFLAGS="${configure.cflags} [get_canonical_archflags cc]" \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv CXXFLAGS="${configure.cxxflags} [get_canonical_archflags cxx]" \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv OBJCFLAGS="${configure.objcflags} [get_canonical_archflags objc]" \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]"
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv build.env-append ARCHFLAGS="[get_canonical_archflags ld]"
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv destroot.env-append ARCHFLAGS="[get_canonical_archflags ld]"
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv variant atlas description {Use the MacPorts' ATLAS libraries \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv instead of Apple's Accelerate framework} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv build.env-append ATLAS=${prefix}/lib \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv LAPACK=${prefix}/lib \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv BLAS=${prefix}/lib
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv destroot.env-append ATLAS=${prefix}/lib \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv LAPACK=${prefix}/lib \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv BLAS=${prefix}/lib
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv depends_lib-append port:atlas
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv if {[variant_isset universal]} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # when using ATLAS (whether by default or specified by the user via
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # the +atlas variant) ...
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv set gcc_version ""
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv if {[variant_isset atlas]} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # see if the user has set -gcc4X to disable using MacPorts'
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # compiler; if not, either use what the user set (as +gcc4X) or
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # default to gcc47.
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 gcc48 \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv description {Use the gcc43 compiler (enables fortran linking)} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv configure.compiler macports-gcc-4.3
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 gcc48 \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv description {Use the gcc44 compiler (enables fortran linking)} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv configure.compiler macports-gcc-4.4
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 gcc48 \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv description {Use the gcc45 compiler (enables fortran linking)} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv configure.compiler macports-gcc-4.5
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 gcc48 \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv description {Use the gcc46 compiler (enables fortran linking)} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv configure.compiler macports-gcc-4.6
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 gcc48 \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv description {Use the gcc47 compiler (enables fortran linking)} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv configure.compiler macports-gcc-4.7
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv variant gcc48 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv description {Use the gcc48 compiler (enables fortran linking)} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv configure.compiler macports-gcc-4.8
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset gcc48]} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv default_variants +gcc47
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv if {[variant_isset gcc43]} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv set gcc_version "4.3"
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv } elseif {[variant_isset gcc44]} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv set gcc_version "4.4"
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv } elseif {[variant_isset gcc45]} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv set gcc_version "4.5"
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv } elseif {[variant_isset gcc46]} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv set gcc_version "4.6"
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv } elseif {[variant_isset gcc47]} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv set gcc_version "4.7"
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv } elseif {[variant_isset gcc48]} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv set gcc_version "4.8"
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # when using non-Apple GCC for universal install, it can
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # create binaries only for the native OS architecture, at
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # either 32 or 64 bits. Restrict the supported archs
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # accordingly.
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv if {${os.arch} == "i386"} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv supported_archs i386 x86_64
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv } elseif {${os.arch} == "powerpc"} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv supported_archs ppc ppc64
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # include all the correct GCC4X port
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv depends_lib-append port:gcc[join [split ${gcc_version} "."] ""]
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # force LDFLAGS for correct linking of the linalg module
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # for non-Apple GCC compilers
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv patchfiles-append patch-numpy_linalg_setup.py.diff
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv if {${gcc_version} == ""} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # user specified -gcc4X but +atlas (either as default or
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # explicitly); do not allow since it might lead to
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # undetermined runtime execution.
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv return -code error \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv"\n\nWhen using the +atlas variant (either as the default or setting
d77a920e949c865a25cba18261a54fa1ec6c87c8~suvexplicitly), one of the +gcc4X variants must be selected.\n"
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv variant universal {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv patchfiles-append patch-setup.py.diff
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv post-patch {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv reinplace "s|@@MPORTS_PYTHON@@|${python.bin}|" \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv if {[variant_isset universal] && [variant_isset atlas]} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # Prepare wrappers
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv file copy -force ${filespath}/wrapper-template \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv ${worksrcpath}/c-wrapper
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv file copy -force ${filespath}/wrapper-template \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv ${worksrcpath}/f-wrapper
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv file copy -force ${filespath}/wrapper-template \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv ${worksrcpath}/cxx-wrapper
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv reinplace "s|@@@|${configure.cc}|" ${worksrcpath}/c-wrapper
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv reinplace "s|---|\\\\.c|" ${worksrcpath}/c-wrapper
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv reinplace "s|&&&|${prefix}|" ${worksrcpath}/c-wrapper
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv reinplace "s|@@@|${configure.cxx}|" ${worksrcpath}/cxx-wrapper
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv reinplace "s#---#(\\\\.C|\\\\.cpp|\\\\.cc)#" \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv ${worksrcpath}/cxx-wrapper
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv reinplace "s|&&&|${prefix}|" ${worksrcpath}/cxx-wrapper
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv reinplace "s|@@@|${configure.f90}|" ${worksrcpath}/f-wrapper
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv reinplace "s|---|\\\\.f|" ${worksrcpath}/f-wrapper
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv reinplace "s|&&&|${prefix}|" ${worksrcpath}/f-wrapper
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv build.env-append CC="${worksrcpath}/c-wrapper" \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv CXX="${worksrcpath}/cxx-wrapper" \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv F77="${worksrcpath}/f-wrapper" \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv F90="${worksrcpath}/f-wrapper"
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv destroot.env-append CC="${worksrcpath}/c-wrapper" \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv CXX="${worksrcpath}/cxx-wrapper" \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv F77="${worksrcpath}/f-wrapper" \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv F90="${worksrcpath}/f-wrapper"
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv if {[variant_isset atlas]} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv # We must link against libSatlas or libTatlas, not libAtlas
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv if {[file exists ${prefix}/lib/libtatlas.dylib]} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv reinplace -E \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv "s|_lib_atlas = \\\['atlas'\\\]|_lib_atlas = \\\['tatlas'\\\]|" \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv } elseif {[file exists ${prefix}/lib/libsatlas.dylib]} {
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv reinplace -E \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv "s|_lib_atlas = \\\['atlas'\\\]|_lib_atlas = \\\['satlas'\\\]|" \
d77a920e949c865a25cba18261a54fa1ec6c87c8~suv return -code error "Unable to find Atlas dylibs. Bailing out."
117724f21a94ff32f773af4c37be88fe0d2970e3~suv# livecheck.regex archive/[join ${github.tag_prefix} ""](\[\\d+(?:\\.\\d+)*"\]+)${extract.suffix}"