source: trunk/dports/python/py27-numpy/Portfile @ 73657

Last change on this file since 73657 was 73657, checked in by ram@…, 7 years ago

python/py2{5,6,7}-numpy: update to 1.5.1

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
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
2# $Id: Portfile 73657 2010-11-20 18:49:35Z ram@macports.org $
3
4PortSystem              1.0
5PortGroup               python27 1.0
6
7name                    py27-numpy
8version                 1.5.1
9categories              python
10platforms               darwin
11maintainers             ram openmaintainer
12description             The core utilities for the scientific library scipy for Python
13long_description        ${description}
14
15homepage                http://numpy.scipy.org/
16master_sites            sourceforge:numpy
17distname                numpy-${version}
18
19checksums               md5 376ef150df41b5353944ab742145352d \
20                        sha1 423c6bf74f9ac00697db574ba981547991110896 \
21                        rmd160 6d8f03e4cd2db48a7c9ac39b441d9e0219b15dcf
22
23patchfiles              patch-f2py_setup.py.diff \
24                        patch-system_info.py.diff \
25                        patch-fcompiler_g95.diff
26
27depends_lib-append      port:fftw-3 \
28                        port:py27-nose
29
30variant atlas \
31description {Use the MacPorts' ATLAS libraries \
32             instead of Apple's Accelerate framework} {
33    build.env-append    ATLAS=${prefix}/lib \
34                        LAPACK=${prefix}/lib \
35                        BLAS=${prefix}/lib
36    destroot.env-append ATLAS=${prefix}/lib \
37                        LAPACK=${prefix}/lib \
38                        BLAS=${prefix}/lib
39    depends_lib-append  port:atlas
40}
41
42# use ALTAS by default; if MacPorts' ATLAS is not used, numpy will
43# link with that supplied by Apple's Accelerate framework.
44if {![variant_isset atlas]} {
45    default_variants +atlas
46}
47
48# when using ATLAS (whether by default or specified by the user via
49# the +atlas variant) ...
50set gcc_version ""
51if {[variant_isset atlas]} {
52    # see if the user has set -gcc4X to disable using MacPorts'
53    # compiler; if not, either use what the user set (as +gcc4X) or
54    # default to gcc44.
55
56    variant gcc43 conflicts gcc44 gcc45 \
57    description {Use the gcc43 compiler (enables fortran linking)} {}
58
59    variant gcc44 conflicts gcc43 gcc45 \
60    description {Use the gcc44 compiler (enables fortran linking)} {}
61
62    variant gcc45 conflicts gcc43 gcc44 \
63    description {Use the gcc45 compiler (enables fortran linking)} {}
64
65    if {![variant_isset gcc43] &&
66        ![variant_isset gcc44] &&
67        ![variant_isset gcc45]} {
68        default_variants +gcc44
69    }
70    if {[variant_isset gcc43]} {
71        set gcc_version "4.3"
72    }
73    if {[variant_isset gcc44]} {
74        set gcc_version "4.4"
75    }
76    if {[variant_isset gcc45]} {
77        set gcc_version "4.5"
78    }
79
80    if {${gcc_version} != ""} {
81        # when using non-Apple GCC for universal install, it can
82        # create binaries only for the native OS architecture, at
83        # either 32 or 64 bits.  Restrict the supported archs
84        # accordingly.
85        if {[variant_exists universal] && [variant_isset universal]} {
86            if { ${os.arch}=="i386" } {
87                set universal_archs_supported { i386 x86_64 }
88            } else {
89                set universal_archs_supported { ppc  ppc64 }
90            }
91        }
92
93        # include all the correct GCC4X port
94        depends_lib-append port:gcc[join [split ${gcc_version} "."] ""]
95
96        # force LDFLAGS for correct linking of the linalg module
97        # for non-Apple GCC compilers
98        patchfiles-append  patch-numpy_linalg_setup.py.diff
99
100    } else {
101        # user specified -gcc4X but +atlas (either as default or
102        # explicitly); do not allow since it might lead to
103        # undetermined runtime execution.
104        return -code error \
105"\n\nWhen using the +atlas variant (either as the default or setting
106explicitly), one of the +gcc4X variants must be selected.\n"
107    }
108}
109
110variant universal {
111    patchfiles-append   patch-setup.py.diff
112}
113
114post-patch {
115    reinplace "s|@@MPORTS_PYTHON@@|${python.bin}|" \
116        ${worksrcpath}/numpy/f2py/setup.py
117
118    # disallow searching for any fortran executable except what is
119    # specified in this Portfile; NOTE: this change only works when
120    # setting the GCC version; if this flag is not set (meaning no
121    # +gcc4X variant is set), then F2PY may or not work.
122    if {${gcc_version} != ""} {
123        # set which fortran to use in the f2py Python scripts
124        reinplace "/possible_executables/s|\\\[.*\\\]|\['gfortran-mp-${gcc_version}'\]|g" ${worksrcpath}/numpy/distutils/fcompiler/gnu.py
125    }
126}
127
128livecheck.type  regex
129livecheck.url   http://sourceforge.net/projects/numpy/files/
130livecheck.regex "files\/NumPy\/(\\d+(?:\\.\\d+)*)\/numpy"
Note: See TracBrowser for help on using the repository browser.