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

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

multiple ports: Fix fortran recipe to allow libgcc-devel

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