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