| 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="${filespath}/c-wrapper" \ |
|---|
| 36 | CXX="${filespath}/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="${filespath}/c-wrapper" \ |
|---|
| 43 | CXX="${filespath}/c++-wrapper" \ |
|---|
| 44 | |
|---|
| 45 | ui_debug ("Generating wrappers") |
|---|
| 46 | file copy -force ${filespath}/wrapper ${filespath}/c-wrapper |
|---|
| 47 | file copy -force ${filespath}/wrapper ${filespath}/c++-wrapper |
|---|
| 48 | file copy -force ${filespath}/wrapper ${filespath}/f-wrapper |
|---|
| 49 | |
|---|
| 50 | reinplace "s|+++|\\\\.c|" ${filespath}/c-wrapper |
|---|
| 51 | reinplace "s/+++/(\\\\.cxx|\\\\.C|\\\\.cc)/" ${filespath}/c++-wrapper |
|---|
| 52 | reinplace "s|+++|\\\\.f|" ${filespath}/f-wrapper |
|---|
| 53 | |
|---|
| 54 | reinplace "s|___|${prefix}|" ${filespath}/c-wrapper |
|---|
| 55 | reinplace "s|___|${prefix}|" ${filespath}/c++-wrapper |
|---|
| 56 | reinplace "s|___|${prefix}|" ${filespath}/f-wrapper |
|---|
| 57 | |
|---|
| 58 | # Variants |
|---|
| 59 | |
|---|
| 60 | if {![variant_isset gcc42] && ![variant_isset gcc43] && ![variant_isset gcc44]\ |
|---|
| 61 | && ![variant_isset gcc45]} { |
|---|
| 62 | default_variants +gcc44 |
|---|
| 63 | } |
|---|
| 64 | |
|---|
| 65 | variant no_atlas description {"Do not use macports atlas libraries"} { |
|---|
| 66 | depends_lib-delete port:atlas |
|---|
| 67 | |
|---|
| 68 | build.env-delete ATLAS=${prefix}/lib \ |
|---|
| 69 | LAPACK=${prefix}/lib \ |
|---|
| 70 | BLAS=${prefix}/lib |
|---|
| 71 | |
|---|
| 72 | destroot.env-delete ATLAS=${prefix}/lib \ |
|---|
| 73 | LAPACK=${prefix}/lib \ |
|---|
| 74 | BLAS=${prefix}/lib |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | variant gcc45 conflicts gcc42 gcc43 gcc44 description "Use gcc-mp 4.5" { |
|---|
| 78 | depends_lib-append port:gcc45 |
|---|
| 79 | set fc_options "config_fc --fcompiler gnu95 \ |
|---|
| 80 | --f77exec ${filespath}/f-wrapper \ |
|---|
| 81 | --f90exec ${filespath}/f-wrapper " |
|---|
| 82 | set config_options "config --cc ${filespath}/c-wrapper \ |
|---|
| 83 | --include-dirs ${prefix}/include \ |
|---|
| 84 | --library-dirs ${prefix}/lib" |
|---|
| 85 | |
|---|
| 86 | if {[variant_isset universal]} { |
|---|
| 87 | append fc_options "--f77flags '${configure.universal_cflags}' \ |
|---|
| 88 | --f90flags '${configure.universal_cflags}'" |
|---|
| 89 | } |
|---|
| 90 | |
|---|
| 91 | build.cmd-append ${fc_options} ${config_options} |
|---|
| 92 | destroot.cmd-append ${fc_options} ${config_options} |
|---|
| 93 | |
|---|
| 94 | reinplace "s|@@@|gcc-mp-4.5|" ${filespath}/c-wrapper |
|---|
| 95 | reinplace "s|@@@|g++-mp-4.5|" ${filespath}/c++-wrapper |
|---|
| 96 | reinplace "s|@@@|gfortran-mp-4.5|" ${filespath}/f-wrapper |
|---|
| 97 | } |
|---|
| 98 | |
|---|
| 99 | variant gcc44 conflicts gcc45 gcc43 gcc42 description "Use gcc-mp 4.4" { |
|---|
| 100 | depends_lib-append port:gcc44 |
|---|
| 101 | set fc_options "config_fc --fcompiler gnu95 \ |
|---|
| 102 | --f77exec ${filespath}/f-wrapper \ |
|---|
| 103 | --f90exec ${filespath}/f-wrapper " |
|---|
| 104 | set config_options "config --cc ${filespath}/c-wrapper \ |
|---|
| 105 | --include-dirs ${prefix}/include \ |
|---|
| 106 | --library-dirs ${prefix}/lib" |
|---|
| 107 | |
|---|
| 108 | if {[variant_isset universal]} { |
|---|
| 109 | append fc_options "--f77flags '${configure.universal_cflags}' \ |
|---|
| 110 | --f90flags '${configure.universal_cflags}'" |
|---|
| 111 | } |
|---|
| 112 | |
|---|
| 113 | build.cmd-append ${fc_options} ${config_options} |
|---|
| 114 | destroot.cmd-append ${fc_options} ${config_options} |
|---|
| 115 | |
|---|
| 116 | reinplace "s|@@@|gcc-mp-4.4|" ${filespath}/c-wrapper |
|---|
| 117 | reinplace "s|@@@|g++-mp-4.4|" ${filespath}/c++-wrapper |
|---|
| 118 | reinplace "s|@@@|gfortran-mp-4.4|" ${filespath}/f-wrapper |
|---|
| 119 | } |
|---|
| 120 | |
|---|
| 121 | variant gcc43 conflicts gcc45 gcc44 gcc42 description "Use gcc-mp 4.3" { |
|---|
| 122 | depends_lib-append port:gcc43 |
|---|
| 123 | set fc_options "config_fc --fcompiler gnu95 \ |
|---|
| 124 | --f77exec ${filespath}/f-wrapper \ |
|---|
| 125 | --f90exec ${filespath}/f-wrapper " |
|---|
| 126 | set config_options "config --cc ${filespath}/c-wrapper \ |
|---|
| 127 | --include-dirs ${prefix}/include \ |
|---|
| 128 | --library-dirs ${prefix}/lib" |
|---|
| 129 | |
|---|
| 130 | if {[variant_isset universal]} { |
|---|
| 131 | append fc_options "--f77flags '${configure.universal_cflags}' \ |
|---|
| 132 | --f90flags '${configure.universal_cflags}'" |
|---|
| 133 | } |
|---|
| 134 | |
|---|
| 135 | build.cmd-append ${fc_options} ${config_options} |
|---|
| 136 | destroot.cmd-append ${fc_options} ${config_options} |
|---|
| 137 | |
|---|
| 138 | reinplace "s|@@@|gcc-mp-4.3|" ${filespath}/c-wrapper |
|---|
| 139 | reinplace "s|@@@|g++-mp-4.3|" ${filespath}/c++-wrapper |
|---|
| 140 | reinplace "s|@@@|gfortran-mp-4.3|" ${filespath}/f-wrapper |
|---|
| 141 | } |
|---|
| 142 | |
|---|
| 143 | variant gcc42 conflicts gcc45 gcc44 gcc43 description "Use gcc-mp 4.2" { |
|---|
| 144 | ui_warn ("Use of gcc/gfortran 4.2 is obsolete and not recommended") |
|---|
| 145 | depends_lib-append port:gcc42 |
|---|
| 146 | set fc_options "config_fc --fcompiler gnu95 \ |
|---|
| 147 | --f77exec ${filespath}/f-wrapper \ |
|---|
| 148 | --f90exec ${filespath}/f-wrapper " |
|---|
| 149 | set config_options "config --cc ${filespath}/c-wrapper \ |
|---|
| 150 | --include-dirs ${prefix}/include \ |
|---|
| 151 | --library-dirs ${prefix}/lib" |
|---|
| 152 | |
|---|
| 153 | if {[variant_isset universal]} { |
|---|
| 154 | append fc_options "--f77flags '${configure.universal_cflags}' \ |
|---|
| 155 | --f90flags '${configure.universal_cflags}'" |
|---|
| 156 | } |
|---|
| 157 | |
|---|
| 158 | build.cmd-append ${fc_options} ${config_options} |
|---|
| 159 | destroot.cmd-append ${fc_options} ${config_options} |
|---|
| 160 | |
|---|
| 161 | reinplace "s|@@@|gcc-mp-4.2|" ${filespath}/c-wrapper |
|---|
| 162 | reinplace "s|@@@|g++-mp-4.2|" ${filespath}/c++-wrapper |
|---|
| 163 | reinplace "s|@@@|gfortran-mp-4.2|" ${filespath}/f-wrapper |
|---|
| 164 | } |
|---|
| 165 | |
|---|
| 166 | post-patch { |
|---|
| 167 | reinplace \ |
|---|
| 168 | "s|include <\\(umfpack\.*.h\\)>|include <${prefix}/include/ufsparse/\\1>|g" ${worksrcpath}/scipy/sparse/linalg/dsolve/umfpack/umfpack.i |
|---|
| 169 | } |
|---|
| 170 | |
|---|
| 171 | post-destroot { |
|---|
| 172 | file delete -force ${filespath}/c-wrapper |
|---|
| 173 | file delete -force ${filespath}/c++-wrapper |
|---|
| 174 | file delete -force ${filespath}/f-wrapper |
|---|
| 175 | } |
|---|
| 176 | |
|---|
| 177 | livecheck.type regex |
|---|
| 178 | livecheck.url http://sourceforge.net/projects/scipy/files/ |
|---|
| 179 | livecheck.regex "files\/scipy\/(\\d+(?:\\.\\d+)*)\/scipy" |
|---|