source: trunk/dports/math/qrupdate/Portfile @ 114328

Last change on this file since 114328 was 114328, checked in by ryandesign@…, 6 years ago

use eq and ne instead of == and != when comparing ${os.arch}, ${configure.build_arch}, ${build_arch}, and some port-specific variables for referring to architectures

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
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 114328 2013-12-05 10:21:52Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           muniversal 1.0
6
7name                qrupdate
8version             1.1.2
9revision            2
10# upstream follows a weird folder naming policy, we need last two digits of version separated by a dot
11set branch          [join [lrange [split ${version} .] 1 2] .]
12categories          math
13license             GPL-3+
14maintainers         nomaintainer
15description         library for fast updates of QR and Cholesky decompositions
16long_description    a Fortran library for fast updates of QR and Cholesky decompositions
17homepage            http://sourceforge.net/projects/${name}/
18platforms           darwin
19master_sites        sourceforge:project/qrupdate/qrupdate/${branch}
20
21checksums           rmd160  9d23b2d13278c335f6208ebb6775df4b4049785c \
22                    sha256  e2a1c711dc8ebc418e21195833814cb2f84b878b90a2774365f0166402308e08
23
24use_configure       no
25build.target        lib solib
26
27build.args          PREFIX=${prefix}
28destroot.args       PREFIX=${prefix}
29test.args           PREFIX=${prefix}
30
31patchfiles          patch-Makefile.diff
32
33post-patch {
34    # Mac install program does not support -D flag.
35    reinplace "s|install -D|install|"  ${worksrcpath}/src/Makefile
36
37    # Running ranlib on static libraries make universal builds a little more complicated.
38    reinplace "s|ar -cr |libtool -o |"  ${worksrcpath}/src/Makefile
39}
40
41# Fortran compilers can not cross-compile
42if {${os.arch} eq "i386"} {
43    set universal_archs_supported "i386 x86_64"
44} else {
45    set universal_archs_supported "ppc ppc64"
46}
47
48post-configure {
49    if { ! [variant_isset universal] } {
50        if {${build_arch} eq "x86_64" || ${build_arch} eq "ppc64"} {
51            reinplace "s|^FFLAGS=|FFLAGS=-m64 |"  ${worksrcpath}/Makeconf
52        } else {
53            reinplace "s|^FFLAGS=|FFLAGS=-m32 |"  ${worksrcpath}/Makeconf
54        }
55    } else {
56        foreach arch ${universal_archs_to_use} {
57            if {${arch} eq "x86_64" || ${arch} eq "ppc64"} {
58                reinplace "s|^FFLAGS=|FFLAGS=-m64 |"  ${worksrcpath}-${arch}/Makeconf
59            } else {
60                reinplace "s|^FFLAGS=|FFLAGS=-m32 |"  ${worksrcpath}-${arch}/Makeconf
61            }
62        }
63    }
64}
65
66variant atlas description {build with atlas instead of Accelerate framework} {
67    depends_lib-append      port:atlas
68    build.args-append       BLAS="-L${prefix}/lib -ltatlas" LAPACK="-L${prefix}/lib -llapack"
69    destroot.args-append    BLAS="-L${prefix}/lib -ltatlas" LAPACK="-L${prefix}/lib -llapack"
70    test.args-append        BLAS="-L${prefix}/lib -ltatlas" LAPACK="-L${prefix}/lib -llapack"
71}
72if {![variant_isset atlas]} {
73    build.args-append       BLAS="-framework Accelerate" LAPACK="-framework Accelerate"
74    destroot.args-append    BLAS="-framework Accelerate" LAPACK="-framework Accelerate"
75    test.args-append        BLAS="-framework Accelerate" LAPACK="-framework Accelerate"
76}
77
78if {[variant_isset g95]} {
79    default_variants -atlas
80} else {
81    default_variants +atlas
82}
83
84
85variant g95 conflicts gcc45 gcc46 gcc47 gcc48 gcc49 universal description {build with g95} {
86    depends_build-append    port:g95
87    post-patch {
88        reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/Makefile
89        reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/src/Makefile
90    }
91}
92
93variant gcc45 conflicts g95 gcc46 gcc47 gcc48 gcc49 universal description {build with gcc45 fortran} {
94    depends_lib-append    path:lib/libgcc/libgcc_s.1.dylib:libgcc
95    depends_build-append  port:gcc45
96    post-patch {
97        reinplace "s|gfortran|gfortran-mp-4.5|" ${worksrcpath}/Makeconf
98    }
99}
100
101variant gcc46 conflicts g95 gcc45 gcc47 gcc48 gcc49 description {build with gcc46 fortran} {
102    depends_lib-append    path:lib/libgcc/libgcc_s.1.dylib:libgcc
103    depends_build-append  port:gcc46
104    post-patch {
105        reinplace "s|gfortran|gfortran-mp-4.6|" ${worksrcpath}/Makeconf
106    }
107}
108
109variant gcc47 conflicts g95 gcc45 gcc46 gcc48 gcc49 description {build with gcc47 fortran} {
110    depends_lib-append    path:lib/libgcc/libgcc_s.1.dylib:libgcc
111    depends_build-append  port:gcc47
112    post-patch {
113        reinplace "s|gfortran|gfortran-mp-4.7|" ${worksrcpath}/Makeconf
114    }
115}
116
117variant gcc48 conflicts g95 gcc45 gcc46 gcc47 gcc49 description {build with gcc48 fortran} {
118    depends_lib-append    path:lib/libgcc/libgcc_s.1.dylib:libgcc
119    depends_build-append  port:gcc48
120    post-patch {
121        reinplace "s|gfortran|gfortran-mp-4.8|" ${worksrcpath}/Makeconf
122    }
123}
124
125variant gcc49 conflicts g95 gcc45 gcc46 gcc47 gcc48 description {build with gcc49 fortran} {
126    depends_lib-append    path:lib/libgcc/libgcc_s.1.dylib:libgcc
127    depends_build-append  port:gcc49
128    post-patch {
129        reinplace "s|gfortran|gfortran-mp-4.9|" ${worksrcpath}/Makeconf
130    }
131}
132
133if {![variant_isset g95]   && ![variant_isset gcc45] && \
134    ![variant_isset gcc46] && ![variant_isset gcc47] && \
135    ![variant_isset gcc48] && ![variant_isset gcc49]} {
136    default_variants-append +gcc48
137}
138
139test.run yes
Note: See TracBrowser for help on using the repository browser.