| 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 |
|---|
| 2 | # $Id: Portfile 66905 2010-04-25 16:20:55Z ram@macports.org $ |
|---|
| 3 | |
|---|
| 4 | PortSystem 1.0 |
|---|
| 5 | PortGroup python26 1.0 |
|---|
| 6 | |
|---|
| 7 | name py26-scipy |
|---|
| 8 | version 0.7.2 |
|---|
| 9 | categories python |
|---|
| 10 | platforms darwin |
|---|
| 11 | maintainers jmr ram openmaintainer |
|---|
| 12 | description An opensource library of scientific tools for Python |
|---|
| 13 | long_description ${description}. |
|---|
| 14 | |
|---|
| 15 | homepage http://www.scipy.org/ |
|---|
| 16 | master_sites sourceforge:scipy |
|---|
| 17 | distname scipy-${version} |
|---|
| 18 | |
|---|
| 19 | checksums md5 33f883f5ea4227de7097c47d70d5402a \ |
|---|
| 20 | sha1 c3223df023008ee339cf1d3fad74d4566af69c8a \ |
|---|
| 21 | rmd160 456e4ab9d69f9d4056bca6b52474b72bea37b122 |
|---|
| 22 | |
|---|
| 23 | depends_lib-append port:py26-numpy \ |
|---|
| 24 | port:py26-nose \ |
|---|
| 25 | port:SuiteSparse \ |
|---|
| 26 | port:swig-python \ |
|---|
| 27 | port:atlas |
|---|
| 28 | |
|---|
| 29 | worksrcdir ${distname} |
|---|
| 30 | |
|---|
| 31 | build.env-append CCFLAGS="-I${prefix}/include -L${prefix}/lib" \ |
|---|
| 32 | ATLAS=${prefix}/lib \ |
|---|
| 33 | LAPACK=${prefix}/lib \ |
|---|
| 34 | BLAS=${prefix}/lib \ |
|---|
| 35 | CC="${worksrcpath}/c-wrapper" \ |
|---|
| 36 | CXX="${worksrcpath}/c++-wrapper" \ |
|---|
| 37 | |
|---|
| 38 | destroot.env-append CCFLAGS="-I${prefix}/include -L${prefix}/lib" \ |
|---|
| 39 | ATLAS=${prefix}/lib \ |
|---|
| 40 | LAPACK=${prefix}/lib \ |
|---|
| 41 | BLAS=${prefix}/lib \ |
|---|
| 42 | CC="${worksrcpath}/c-wrapper" \ |
|---|
| 43 | CXX="${worksrcpath}/c++-wrapper" \ |
|---|
| 44 | |
|---|
| 45 | # Variants |
|---|
| 46 | |
|---|
| 47 | if {![variant_isset gcc42] && ![variant_isset gcc43] && ![variant_isset gcc44]\ |
|---|
| 48 | && ![variant_isset gcc45]} { |
|---|
| 49 | default_variants +gcc44 |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | variant no_atlas description {"Do not use macports atlas libraries"} { |
|---|
| 53 | depends_lib-delete port:atlas |
|---|
| 54 | |
|---|
| 55 | build.env-delete ATLAS=${prefix}/lib \ |
|---|
| 56 | LAPACK=${prefix}/lib \ |
|---|
| 57 | BLAS=${prefix}/lib |
|---|
| 58 | |
|---|
| 59 | destroot.env-delete ATLAS=${prefix}/lib \ |
|---|
| 60 | LAPACK=${prefix}/lib \ |
|---|
| 61 | BLAS=${prefix}/lib |
|---|
| 62 | } |
|---|
| 63 | |
|---|
| 64 | variant gcc45 conflicts gcc42 gcc43 gcc44 description "Use gcc-mp 4.5" { |
|---|
| 65 | depends_lib-append port:gcc45 |
|---|
| 66 | set fc_options "config_fc --fcompiler gnu95 \ |
|---|
| 67 | --f77exec ${worksrcpath}/f-wrapper \ |
|---|
| 68 | --f90exec ${worksrcpath}/f-wrapper " |
|---|
| 69 | set config_options "config --cc ${worksrcpath}/c-wrapper \ |
|---|
| 70 | --include-dirs ${prefix}/include \ |
|---|
| 71 | --library-dirs ${prefix}/lib" |
|---|
| 72 | |
|---|
| 73 | if {[variant_isset universal]} { |
|---|
| 74 | append fc_options "--f77flags '${configure.universal_cflags}' \ |
|---|
| 75 | --f90flags '${configure.universal_cflags}'" |
|---|
| 76 | } |
|---|
| 77 | |
|---|
| 78 | build.cmd-append ${fc_options} ${config_options} |
|---|
| 79 | destroot.cmd-append ${fc_options} ${config_options} |
|---|
| 80 | } |
|---|
| 81 | |
|---|
| 82 | variant gcc44 conflicts gcc45 gcc43 gcc42 description "Use gcc-mp 4.4" { |
|---|
| 83 | depends_lib-append port:gcc44 |
|---|
| 84 | set fc_options "config_fc --fcompiler gnu95 \ |
|---|
| 85 | --f77exec ${worksrcpath}/f-wrapper \ |
|---|
| 86 | --f90exec ${worksrcpath}/f-wrapper " |
|---|
| 87 | set config_options "config --cc ${worksrcpath}/c-wrapper \ |
|---|
| 88 | --include-dirs ${prefix}/include \ |
|---|
| 89 | --library-dirs ${prefix}/lib" |
|---|
| 90 | |
|---|
| 91 | if {[variant_isset universal]} { |
|---|
| 92 | append fc_options "--f77flags '${configure.universal_cflags}' \ |
|---|
| 93 | --f90flags '${configure.universal_cflags}'" |
|---|
| 94 | } |
|---|
| 95 | |
|---|
| 96 | build.cmd-append ${fc_options} ${config_options} |
|---|
| 97 | destroot.cmd-append ${fc_options} ${config_options} |
|---|
| 98 | } |
|---|
| 99 | |
|---|
| 100 | variant gcc43 conflicts gcc45 gcc44 gcc42 description "Use gcc-mp 4.3" { |
|---|
| 101 | depends_lib-append port:gcc43 |
|---|
| 102 | ui-warn ("gcc/gfortran 4.3 is not recommended for scipy. Upgrade to 4.4 or 4.5") |
|---|
| 103 | set fc_options "config_fc --fcompiler gnu95 \ |
|---|
| 104 | --f77exec ${worksrcpath}/f-wrapper \ |
|---|
| 105 | --f90exec ${worksrcpath}/f-wrapper " |
|---|
| 106 | set config_options "config --cc ${worksrcpath}/c-wrapper \ |
|---|
| 107 | --include-dirs ${prefix}/include \ |
|---|
| 108 | --library-dirs ${prefix}/lib" |
|---|
| 109 | |
|---|
| 110 | if {[variant_isset universal]} { |
|---|
| 111 | append fc_options "--f77flags '${configure.universal_cflags}' \ |
|---|
| 112 | --f90flags '${configure.universal_cflags}'" |
|---|
| 113 | } |
|---|
| 114 | |
|---|
| 115 | build.cmd-append ${fc_options} ${config_options} |
|---|
| 116 | destroot.cmd-append ${fc_options} ${config_options} |
|---|
| 117 | } |
|---|
| 118 | |
|---|
| 119 | variant gcc42 conflicts gcc45 gcc44 gcc43 description "Use gcc-mp 4.2" { |
|---|
| 120 | ui_error ("Use of gcc/gfortran 4.2 is obsolete. Please upgrade.") |
|---|
| 121 | } |
|---|
| 122 | |
|---|
| 123 | pre-patch { |
|---|
| 124 | ui_debug ("Generating wrappers") |
|---|
| 125 | file copy -force ${filespath}/wrapper ${worksrcpath}/c-wrapper |
|---|
| 126 | file copy -force ${filespath}/wrapper ${worksrcpath}/c++-wrapper |
|---|
| 127 | file copy -force ${filespath}/wrapper ${worksrcpath}/f-wrapper |
|---|
| 128 | |
|---|
| 129 | reinplace "s|+++|\\\\.c|" ${worksrcpath}/c-wrapper |
|---|
| 130 | reinplace "s/+++/(\\\\.cxx|\\\\.C|\\\\.cc)/" ${worksrcpath}/c++-wrapper |
|---|
| 131 | reinplace "s|+++|\\\\.f|" ${worksrcpath}/f-wrapper |
|---|
| 132 | |
|---|
| 133 | reinplace "s|___|${prefix}|" ${worksrcpath}/c-wrapper |
|---|
| 134 | reinplace "s|___|${prefix}|" ${worksrcpath}/c++-wrapper |
|---|
| 135 | reinplace "s|___|${prefix}|" ${worksrcpath}/f-wrapper |
|---|
| 136 | |
|---|
| 137 | if {[variant_isset gcc45]} { |
|---|
| 138 | reinplace "s|@@@|gcc-mp-4.5|" ${worksrcpath}/c-wrapper |
|---|
| 139 | reinplace "s|@@@|g++-mp-4.5|" ${worksrcpath}/c++-wrapper |
|---|
| 140 | reinplace "s|@@@|gfortran-mp-4.5|" ${worksrcpath}/f-wrapper |
|---|
| 141 | } elseif {[variant_isset gcc44]} { |
|---|
| 142 | reinplace "s|@@@|gcc-mp-4.4|" ${worksrcpath}/c-wrapper |
|---|
| 143 | reinplace "s|@@@|g++-mp-4.4|" ${worksrcpath}/c++-wrapper |
|---|
| 144 | reinplace "s|@@@|gfortran-mp-4.4|" ${worksrcpath}/f-wrapper |
|---|
| 145 | } elseif {[variant_isset gcc43]} { |
|---|
| 146 | reinplace "s|@@@|gcc-mp-4.3|" ${worksrcpath}/c-wrapper |
|---|
| 147 | reinplace "s|@@@|g++-mp-4.3|" ${worksrcpath}/c++-wrapper |
|---|
| 148 | reinplace "s|@@@|gfortran-mp-4.3|" ${worksrcpath}/f-wrapper |
|---|
| 149 | } |
|---|
| 150 | xinstall -m 755 ${worksrcpath}/c-wrapper ${worksrcpath} |
|---|
| 151 | xinstall -m 755 ${worksrcpath}/c++-wrapper ${worksrcpath} |
|---|
| 152 | xinstall -m 755 ${worksrcpath}/f-wrapper ${worksrcpath} |
|---|
| 153 | } |
|---|
| 154 | |
|---|
| 155 | post-patch { |
|---|
| 156 | reinplace \ |
|---|
| 157 | "s|include <\\(umfpack\.*.h\\)>|include <${prefix}/include/ufsparse/\\1>|g" ${worksrcpath}/scipy/sparse/linalg/dsolve/umfpack/umfpack.i |
|---|
| 158 | } |
|---|
| 159 | |
|---|
| 160 | livecheck.type regex |
|---|
| 161 | livecheck.url http://sourceforge.net/projects/scipy/files/ |
|---|
| 162 | livecheck.regex "files\/scipy\/(\\d+(?:\\.\\d+)*)\/scipy" |
|---|